GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — MINOR: Deduplicate share fetch test helpers (#23953) · coderbruis/kafka@c4480af

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • core/src/test/java/kafka/server/share
    • DelayedShareFetchTest.java
    • SharePartitionManagerTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎core/src/test/java/kafka/server/share/DelayedShareFetchTest.java‎

Copy file name to clipboardExpand all lines: core/src/test/java/kafka/server/share/DelayedShareFetchTest.java
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3458,13 +3458,7 @@ private static LinkedHashMap<TopicIdPartition, LogReadResult> toLogReadResultMap
34583458
}
34593459

34603460
private static LinkedHashMap<TopicIdPartition, LogReadResult> buildLogReadResultMap(List<TopicIdPartition> topicIdPartitions, Records records) {
3461-
return CollectionConverters.asJava(buildLogReadResult(topicIdPartitions, records)).stream()
3462-
.collect(Collectors.toMap(
3463-
Tuple2::_1,
3464-
Tuple2::_2,
3465-
(oldValue, newValue) -> oldValue,
3466-
LinkedHashMap::new
3467-
));
3461+
return toLogReadResultMap(buildLogReadResult(topicIdPartitions, records));
34683462
}
34693463

34703464
@SuppressWarnings("unchecked")
Collapse file

‎core/src/test/java/kafka/server/share/SharePartitionManagerTest.java‎

Copy file name to clipboardExpand all lines: core/src/test/java/kafka/server/share/SharePartitionManagerTest.java
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3261,13 +3261,15 @@ private void validateBrokerTopicStatsMetrics(
32613261
}
32623262

32633263
static Seq<Tuple2<TopicIdPartition, LogReadResult>> buildLogReadResult(List<TopicIdPartition> topicIdPartitions) {
3264-
return buildLogReadResult(topicIdPartitions, MemoryRecords.withRecords(
3265-
Compression.NONE, new SimpleRecord("test-key".getBytes(), "test-value".getBytes())));
3264+
return buildLogReadResult(topicIdPartitions, defaultTestRecords());
32663265
}
32673266

32683267
static Seq<Tuple2<TopicIdPartition, LogReadResult>> buildLogReadResult(Map<TopicIdPartition, LogOffsetMetadata> fetchOffsetMetadata) {
3269-
return buildLogReadResult(fetchOffsetMetadata, MemoryRecords.withRecords(
3270-
Compression.NONE, new SimpleRecord("test-key".getBytes(), "test-value".getBytes())));
3268+
return buildLogReadResult(fetchOffsetMetadata, defaultTestRecords());
3269+
}
3270+
3271+
private static MemoryRecords defaultTestRecords() {
3272+
return MemoryRecords.withRecords(Compression.NONE, new SimpleRecord("test-key".getBytes(), "test-value".getBytes()));
32713273
}
32723274

32733275
static Seq<Tuple2<TopicIdPartition, LogReadResult>> buildEmptyLogReadResult(List<TopicIdPartition> topicIdPartitions) {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.