hubcio commented on code in PR #3559:
URL: https://github.com/apache/iggy/pull/3559#discussion_r3490713717


##########
foreign/cpp/build.rs:
##########
@@ -21,7 +21,8 @@ fn main() {
         .compile("iggy-cpp-bridge");
 
     println!("cargo:rerun-if-changed=src/client.rs");
-    println!("cargo:rerun-if-changed=src/consumer_group.rs");
+    println!("cargo:rerun-if-changed=src/consumer.rs");
+    println!("cargo:rerun-if-changed=src/producer.rs");

Review Comment:
   the `rerun-if-changed` list is out of sync with this PR. lines 29-30 still 
point at `src/stream.rs` and `src/topic.rs`, both deleted here. once a build 
script emits any `rerun-if-changed`, cargo stops watching the whole package and 
only watches the listed paths - and a listed path that no longer exists is 
treated as always-dirty, so the script reruns on every `cargo build` and 
recompiles the cxx C++ bridge each time. confirmed locally: with a missing 
listed path the build script ran on 3 of 3 no-op builds, vs 1 of 3 when every 
path exists. fix: drop the `stream.rs` and `topic.rs` lines. separately the new 
`src/type_conversion.rs` isn't listed - not a correctness issue (cxx codegen 
only reads `lib.rs`, and the crate recompiles on any `.rs` change regardless) 
but worth adding for consistency.



##########
foreign/cpp/src/client.rs:
##########
@@ -822,6 +777,144 @@ impl Client {
         })
     }
 
+    pub fn store_consumer_offset(

Review Comment:
   `store_consumer_offset`, `get_consumer_offset` and `delete_consumer_offset` 
repeat the same two blocks verbatim - the `consumer_kind` match (`"consumer"` 
-> `Consumer::new`, `"consumer_group"` -> `Consumer::group`, else error) and 
the `partition_id == ANY_PARTITION_ID` -> `Option` mapping (a 4th copy of the 
one in `poll_messages`). worth pulling out a small `resolve_consumer(kind, id)` 
helper plus an `opt_partition(u32)` helper so the kind strings and the sentinel 
live in one place. drops ~30 lines and removes the risk of the three copies 
drifting apart.



-- 
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