Last active
October 26, 2020 23:13
-
-
Save gabriel-tincu/9e9fd152666a2364b7587e7d0b456f8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testListPartitionReassignmentsResponse() { | |
List<ListPartitionReassignmentsRequestData.ListPartitionReassignmentsTopics> topList = new ArrayList<>(); | |
ListPartitionReassignmentsRequestData.ListPartitionReassignmentsTopics top = new ListPartitionReassignmentsRequestData.ListPartitionReassignmentsTopics().setName("fooTopic"); | |
topList.add(top); | |
List<Integer> parts = new ArrayList<>(); | |
parts.add(10); | |
top.setPartitionIndexes(parts); | |
ListPartitionReassignmentsRequest r = new ListPartitionReassignmentsRequest.Builder(new ListPartitionReassignmentsRequestData().setTimeoutMs(10000).setTopics(topList)).build(); | |
ByteBuffer bb = r.serialize(new RequestHeader(ApiKeys.LIST_PARTITION_REASSIGNMENTS, (short) 0, "foo-client", (short) 0)); | |
byte[] arr = bb.array(); | |
for (byte b : arr) { | |
System.out.printf("%d ", b); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment