public class MaintenanceAwareExpiryWriter extends CommandExpiryWriter implements MaintenanceAwareComponent
RedisChannelWriter that expires commands. Command timeout starts at the time the command is written
regardless to flushing mode (user-controlled batching).
This implementation, compared to the CommandExpiryWriter implementation, relaxes the timeouts when a re-bind is in
progress. The relaxation is done by starting a new timer with the relaxed timeout value. The relaxed timeout is configured
via TimeoutOptions.getRelaxedTimeout().
The logic is only applied when the ClientOptions.getMaintNotificationsConfig() is enabled.TimeoutOptions,
MaintenanceAwareComponent,
MaintenanceAwareConnectionWatchdog,
ClientOptions.getMaintNotificationsConfig()| Constructor and Description |
|---|
MaintenanceAwareExpiryWriter(RedisChannelWriter delegate,
ClientOptions clientOptions,
ClientResources clientResources)
Create a new
MaintenanceAwareExpiryWriter. |
| Modifier and Type | Method and Description |
|---|---|
void |
onFailoverCompleted(String shards)
Called whenever a failover is completed
|
void |
onFailoverStarted(String shards)
Called whenever a failover is initiated
|
void |
onMigrateCompleted(String shards)
Called whenever a shard migration is completed
|
void |
onMigrateStarted(String shards)
Called whenever a shard migration is initiated
|
void |
onRebindCompleted()
Called whenever the re-bind has been completed
|
void |
onRebindStarted(Duration time,
SocketAddress endpoint)
Called whenever a re-bind has been initiated by the remote server
A specific endpoint is going to move to another node within
|
<K,V> Collection<RedisCommand<K,V,?>> |
write(Collection<? extends RedisCommand<K,V,?>> redisCommands)
Write multiple commands on the channel.
|
<K,V,T> RedisCommand<K,V,T> |
write(RedisCommand<K,V,T> command)
Write a command on the channel.
|
buildCommandExpiryWriter, close, closeAsync, flushCommands, getClientResources, getDelegate, isSupported, setAutoFlushCommands, setConnectionFacade, setTimeoutpublic MaintenanceAwareExpiryWriter(RedisChannelWriter delegate, ClientOptions clientOptions, ClientResources clientResources)
MaintenanceAwareExpiryWriter.delegate - must not be null.clientOptions - must not be null.clientResources - must not be null.public <K,V,T> RedisCommand<K,V,T> write(RedisCommand<K,V,T> command)
RedisChannelWriterwrite in interface RedisChannelWriterwrite in class CommandExpiryWriterT - result typecommand - the Redis command.public <K,V> Collection<RedisCommand<K,V,?>> write(Collection<? extends RedisCommand<K,V,?>> redisCommands)
RedisChannelWriterwrite in interface RedisChannelWriterwrite in class CommandExpiryWriterK - key typeV - value typeredisCommands - the Redis commands.public void onRebindStarted(Duration time, SocketAddress endpoint)
MaintenanceAwareComponentA specific endpoint is going to move to another node within
onRebindStarted in interface MaintenanceAwareComponenttime - estimated time for the re-bind to completeendpoint - address of the target endpointpublic void onRebindCompleted()
MaintenanceAwareComponentonRebindCompleted in interface MaintenanceAwareComponentpublic void onMigrateStarted(String shards)
MaintenanceAwareComponentonMigrateStarted in interface MaintenanceAwareComponentpublic void onMigrateCompleted(String shards)
MaintenanceAwareComponentonMigrateCompleted in interface MaintenanceAwareComponentpublic void onFailoverStarted(String shards)
MaintenanceAwareComponentonFailoverStarted in interface MaintenanceAwareComponentpublic void onFailoverCompleted(String shards)
MaintenanceAwareComponentonFailoverCompleted in interface MaintenanceAwareComponentCopyright © 2025 lettuce.io. All rights reserved.