Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,14 @@ default Duration getDurationToGiveUpRetry() {
default Duration getDurationToDelayRetry() {
return DEFAULT_MAX_DURATION_TO_DELAY_RETRY;
}

/**
* Gets the lease interval for the leader scheduler.
* Defaults to 1 minute if not overridden.
*
* @return Duration for lease interval
*/
default Duration getLeaseInterval() {
return Duration.ofMinutes(1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This default is a little low. The default is normally 10 minutes at this time I think.

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public void start(Buffer<Record<Event>> buffer) {
boolean isPartitionCreated = coordinator.createPartition(leaderPartition);
log.debug("Leader partition creation status: {}", isPartitionCreated);

Runnable leaderScheduler = new LeaderScheduler(coordinator, crawler);
LeaderScheduler leaderScheduler = new LeaderScheduler(coordinator, crawler);
leaderScheduler.setLeaseInterval(sourceConfig.getLeaseInterval());
this.executorService.submit(leaderScheduler);
//Register worker threaders
for (int i = 0; i < sourceConfig.getNumberOfWorkers(); i++) {
Expand Down
Loading