Modifier and Type | Field and Description |
---|---|
protected boolean |
gracefuleShutdownStarted |
Modifier | Constructor and Description |
---|---|
|
Scheduler(CheckpointConfig checkpointConfig,
CoordinatorConfig coordinatorConfig,
LeaseManagementConfig leaseManagementConfig,
LifecycleConfig lifecycleConfig,
MetricsConfig metricsConfig,
ProcessorConfig processorConfig,
RetrievalConfig retrievalConfig) |
protected |
Scheduler(CheckpointConfig checkpointConfig,
CoordinatorConfig coordinatorConfig,
LeaseManagementConfig leaseManagementConfig,
LifecycleConfig lifecycleConfig,
MetricsConfig metricsConfig,
ProcessorConfig processorConfig,
RetrievalConfig retrievalConfig,
software.amazon.kinesis.coordinator.DiagnosticEventFactory diagnosticEventFactory)
Customers do not currently have the ability to customize the DiagnosticEventFactory, but this visibility
is desired for testing.
|
Modifier and Type | Method and Description |
---|---|
protected ShardConsumer |
buildConsumer(ShardInfo shardInfo,
ShardRecordProcessorFactory shardRecordProcessorFactory,
LeaseCleanupManager leaseCleanupManager) |
Callable<Boolean> |
createGracefulShutdownCallable()
Creates a callable that will execute the graceful shutdown process.
|
boolean |
hasGracefulShutdownStarted() |
Future<Void> |
requestShutdown()
Deprecated.
|
void |
run()
Start consuming data from the stream, and pass it to the application record processors.
|
void |
shutdown()
Signals worker to shutdown.
|
Future<Boolean> |
startGracefulShutdown()
Requests a graceful shutdown of the worker, notifying record processors, that implement
ShutdownNotificationAware , of the impending shutdown. |
public Scheduler(@NonNull CheckpointConfig checkpointConfig, @NonNull CoordinatorConfig coordinatorConfig, @NonNull LeaseManagementConfig leaseManagementConfig, @NonNull LifecycleConfig lifecycleConfig, @NonNull MetricsConfig metricsConfig, @NonNull ProcessorConfig processorConfig, @NonNull RetrievalConfig retrievalConfig)
protected Scheduler(@NonNull CheckpointConfig checkpointConfig, @NonNull CoordinatorConfig coordinatorConfig, @NonNull LeaseManagementConfig leaseManagementConfig, @NonNull LifecycleConfig lifecycleConfig, @NonNull MetricsConfig metricsConfig, @NonNull ProcessorConfig processorConfig, @NonNull RetrievalConfig retrievalConfig, @NonNull software.amazon.kinesis.coordinator.DiagnosticEventFactory diagnosticEventFactory)
public void run()
public Future<Boolean> startGracefulShutdown()
ShutdownNotificationAware
, of the impending shutdown. This gives the record processor a final chance to
checkpoint.
This will only create a single shutdown future. Additional attempts to start a graceful shutdown will return the
previous future.
It's possible that a record processor won't be notify before being shutdown. This can occur if the lease is
lost after requesting shutdown, but before the notification is dispatched.
ShutdownReason.LEASE_LOST
public Callable<Boolean> createGracefulShutdownCallable()
IllegalStateException
- thrown by the callable if another callable has already started the shutdown process.public boolean hasGracefulShutdownStarted()
public void shutdown()
ShutdownReason.LEASE_LOST
.protected ShardConsumer buildConsumer(@NonNull ShardInfo shardInfo, @NonNull ShardRecordProcessorFactory shardRecordProcessorFactory, @NonNull LeaseCleanupManager leaseCleanupManager)
@Deprecated public Future<Void> requestShutdown()
Copyright © 2020. All rights reserved.