slbotbm commented on code in PR #3102:
URL: https://github.com/apache/iggy/pull/3102#discussion_r3161471467


##########
foreign/cpp/src/client.rs:
##########
@@ -20,11 +20,112 @@ use iggy::prelude::{
     Client as IggyConnectionClient, CompressionAlgorithm as 
RustCompressionAlgorithm,
     ConsumerGroupClient, Identifier as RustIdentifier, IggyClient as 
RustIggyClient,
     IggyClientBuilder as RustIggyClientBuilder, IggyError, IggyExpiry as 
RustIggyExpiry,
-    MaxTopicSize as RustMaxTopicSize, PartitionClient, StreamClient, 
TopicClient, UserClient,
+    MaxTopicSize as RustMaxTopicSize, PartitionClient,
+    SnapshotCompression as RustSnapshotCompression, StreamClient, SystemClient 
as RustSystemClient,
+    SystemSnapshotType as RustSystemSnapshotType, TopicClient, UserClient,
 };
+use iggy_common::{
+    CacheMetrics as RustCacheMetrics, CacheMetricsKey as RustCacheMetricsKey,
+    ClientInfo as RustClientInfo, ClientInfoDetails as RustClientInfoDetails, 
Stats as RustStats,
+};
+use std::convert::TryFrom;
 use std::str::FromStr;
 use std::sync::Arc;
 
+impl From<RustClientInfo> for ffi::ClientInfo {
+    fn from(client: RustClientInfo) -> Self {
+        ffi::ClientInfo {
+            client_id: client.client_id,
+            // TODO(slbotbm): In high-level client, this should be converted 
to None.
+            user_id: client.user_id.unwrap_or(u32::MAX),

Review Comment:
   added has_user_id



##########
foreign/cpp/src/client.rs:
##########
@@ -20,11 +20,112 @@ use iggy::prelude::{
     Client as IggyConnectionClient, CompressionAlgorithm as 
RustCompressionAlgorithm,
     ConsumerGroupClient, Identifier as RustIdentifier, IggyClient as 
RustIggyClient,
     IggyClientBuilder as RustIggyClientBuilder, IggyError, IggyExpiry as 
RustIggyExpiry,
-    MaxTopicSize as RustMaxTopicSize, PartitionClient, StreamClient, 
TopicClient, UserClient,
+    MaxTopicSize as RustMaxTopicSize, PartitionClient,
+    SnapshotCompression as RustSnapshotCompression, StreamClient, SystemClient 
as RustSystemClient,
+    SystemSnapshotType as RustSystemSnapshotType, TopicClient, UserClient,
 };
+use iggy_common::{
+    CacheMetrics as RustCacheMetrics, CacheMetricsKey as RustCacheMetricsKey,
+    ClientInfo as RustClientInfo, ClientInfoDetails as RustClientInfoDetails, 
Stats as RustStats,
+};
+use std::convert::TryFrom;
 use std::str::FromStr;
 use std::sync::Arc;
 
+impl From<RustClientInfo> for ffi::ClientInfo {
+    fn from(client: RustClientInfo) -> Self {
+        ffi::ClientInfo {
+            client_id: client.client_id,
+            // TODO(slbotbm): In high-level client, this should be converted 
to None.
+            user_id: client.user_id.unwrap_or(u32::MAX),
+            address: client.address,
+            transport: client.transport,
+            consumer_groups_count: client.consumer_groups_count,
+        }
+    }
+}
+
+impl From<RustClientInfoDetails> for ffi::ClientInfoDetails {
+    fn from(client: RustClientInfoDetails) -> Self {
+        ffi::ClientInfoDetails {
+            client_id: client.client_id,
+            // TODO(slbotbm): In high-level client, this should be converted 
to None.
+            user_id: client.user_id.unwrap_or(u32::MAX),

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to