| Modifier and Type | Field and Description |
|---|---|
protected boolean |
gracefuleShutdownStarted |
| Constructor and Description |
|---|
Scheduler(CheckpointConfig checkpointConfig,
CoordinatorConfig coordinatorConfig,
LeaseManagementConfig leaseManagementConfig,
LifecycleConfig lifecycleConfig,
MetricsConfig metricsConfig,
ProcessorConfig processorConfig,
RetrievalConfig retrievalConfig) |
| Modifier and Type | Method and Description |
|---|---|
protected ShardConsumer |
buildConsumer(ShardInfo shardInfo,
ShardRecordProcessorFactory shardRecordProcessorFactory) |
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)
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_LOSTpublic 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)
@Deprecated public Future<Void> requestShutdown()
Copyright © 2019. All rights reserved.