public class LeaseGracefulShutdownHandler extends Object
| Constructor and Description |
|---|
LeaseGracefulShutdownHandler() |
| Modifier and Type | Method and Description |
|---|---|
static LeaseGracefulShutdownHandler |
create(long shutdownTimeoutMillis,
ConcurrentMap<ShardInfo,ShardConsumer> shardInfoShardConsumerMap,
LeaseCoordinator leaseCoordinator)
Factory method to create a new instance of LeaseGracefulShutdownHandler.
|
void |
enqueueShutdown(Lease lease)
Enqueue a shutdown request for the given lease if the lease has requested shutdown and the shard consumer
is not already shutdown.
|
void |
start()
Starts the shard consumer shutdown handler thread.
|
void |
stop()
Stops the shard consumer shutdown handler thread.
|
public static LeaseGracefulShutdownHandler create(long shutdownTimeoutMillis, ConcurrentMap<ShardInfo,ShardConsumer> shardInfoShardConsumerMap, LeaseCoordinator leaseCoordinator)
shutdownTimeoutMillis - Timeout for graceful shutdown of shard consumers.shardInfoShardConsumerMap - Map of shard info to shard consumer instances.leaseCoordinator - Lease coordinator instance to access lease information.public void start()
public void stop()
public void enqueueShutdown(Lease lease)
lease - The lease to enqueue a shutdown request for.Copyright © 2024. All rights reserved.