Skip to content
Merged
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 @@ -26,6 +26,7 @@
import org.apache.druid.java.util.common.logger.Logger;
import org.apache.druid.query.SegmentDescriptor;
import org.apache.druid.server.coordination.DruidServerMetadata;
import org.joda.time.Duration;

import java.util.Iterator;
import java.util.List;
Expand All @@ -43,7 +44,7 @@ public class CoordinatorBasedSegmentHandoffNotifier implements SegmentHandoffNot
private final ConcurrentMap<SegmentDescriptor, Pair<Executor, Runnable>> handOffCallbacks = new ConcurrentHashMap<>();
private final CoordinatorClient coordinatorClient;
private volatile ScheduledExecutorService scheduledExecutor;
private final long pollDurationMillis;
private final Duration pollDuration;
private final String dataSource;

public CoordinatorBasedSegmentHandoffNotifier(
Expand All @@ -54,7 +55,7 @@ public CoordinatorBasedSegmentHandoffNotifier(
{
this.dataSource = dataSource;
this.coordinatorClient = coordinatorClient;
this.pollDurationMillis = config.getPollDuration().getMillis();
this.pollDuration = config.getPollDuration();
}

@Override
Expand All @@ -80,7 +81,7 @@ public void run()
{
checkForSegmentHandoffs();
}
}, 0L, pollDurationMillis, TimeUnit.MILLISECONDS
}, 0L, pollDuration.getMillis(), TimeUnit.MILLISECONDS
);
}

Expand Down Expand Up @@ -114,10 +115,10 @@ void checkForSegmentHandoffs()
catch (Exception e) {
log.error(
e,
"Exception while checking handoff for dataSource[%s] Segment[%s], Will try again after [%d]secs",
"Exception while checking handoff for dataSource[%s] Segment[%s]; will try again after [%s]",
dataSource,
descriptor,
pollDurationMillis
pollDuration
);
}
}
Expand All @@ -128,9 +129,9 @@ void checkForSegmentHandoffs()
catch (Throwable t) {
log.error(
t,
"Exception while checking handoff for dataSource[%s], Will try again after [%d]secs",
"Exception while checking handoff for dataSource[%s]; will try again after [%s]",
dataSource,
pollDurationMillis
pollDuration
);
}
}
Expand Down