From 6be6337ab0617304fa839e3f40e9cf7f3df23071 Mon Sep 17 00:00:00 2001 From: nishantmonu51 Date: Fri, 9 May 2014 23:33:00 +0530 Subject: [PATCH] remove initial delay from polling remove initial delay from polling in coordinator, this will help in the cases when the pollDuration is set to higher than coordinator startDelay. --- server/src/main/java/io/druid/db/DatabaseSegmentManager.java | 2 +- .../src/test/java/io/druid/db/DatabaseSegmentManagerTest.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/io/druid/db/DatabaseSegmentManager.java b/server/src/main/java/io/druid/db/DatabaseSegmentManager.java index 930322106f8..a8b5b02bc16 100644 --- a/server/src/main/java/io/druid/db/DatabaseSegmentManager.java +++ b/server/src/main/java/io/druid/db/DatabaseSegmentManager.java @@ -106,7 +106,7 @@ public class DatabaseSegmentManager final Duration delay = config.get().getPollDuration().toStandardDuration(); ScheduledExecutors.scheduleWithFixedDelay( exec, - delay, + new Duration(0), delay, new Runnable() { diff --git a/server/src/test/java/io/druid/db/DatabaseSegmentManagerTest.java b/server/src/test/java/io/druid/db/DatabaseSegmentManagerTest.java index 267f86a8a56..329f5490ad1 100644 --- a/server/src/test/java/io/druid/db/DatabaseSegmentManagerTest.java +++ b/server/src/test/java/io/druid/db/DatabaseSegmentManagerTest.java @@ -106,6 +106,7 @@ public class DatabaseSegmentManagerTest @Test public void testPoll() { + EasyMock.expect(dbi.withHandle(EasyMock.anyObject())).andReturn(testRows); EasyMock.expect(dbi.withHandle(EasyMock.anyObject())).andReturn(testRows); EasyMock.replay(dbi);