Make SegmentHandoffNotifier Closeable.

This commit is contained in:
Gian Merlino 2016-01-06 14:10:51 -05:00
parent ad5ffdf483
commit 92c828f904
5 changed files with 7 additions and 6 deletions

View File

@ -1005,7 +1005,7 @@ public class RealtimeIndexTaskTest
} }
@Override @Override
public void stop() public void close()
{ {
//Noop //Noop
} }

View File

@ -451,7 +451,7 @@ public class TaskLifecycleTest
} }
@Override @Override
public void stop() public void close()
{ {
//Noop //Noop
} }

View File

@ -159,7 +159,7 @@ public class CoordinatorBasedSegmentHandoffNotifier implements SegmentHandoffNot
} }
@Override @Override
public void stop() public void close()
{ {
scheduledExecutor.shutdown(); scheduledExecutor.shutdown();
} }

View File

@ -651,7 +651,7 @@ public class RealtimePlumber implements Plumber
} }
} }
handoffNotifier.stop(); handoffNotifier.close();
shutdownExecutors(); shutdownExecutors();
stopped = true; stopped = true;

View File

@ -21,9 +21,10 @@ package io.druid.segment.realtime.plumber;
import io.druid.query.SegmentDescriptor; import io.druid.query.SegmentDescriptor;
import java.io.Closeable;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
public interface SegmentHandoffNotifier public interface SegmentHandoffNotifier extends Closeable
{ {
/** /**
* register a handOffCallback to be called when segment handoff is complete. * register a handOffCallback to be called when segment handoff is complete.
@ -47,6 +48,6 @@ public interface SegmentHandoffNotifier
/** /**
* Perform any final processing and clean up after ourselves. * Perform any final processing and clean up after ourselves.
*/ */
void stop(); void close();
} }