Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7e7681

Browse files
committed
Fixed some of the merge problems for error improvements
1 parente1d1c51 commite7e7681

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

‎examples/offset-monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl State {
131131

132132
if !group.is_empty(){
133133
// ~ get the current group offsets
134-
let groups = client.fetch_group_topic_offsets(group, topic)?;
134+
let groups = client.fetch_group_topic_offset(group, topic)?;
135135
for gin groups{
136136
let off =self
137137
.offsets

‎src/client/mod.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ impl KafkaClient {
12121212
/// .unwrap();
12131213
/// ```
12141214
///
1215-
/// See also `KafkaClient::fetch_group_topic_offsets`.
1215+
/// See also `KafkaClient::fetch_group_topic_offset`.
12161216
pubfnfetch_group_offsets<'a,J,I>(
12171217
&mutself,
12181218
group:&str,
@@ -1253,9 +1253,9 @@ impl KafkaClient {
12531253
///
12541254
/// let mut client = KafkaClient::new(vec!["localhost:9092".to_owned()]);
12551255
/// client.load_metadata_all().unwrap();
1256-
/// let offsets = client.fetch_group_topic_offsets("my-group", "my-topic").unwrap();
1256+
/// let offsets = client.fetch_group_topic_offset("my-group", "my-topic").unwrap();
12571257
/// ```
1258-
pubfn fetch_group_topic_offset
1258+
pubfnfetch_group_topic_offset(
12591259
&mutself,
12601260
group:&str,
12611261
topic:&str,
@@ -1278,18 +1278,20 @@ impl KafkaClient {
12781278
}
12791279
}
12801280

1281-
Ok(__fetch_group_offsets(req,&mutself.state,&mutself.conn_pool,&self.config)?
1282-
.remove(topic)
1283-
.unwrap_or_default())
1281+
Ok(
1282+
__fetch_group_offsets(req,&mutself.state,&mutself.conn_pool,&self.config)?
1283+
.remove(topic)
1284+
.unwrap_or_default(),
1285+
)
12841286
}
12851287
None =>Err(Error::UnsetOffsetStorage),
12861288
}
12871289

1288-
Ok(
1289-
__fetch_group_offsets(req,&mutself.state,&mutself.conn_pool,&self.config)?
1290-
.remove(topic)
1291-
.unwrap_or_default(),
1292-
)
1290+
//Ok(
1291+
// __fetch_group_offsets(req, &mut self.state, &mut self.conn_pool, &self.config)?
1292+
// .remove(topic)
1293+
// .unwrap_or_default(),
1294+
//)
12931295
}
12941296
}
12951297

‎tests/integration/client/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn test_commit_offset() {
174174
client.commit_offset(TEST_GROUP_NAME,TEST_TOPIC_NAME, partition, offset);
175175

176176
let partition_offsets:HashSet<PartitionOffset> = client
177-
.fetch_group_topic_offsets(TEST_GROUP_NAME,TEST_TOPIC_NAME)
177+
.fetch_group_topic_offset(TEST_GROUP_NAME,TEST_TOPIC_NAME)
178178
.unwrap()// Already being unwrapped
179179
.into_iter()
180180
.collect();
@@ -232,7 +232,7 @@ fn test_commit_offsets() {
232232
client.commit_offsets(TEST_GROUP_NAME, commit_pair);// why unwrap ??
233233

234234
let partition_offsets:HashSet<PartitionOffset> = client
235-
.fetch_group_topic_offsets(TEST_GROUP_NAME,TEST_TOPIC_NAME)
235+
.fetch_group_topic_offset(TEST_GROUP_NAME,TEST_TOPIC_NAME)
236236
.unwrap()
237237
.into_iter()
238238
.collect();

‎tests/integration/consumer_producer/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn test_consumer_with_client(mut client: KafkaClient) -> Consumer {
7171

7272
client.load_metadata_all();// Why unwrap ?
7373
let partition_offsets:HashSet<PartitionOffset> = client
74-
.fetch_group_topic_offsets(TEST_GROUP_NAME,TEST_TOPIC_NAME)
74+
.fetch_group_topic_offset(TEST_GROUP_NAME,TEST_TOPIC_NAME)
7575
.unwrap()
7676
.into_iter()
7777
.collect();
@@ -106,7 +106,7 @@ pub(crate) fn get_group_offsets(
106106
default_offset:Option<i64>,
107107
) ->HashMap<i32,i64>{
108108
client
109-
.fetch_group_topic_offsets(group, topic)
109+
.fetch_group_topic_offset(group, topic)
110110
.unwrap()
111111
.iter()
112112
.map(|po|{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp