remove unnecessary parameters(reusefuture) and related logic
@@ -157,13 +157,13 @@ public abstract class AdminResource extends PulsarWebResource {
}
List<CompletableFuture<Void>> futures = new ArrayList<>(numPartitions);
for (int i = 0; i < numPartitions; i++) {
- futures.add(tryCreatePartitionAsync(i, null));
+ futures.add(tryCreatePartitionAsync(i));
}
return FutureUtil.waitForAll(futures);
}
- private CompletableFuture<Void> tryCreatePartitionAsync(final int partition, CompletableFuture<Void> reuseFuture) {
- CompletableFuture<Void> result = reuseFuture == null ? new CompletableFuture<>() : reuseFuture;
+ private CompletableFuture<Void> tryCreatePartitionAsync(final int partition) {
+ CompletableFuture<Void> result = new CompletableFuture<>();
getPulsarResources().getTopicResources().createPersistentTopicAsync(topicName.getPartition(partition))
.thenAccept(r -> {
if (log.isDebugEnabled()) {
