Skip to content

Commit 6aa0df8

Browse files
committed
address comment
1 parent 67c3c18 commit 6aa0df8

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

server/src/main/java/org/apache/kafka/server/FetchPartitionStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public record FetchPartitionStatus(
3131
@Override
3232
public String toString() {
3333
return String.format(
34-
"[startOffsetMetadata: %s, fetchInfo: %s",
34+
"[startOffsetMetadata: %s, fetchInfo: %s]",
3535
startOffsetMetadata,
3636
fetchInfo
3737
);

server/src/main/java/org/apache/kafka/server/purgatory/DelayedRemoteFetch.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class DelayedRemoteFetch extends DelayedOperation {
5858
// For compatibility, metrics are defined to be under `kafka.server.DelayedRemoteFetchMetrics` class
5959
private static final KafkaMetricsGroup METRICS_GROUP = new KafkaMetricsGroup("kafka.server", "DelayedRemoteFetchMetrics");
6060

61-
static final Meter EXPIRED_REQUEST_METER = METRICS_GROUP.newMeter("ExpiresPerSec", "requests", TimeUnit.SECONDS);
61+
private static final Meter EXPIRED_REQUEST_METER = METRICS_GROUP.newMeter("ExpiresPerSec", "requests", TimeUnit.SECONDS);
6262

6363
private final Map<TopicIdPartition, Future<Void>> remoteFetchTasks;
6464
private final Map<TopicIdPartition, CompletableFuture<RemoteLogReadResult>> remoteFetchResults;
@@ -95,10 +95,13 @@ public DelayedRemoteFetch(Map<TopicIdPartition, Future<Void>> remoteFetchTasks,
9595

9696
/**
9797
* The operation can be completed if:
98-
*
98+
* <p>
9999
* Case a: This broker is no longer the leader of the partition it tries to fetch
100+
* <p>
100101
* Case b: This broker does not know the partition it tries to fetch
101-
* Case c: All the remote storage read request completed (succeeded or failed)
102+
* <p>
103+
* Case c: All the remote storage read requests completed (succeeded or failed)
104+
* <p>
102105
* Case d: The partition is in an offline log directory on this broker
103106
*
104107
* Upon completion, should return whatever data is available for each valid partition
@@ -195,4 +198,4 @@ public void onComplete() {
195198
public static Meter expiredRequestMeter() {
196199
return EXPIRED_REQUEST_METER;
197200
}
198-
}
201+
}

server/src/test/java/org/apache/kafka/server/purgatory/DelayedRemoteFetchTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,4 +477,4 @@ private RemoteLogReadResult buildRemoteReadResult(Errors error) {
477477
Optional.of(new FetchDataInfo(LogOffsetMetadata.UNKNOWN_OFFSET_METADATA, MemoryRecords.EMPTY)),
478478
error != Errors.NONE ? Optional.of(error.exception()) : Optional.empty());
479479
}
480-
}
480+
}

0 commit comments

Comments
 (0)