coderzc commented on code in PR #20718:
URL: https://github.com/apache/pulsar/pull/20718#discussion_r1255476546
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -434,6 +420,37 @@ public AtomicLong getPendingWriteOps() {
return pendingWriteOps;
}
+ protected CompletableFuture<Void> newTopicCompactionService() {
+ CompactionServiceFactory compactionServiceFactory =
brokerService.pulsar().getCompactionServiceFactory();
+ return
compactionServiceFactory.newTopicCompactionService(topic).thenAccept(topicCompactionService
-> {
+ PersistentTopic.this.topicCompactionService =
topicCompactionService;
+ });
+ }
+
+ private CompletableFuture<Void> createPersistentSubscriptions() {
Review Comment:
> I have another question that why did you move this logic out of the
PersistentTopic's constructor?
Because `createPersistentSubscription` depends on topicCompactionService
object,
see:https://github.com/apache/pulsar/blob/4586852f30902b5247d907ce4cc9360152db1e21/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java#L482-L488
--
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]