Skip to content

Commit

Permalink
Allow topic compaction to be disabled in Pulsar Functions (apache#7677)
Browse files Browse the repository at this point in the history
Co-authored-by: Jerry Peng <[email protected]>
  • Loading branch information
jerrypeng and Jerry Peng authored Jul 28, 2020
1 parent fffd9f1 commit e2bf486
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ public synchronized void initialize() {
new LinkedBlockingQueue<>(5));
executorService.setThreadFactory(new ThreadFactoryBuilder().setNameFormat("worker-scheduler-%d").build());
scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(new DefaultThreadFactory("worker-assignment-topic-compactor"));
scheduleCompaction(this.scheduledExecutorService, workerConfig.getTopicCompactionFrequencySec());
if (workerConfig.getTopicCompactionFrequencySec() > 0) {
scheduleCompaction(this.scheduledExecutorService, workerConfig.getTopicCompactionFrequencySec());
}

isRunning = true;
lastMessageProduced = null;
Expand Down

0 comments on commit e2bf486

Please sign in to comment.