public class RedisClusterInvalidator extends Object implements ClusterInvalidator
ClusterInvalidator
.
Use a single channel pubsub to send invalidations.
Use an HSET to register nodes, only for debug purpose so far.Modifier and Type | Field and Description |
---|---|
protected static String |
CLUSTER_NODES_KEY |
protected static String |
INVALIDATION_CHANNEL |
protected static String |
LAST_INVAL_KEY |
protected String |
namespace |
protected String |
nodeId |
protected static String |
PREFIX |
protected Invalidations |
receivedInvals |
protected RedisExecutor |
redisExecutor |
protected String |
repositoryName |
protected static String |
STARTED_KEY |
protected String |
startedDateTime |
protected Thread |
subscriberThread |
protected static int |
TIMEOUT_REGISTER_SECOND |
Constructor and Description |
---|
RedisClusterInvalidator() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this cluster invalidator and releases resources.
|
protected void |
createSubscriberThread() |
protected String |
getChannelName() |
protected String |
getCurrentDateTime() |
protected String |
getNodeKey() |
void |
initialize(String nodeId,
RepositoryImpl repository)
Initializes the cluster invalidator.
|
Invalidations |
receiveInvalidations()
Receives invalidations from other cluster nodes.
|
protected void |
registerNode() |
void |
sendInvalidations(Invalidations invals)
Sends invalidations to other cluster nodes.
|
protected void |
subscribeToInvalidationChannel() |
protected void |
unsubscribeToInvalidationChannel() |
protected static final String PREFIX
protected static final String INVALIDATION_CHANNEL
protected static final String CLUSTER_NODES_KEY
protected static final int TIMEOUT_REGISTER_SECOND
protected static final String STARTED_KEY
protected static final String LAST_INVAL_KEY
protected String repositoryName
protected RedisExecutor redisExecutor
protected Invalidations receivedInvals
protected Thread subscriberThread
protected String startedDateTime
public RedisClusterInvalidator()
public void initialize(String nodeId, RepositoryImpl repository)
ClusterInvalidator
initialize
in interface ClusterInvalidator
nodeId
- the cluster node idrepository
- the repositoryprotected void createSubscriberThread()
protected void subscribeToInvalidationChannel()
protected String getChannelName()
protected void registerNode()
protected String getNodeKey()
public void close()
ClusterInvalidator
close
in interface ClusterInvalidator
protected void unsubscribeToInvalidationChannel()
public Invalidations receiveInvalidations()
ClusterInvalidator
receiveInvalidations
in interface ClusterInvalidator
public void sendInvalidations(Invalidations invals)
ClusterInvalidator
sendInvalidations
in interface ClusterInvalidator
protected String getCurrentDateTime()
Copyright © 2015 Nuxeo SA. All rights reserved.