gaurav-narula commented on code in PR #15962:
URL: https://github.com/apache/kafka/pull/15962#discussion_r1601428859
##########
storage/src/test/java/org/apache/kafka/server/log/remote/metadata/storage/TopicBasedRemoteLogMetadataManagerMultipleSubscriptionsTest.java:
##########
@@ -108,7 +114,23 @@ public void testMultiplePartitionSubscriptions() throws
Exception {
final TopicIdPartition followerTopicIdPartition = new
TopicIdPartition(Uuid.randomUuid(), new TopicPartition(followerTopic, 0));
final TopicIdPartition emptyTopicIdPartition = new
TopicIdPartition(Uuid.randomUuid(), new TopicPartition(topicWithNoMessages, 0));
- RemoteLogMetadataTopicPartitioner partitioner = new
RemoteLogMetadataTopicPartitioner(10) {
+ final RemotePartitionMetadataStore spyRemotePartitionMetadataStore =
spy(new RemotePartitionMetadataStore());
+
+ Phaser initializationPhaser = new Phaser(2); // 1 to register test
thread, 1 to register leaderTopicIdPartition
+ doAnswer(invocationOnMock -> {
+ Object result = invocationOnMock.callRealMethod();
+ initializationPhaser.arriveAndDeregister();
Review Comment:
I've added some comments in
https://github.com/apache/kafka/pull/15962/commits/9cfda4f3d69049b938da9121dc7ac606b8b04aad
to describe the Phaser operations following Kamal's suggestion.
Please let me know if that's okay. I'd prefer not duplicating the stub given
a data structure in the standard library fits the purpose but I'm happy to
change it if you feel it's confusing for future readers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]