Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -107,7 +106,7 @@ public void setup() {
taskAssignor = new StickyTaskAssignor();

Map<String, StreamsGroupMember> members = createMembers();
this.assignmentConfigs = Collections.singletonMap(
this.assignmentConfigs = Map.of(
"num.standby.replicas",
Integer.toString(standbyReplicas)
);
Expand Down Expand Up @@ -138,7 +137,7 @@ private void simulateIncrementalRebalance() {
for (Map.Entry<String, AssignmentMemberSpec> member : groupSpec.members().entrySet()) {
MemberAssignment memberAssignment = members.getOrDefault(
member.getKey(),
new MemberAssignment(Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap())
new MemberAssignment(Map.of(), Map.of(), Map.of())
);

updatedMemberSpec.put(member.getKey(), new AssignmentMemberSpec(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -405,12 +404,7 @@ public void shutdown() throws InterruptedException {

}

private static class Scheduled implements Delayed {
final FakeOperation operation;

public Scheduled(FakeOperation operation) {
this.operation = operation;
}
private record Scheduled(FakeOperation operation) implements Delayed {

@Override
public long getDelay(TimeUnit unit) {
Expand All @@ -429,30 +423,11 @@ else if (operation.completesAt > other.operation.completesAt)
}
}

private static class FakeOperationKey implements DelayedOperationKey {
private final String key;

public FakeOperationKey(String key) {
this.key = key;
}

private record FakeOperationKey(String key) implements DelayedOperationKey {
@Override
public String keyLabel() {
return key;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
FakeOperationKey that = (FakeOperationKey) o;
return Objects.equals(key, that.key);
}

@Override
public int hashCode() {
return Objects.hash(key);
}
}

private static class FakeOperation extends DelayedOperation {
Expand All @@ -469,7 +444,6 @@ public FakeOperation(long delayMs, long latencyMs, CountDownLatch latch) {

@Override
public void onExpiration() {

}

@Override
Expand Down