Merge pull request #388 from pfifer/default-deprecated
Change the CoordinatorFactory deprecated methods to default
This commit is contained in:
commit
0634a3c836
2 changed files with 27 additions and 27 deletions
|
|
@ -22,7 +22,7 @@ import software.amazon.kinesis.leases.ShardInfo;
|
||||||
import software.amazon.kinesis.processor.Checkpointer;
|
import software.amazon.kinesis.processor.Checkpointer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Used in the process of configuring and providing instances to the {@link Scheduler}
|
||||||
*/
|
*/
|
||||||
public interface CoordinatorFactory {
|
public interface CoordinatorFactory {
|
||||||
/**
|
/**
|
||||||
|
|
@ -35,30 +35,48 @@ public interface CoordinatorFactory {
|
||||||
/**
|
/**
|
||||||
* Creates GracefulShutdownCoordinator to be used by the Scheduler.
|
* Creates GracefulShutdownCoordinator to be used by the Scheduler.
|
||||||
*
|
*
|
||||||
|
* <h3>Method Deprecated</h3>
|
||||||
* <p>
|
* <p>
|
||||||
* Note: This method has been deprecated, and will be removed in a future release. Use the configuration in
|
* <strong>Note: This method has been deprecated, and will be removed in a future release. Use the configuration in
|
||||||
* {@link CoordinatorConfig#gracefulShutdownCoordinator}. Set the
|
* {@link CoordinatorConfig#gracefulShutdownCoordinator}. Set the
|
||||||
* {@link CoordinatorConfig#gracefulShutdownCoordinator} to null in order to use this method.
|
* {@link CoordinatorConfig#gracefulShutdownCoordinator} to null in order to use this method.</strong>
|
||||||
* </p>
|
* </p>
|
||||||
|
* <h4>Resolution Order</h3>
|
||||||
|
* <ol>
|
||||||
|
* <li>{@link CoordinatorConfig#gracefulShutdownCoordinator()}</li>
|
||||||
|
* <li>{@link CoordinatorFactory#createGracefulShutdownCoordinator()}</li>
|
||||||
|
* </ol>
|
||||||
*
|
*
|
||||||
* @return GracefulShutdownCoordinator
|
*
|
||||||
|
* @return a {@link GracefulShutdownCoordinator} that manages the process of shutting down the scheduler.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
GracefulShutdownCoordinator createGracefulShutdownCoordinator();
|
default GracefulShutdownCoordinator createGracefulShutdownCoordinator() {
|
||||||
|
return new GracefulShutdownCoordinator();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a WorkerStateChangeListener to be used by the Scheduler.
|
* Creates a WorkerStateChangeListener to be used by the Scheduler.
|
||||||
*
|
*
|
||||||
|
* <h3>Method Deprecated</h3>
|
||||||
* <p>
|
* <p>
|
||||||
* Note: This method has been deprecated, and will be removed in a future release. Use the configuration in
|
* <strong>Note: This method has been deprecated, and will be removed in a future release. Use the configuration in
|
||||||
* {@link CoordinatorConfig#workerStateChangeListener}. Set the
|
* {@link CoordinatorConfig#workerStateChangeListener}. Set the
|
||||||
* {@link CoordinatorConfig#workerStateChangeListener} to null in order to use this method.
|
* {@link CoordinatorConfig#workerStateChangeListener} to null in order to use this method.</strong>
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @return
|
* <h4>Resolution Order</h3>
|
||||||
|
* <ol>
|
||||||
|
* <li>{@link CoordinatorConfig#workerStateChangeListener()}</li>
|
||||||
|
* <li>{@link CoordinatorFactory#createWorkerStateChangeListener()}</li>
|
||||||
|
* </ol>
|
||||||
|
*
|
||||||
|
* @return a {@link WorkerStateChangeListener} instance that will be notified for specific {@link Scheduler} steps.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
WorkerStateChangeListener createWorkerStateChangeListener();
|
default WorkerStateChangeListener createWorkerStateChangeListener() {
|
||||||
|
return new NoOpWorkerStateChangeListener();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a RecordProcessorChedckpointer to be used by the Scheduler.
|
* Creates a RecordProcessorChedckpointer to be used by the Scheduler.
|
||||||
|
|
|
||||||
|
|
@ -45,24 +45,6 @@ public class SchedulerCoordinatorFactory implements CoordinatorFactory {
|
||||||
new ThreadFactoryBuilder().setNameFormat("ShardRecordProcessor-%04d").build());
|
new ThreadFactoryBuilder().setNameFormat("ShardRecordProcessor-%04d").build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
|
||||||
public GracefulShutdownCoordinator createGracefulShutdownCoordinator() {
|
|
||||||
return new GracefulShutdownCoordinator();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@Override
|
|
||||||
public WorkerStateChangeListener createWorkerStateChangeListener() {
|
|
||||||
return new NoOpWorkerStateChangeListener();
|
|
||||||
}
|
|
||||||
|
|
||||||
static class SchedulerThreadPoolExecutor extends ThreadPoolExecutor {
|
static class SchedulerThreadPoolExecutor extends ThreadPoolExecutor {
|
||||||
private static final long DEFAULT_KEEP_ALIVE = 60L;
|
private static final long DEFAULT_KEEP_ALIVE = 60L;
|
||||||
SchedulerThreadPoolExecutor(ThreadFactory threadFactory) {
|
SchedulerThreadPoolExecutor(ThreadFactory threadFactory) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue