public class RedisDBSClusterInvalidator extends Object implements DBSClusterInvalidator
DBSClusterInvalidator
. 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_FIELD |
protected String |
namespace |
protected String |
nodeId |
protected static String |
PREFIX |
protected DBSInvalidations |
receivedInvals |
protected RedisExecutor |
redisExecutor |
protected String |
repositoryName |
protected static String |
STARTED_FIELD |
protected String |
startedDateTime |
protected Thread |
subscriberThread |
protected static int |
TIMEOUT_REGISTER_SECOND |
protected static long |
TIMEOUT_SUBSCRIBE_SECOND |
Constructor and Description |
---|
RedisDBSClusterInvalidator() |
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,
Repository repository)
Initializes the cluster invalidator.
|
DBSInvalidations |
receiveInvalidations()
Receives invalidations from other cluster nodes.
|
protected void |
registerNode() |
void |
sendInvalidations(DBSInvalidations 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 long TIMEOUT_SUBSCRIBE_SECOND
protected static final String STARTED_FIELD
protected static final String LAST_INVAL_FIELD
protected String repositoryName
protected RedisExecutor redisExecutor
protected DBSInvalidations receivedInvals
protected Thread subscriberThread
protected String startedDateTime
public RedisDBSClusterInvalidator()
public void initialize(String nodeId, Repository repository)
DBSClusterInvalidator
initialize
in interface DBSClusterInvalidator
nodeId
- the cluster node idrepository
- the repositoryprotected void createSubscriberThread()
protected void subscribeToInvalidationChannel()
protected String getChannelName()
protected void registerNode()
protected String getNodeKey()
public void close()
DBSClusterInvalidator
close
in interface DBSClusterInvalidator
protected void unsubscribeToInvalidationChannel()
public DBSInvalidations receiveInvalidations()
DBSClusterInvalidator
receiveInvalidations
in interface DBSClusterInvalidator
public void sendInvalidations(DBSInvalidations invals)
DBSClusterInvalidator
sendInvalidations
in interface DBSClusterInvalidator
protected String getCurrentDateTime()
Copyright © 2016 Nuxeo SA. All rights reserved.