diff --git a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/CoordinatorFactory.java b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/CoordinatorFactory.java index 09d517052..7a055bc79 100644 --- a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/CoordinatorFactory.java +++ b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/CoordinatorFactory.java @@ -22,7 +22,7 @@ import software.amazon.kinesis.processor.Checkpointer; /** - * + * Used in the process of configuring and providing instances to the {@link Scheduler} */ public interface CoordinatorFactory { /** @@ -35,30 +35,48 @@ public interface CoordinatorFactory { /** * Creates GracefulShutdownCoordinator to be used by the Scheduler. * + *

Method Deprecated

*

- * Note: This method has been deprecated, and will be removed in a future release. Use the configuration in + * 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} to null in order to use this method. + * {@link CoordinatorConfig#gracefulShutdownCoordinator} to null in order to use this method. *

+ *

Resolution Order

+ *
    + *
  1. {@link CoordinatorConfig#gracefulShutdownCoordinator()}
  2. + *
  3. {@link CoordinatorFactory#createGracefulShutdownCoordinator()}
  4. + *
+ * * - * @return GracefulShutdownCoordinator + * @return a {@link GracefulShutdownCoordinator} that manages the process of shutting down the scheduler. */ @Deprecated - GracefulShutdownCoordinator createGracefulShutdownCoordinator(); + default GracefulShutdownCoordinator createGracefulShutdownCoordinator() { + return new GracefulShutdownCoordinator(); + } /** * Creates a WorkerStateChangeListener to be used by the Scheduler. * + *

Method Deprecated

*

- * Note: This method has been deprecated, and will be removed in a future release. Use the configuration in + * 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} to null in order to use this method. + * {@link CoordinatorConfig#workerStateChangeListener} to null in order to use this method. *

* - * @return + *

Resolution Order

+ *
    + *
  1. {@link CoordinatorConfig#workerStateChangeListener()}
  2. + *
  3. {@link CoordinatorFactory#createWorkerStateChangeListener()}
  4. + *
+ * + * @return a {@link WorkerStateChangeListener} instance that will be notified for specific {@link Scheduler} steps. */ @Deprecated - WorkerStateChangeListener createWorkerStateChangeListener(); + default WorkerStateChangeListener createWorkerStateChangeListener() { + return new NoOpWorkerStateChangeListener(); + } /** * Creates a RecordProcessorChedckpointer to be used by the Scheduler. diff --git a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/SchedulerCoordinatorFactory.java b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/SchedulerCoordinatorFactory.java index b3aa5e4fa..72f830fbf 100644 --- a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/SchedulerCoordinatorFactory.java +++ b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/coordinator/SchedulerCoordinatorFactory.java @@ -45,24 +45,6 @@ public ExecutorService createExecutorService() { 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 { private static final long DEFAULT_KEEP_ALIVE = 60L; SchedulerThreadPoolExecutor(ThreadFactory threadFactory) {