public class OHazelcastPlugin extends ODistributedAbstractPlugin implements com.hazelcast.core.MembershipListener, com.hazelcast.core.EntryListener<String,Object>, com.hazelcast.core.LifecycleListener, OBeforeDatabaseOpenNetworkEventListener
ODistributedServerManager.DB_STATUS, ODistributedServerManager.NODE_STATUS
ODatabaseLifecycleListener.PRIORITY
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_DATABASE_PREFIX |
static String |
CONFIG_DBSTATUS_PREFIX |
static String |
CONFIG_LOCKMANAGER |
static String |
CONFIG_NODE_PREFIX |
static String |
CONFIG_REGISTEREDNODES |
protected OHazelcastDistributedMap |
configurationMap |
protected com.hazelcast.config.Config |
hazelcastConfig |
protected String |
hazelcastConfigFile |
protected com.hazelcast.core.HazelcastInstance |
hazelcastInstance |
protected String |
membershipListenerMapRegistration |
protected String |
membershipListenerRegistration |
activeNodes, activeNodesNamesByUuid, activeNodesUuidByName, autoRemovalOfServers, clusterAssignmentStrategy, defaultDatabaseConfigFile, DEPLOY_DB_MAX_RETRIES, haStatsTask, healthCheckerTask, installingDatabases, lastClusterChangeOn, listeners, localMessageIdCounter, messageService, NODE_NAME_ENV, nodeId, nodeName, nodeUuid, PAR_DEF_DISTRIB_DB_CONFIG, publishLocalNodeConfigurationTask, registeredNodeById, registeredNodeByName, remoteServerManager, REPLICATOR_USER, responseManagerFactory, serverInstance, serverStarted, startedOn, status, storages, taskFactoryManager
enabled
FILE_DISTRIBUTED_DB_CONFIG
Constructor and Description |
---|
OHazelcastPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
config(OServer iServer,
OServerParameterConfiguration[] iParams)
Configures the handler.
|
protected com.hazelcast.core.HazelcastInstance |
configureHazelcast() |
Throwable |
convertException(Throwable original) |
protected void |
dumpStats() |
void |
entryAdded(com.hazelcast.core.EntryEvent<String,Object> iEvent) |
void |
entryEvicted(com.hazelcast.core.EntryEvent<String,Object> iEvent) |
void |
entryRemoved(com.hazelcast.core.EntryEvent<String,Object> iEvent) |
void |
entryUpdated(com.hazelcast.core.EntryEvent<String,Object> iEvent) |
Set<String> |
getActiveServers() |
long |
getClusterTime()
Returns the cluster-wide time in milliseconds.
|
OHazelcastDistributedMap |
getConfigurationMap() |
ODistributedServerManager.DB_STATUS |
getDatabaseStatus(String iNode,
String iDatabaseName) |
ODistributedServerManager.DB_STATUS |
getDatabaseStatus(String iNode,
String iDatabaseName,
boolean useCache) |
com.hazelcast.core.HazelcastInstance |
getHazelcastInstance() |
ODistributedLockManager |
getLockManagerExecutor() |
ODistributedLockManager |
getLockManagerRequester() |
String |
getLockManagerServer() |
ODocument |
getNodeConfigurationByUuid(String iNodeId,
boolean useCache) |
int |
getNodeIdByName(String name) |
String |
getNodeNameById(int id) |
String |
getPublicAddress() |
ORemoteServerController |
getRemoteServer(String rNodeName) |
protected void |
initSystemDatabase()
Protecte system database from being replicated
|
protected void |
installNewDatabasesFromCluster() |
boolean |
isNodeAvailable(String iNodeName) |
boolean |
isRunning() |
boolean |
isWriteQuorumPresent(String databaseName)
Returns true if the quorum is present in terms of number of available nodes for full
replication only.
|
protected void |
loadLocalDatabases()
Initializes all the available server's databases as distributed.
|
void |
mapCleared(com.hazelcast.core.MapEvent event) |
void |
mapEvicted(com.hazelcast.core.MapEvent iEvent) |
void |
memberAdded(com.hazelcast.core.MembershipEvent iEvent) |
void |
memberAttributeChanged(com.hazelcast.core.MemberAttributeEvent memberAttributeEvent) |
void |
memberRemoved(com.hazelcast.core.MembershipEvent iEvent)
Removes the node map entry.
|
void |
messageAfterOp(String op,
ODistributedRequestId request) |
void |
messageBeforeOp(String op,
ODistributedRequestId request) |
void |
messageCurrentPayload(ODistributedRequestId requestId,
Object responsePayload) |
void |
messagePartitionCalculate(ODistributedRequest request,
Set<Integer> involvedWorkerQueues) |
void |
messageProcessEnd(ODistributedRequest iRequest,
Object responsePayload) |
void |
messageProcessStart(ODistributedRequest message) |
void |
messageReceived(ODistributedRequest request) |
void |
notifyClients(String databaseName) |
void |
onBeforeDatabaseOpen(String url) |
void |
onCreate(ODatabaseInternal iDatabase) |
void |
onDrop(ODatabaseInternal iDatabase) |
protected void |
publishLocalNodeConfiguration() |
protected void |
registerNode(com.hazelcast.core.Member member,
String joinedNodeName) |
void |
reloadRegisteredNodes(String registeredNodesFromClusterAsJson) |
void |
removeNodeFromConfiguration(String nodeLeftName,
boolean removeOnlyDynamicServers) |
boolean |
removeNodeFromConfiguration(String nodeLeftName,
String databaseName,
boolean removeOnlyDynamicServers,
boolean statusOffline) |
void |
removeServer(String nodeLeftName,
boolean removeOnlyDynamicServers) |
void |
setDatabaseStatus(String iNode,
String iDatabaseName,
ODistributedServerManager.DB_STATUS iStatus) |
void |
setHazelcastConfig(com.hazelcast.config.Config config) |
void |
setNodeName(String nodeName) |
void |
shutdown() |
void |
startup() |
void |
stateChanged(com.hazelcast.core.LifecycleEvent event) |
boolean |
updateCachedDatabaseConfiguration(String databaseName,
OModifiableDistributedConfiguration cfg,
boolean iDeployToCluster) |
protected void |
waitStartupIsCompleted() |
assignNodeName, backupCurrentDatabase, checkNodeStatus, closeRemoteServer, dumpServersStatus, executeInDistributedDatabaseLock, executeOnLocalNode, executeOnLocalNodeFromRemote, getAvailableNodeNames, getAvailableNodes, getAvailableNodes, getClusterConfiguration, getClusterOwnedExclusivelyByCurrentNode, getConflictResolverFactory, getCoordinatorServer, getDatabaseConfiguration, getDatabaseConfiguration, getDefaultDatabaseConfigFile, getDistributedStrategy, getLastClusterChangeOn, getListeningBinaryAddress, getLocalNodeConfiguration, getLocalNodeId, getLocalNodeName, getManagedDatabases, getMessageService, getName, getNextMessageIdCounter, getNodeName, getNodeName, getNodeStatus, getNodesWithStatus, getNodeUuidByName, getOnlineNodes, getPriority, getServerInstance, getStats, getStorage, getStorage, getStorageIfExists, getTaskFactoryManager, getTotalNodes, installClustersOfClass, installDatabase, installDatabaseFromNetwork, installDatabaseOnLocalNode, isEnabled, isNodeAvailable, isNodeOnline, isNodeStatusEqualsTo, isOffline, isRelatedToLocalServer, onClose, onCreateClass, onCreateView, onDatabaseEvent, onDropClass, onLocalNodeConfigurationRequest, onMessage, onOpen, reassignClustersOwnership, rebalanceClusterOwnership, registerLifecycleListener, registerNewDatabaseIfNeeded, removeStorage, requestDatabaseFullSync, requestFullDatabase, restartNode, sendRequest, sendRequest, sendShutdown, setDefaultDatabaseConfigFile, setDistributedStrategy, setNodeStatus, stopNode, toString, unregisterLifecycleListener, updateCachedDatabaseConfiguration, updateLastClusterChange, waitUntilNodeOnline, waitUntilNodeOnline
getContent, onAfterClientRequest, onBeforeClientRequest, onClientConnection, onClientDisconnection, onClientError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onDropView
onSocketAccepted, onSocketDestroyed
public static final String CONFIG_DATABASE_PREFIX
public static final String CONFIG_NODE_PREFIX
public static final String CONFIG_DBSTATUS_PREFIX
public static final String CONFIG_LOCKMANAGER
public static final String CONFIG_REGISTEREDNODES
protected String hazelcastConfigFile
protected com.hazelcast.config.Config hazelcastConfig
protected String membershipListenerRegistration
protected String membershipListenerMapRegistration
protected volatile com.hazelcast.core.HazelcastInstance hazelcastInstance
protected OHazelcastDistributedMap configurationMap
public void setHazelcastConfig(com.hazelcast.config.Config config)
public void setNodeName(String nodeName)
public void config(OServer iServer, OServerParameterConfiguration[] iParams)
OServerPlugin
config
in interface OServerPlugin
config
in class ODistributedAbstractPlugin
public void startup()
startup
in interface OService
startup
in class ODistributedAbstractPlugin
protected void initSystemDatabase()
public boolean isWriteQuorumPresent(String databaseName)
ODistributedServerManager
isWriteQuorumPresent
in interface ODistributedServerManager
public int getNodeIdByName(String name)
getNodeIdByName
in interface ODistributedServerManager
getNodeIdByName
in class ODistributedAbstractPlugin
public String getNodeNameById(int id)
getNodeNameById
in interface ODistributedServerManager
getNodeNameById
in class ODistributedAbstractPlugin
public boolean isNodeAvailable(String iNodeName)
isNodeAvailable
in interface ODistributedServerManager
isNodeAvailable
in class ODistributedAbstractPlugin
public String getLockManagerServer()
getLockManagerServer
in interface ODistributedServerManager
protected void waitStartupIsCompleted() throws InterruptedException
InterruptedException
protected void publishLocalNodeConfiguration()
protected void dumpStats()
public Throwable convertException(Throwable original)
convertException
in interface ODistributedServerManager
public long getClusterTime()
ODistributedServerManager
Cluster tries to keep a cluster-wide time which might be different than the member's own system time. Cluster-wide time is -almost- the same on all members of the cluster.
getClusterTime
in interface ODistributedServerManager
public ODistributedLockManager getLockManagerRequester()
getLockManagerRequester
in interface ODistributedServerManager
public ODistributedLockManager getLockManagerExecutor()
getLockManagerExecutor
in interface ODistributedServerManager
public void shutdown()
shutdown
in interface OService
shutdown
in class ODistributedAbstractPlugin
public ORemoteServerController getRemoteServer(String rNodeName) throws IOException
getRemoteServer
in interface ODistributedServerManager
IOException
public com.hazelcast.core.HazelcastInstance getHazelcastInstance()
protected com.hazelcast.core.HazelcastInstance configureHazelcast() throws FileNotFoundException
FileNotFoundException
public String getPublicAddress()
getPublicAddress
in class ODistributedAbstractPlugin
protected void loadLocalDatabases()
public OHazelcastDistributedMap getConfigurationMap()
getConfigurationMap
in interface ODistributedServerManager
public void memberAttributeChanged(com.hazelcast.core.MemberAttributeEvent memberAttributeEvent)
memberAttributeChanged
in interface com.hazelcast.core.MembershipListener
public boolean updateCachedDatabaseConfiguration(String databaseName, OModifiableDistributedConfiguration cfg, boolean iDeployToCluster)
updateCachedDatabaseConfiguration
in interface ODistributedServerManager
public void notifyClients(String databaseName)
notifyClients
in interface ODistributedServerManager
notifyClients
in class ODistributedAbstractPlugin
public void mapEvicted(com.hazelcast.core.MapEvent iEvent)
mapEvicted
in interface com.hazelcast.map.listener.MapEvictedListener
public void mapCleared(com.hazelcast.core.MapEvent event)
mapCleared
in interface com.hazelcast.map.listener.MapClearedListener
public void memberRemoved(com.hazelcast.core.MembershipEvent iEvent)
memberRemoved
in interface com.hazelcast.core.MembershipListener
public void memberAdded(com.hazelcast.core.MembershipEvent iEvent)
memberAdded
in interface com.hazelcast.core.MembershipListener
public void stateChanged(com.hazelcast.core.LifecycleEvent event)
stateChanged
in interface com.hazelcast.core.LifecycleListener
public void onCreate(ODatabaseInternal iDatabase)
onCreate
in interface ODatabaseLifecycleListener
public void onDrop(ODatabaseInternal iDatabase)
onDrop
in interface ODatabaseLifecycleListener
onDrop
in class ODistributedAbstractPlugin
public ODocument getNodeConfigurationByUuid(String iNodeId, boolean useCache)
getNodeConfigurationByUuid
in interface ODistributedServerManager
public ODistributedServerManager.DB_STATUS getDatabaseStatus(String iNode, String iDatabaseName)
getDatabaseStatus
in interface ODistributedServerManager
public ODistributedServerManager.DB_STATUS getDatabaseStatus(String iNode, String iDatabaseName, boolean useCache)
public void setDatabaseStatus(String iNode, String iDatabaseName, ODistributedServerManager.DB_STATUS iStatus)
setDatabaseStatus
in interface ODistributedServerManager
protected void installNewDatabasesFromCluster()
public void reloadRegisteredNodes(String registeredNodesFromClusterAsJson)
public void removeNodeFromConfiguration(String nodeLeftName, boolean removeOnlyDynamicServers)
public boolean removeNodeFromConfiguration(String nodeLeftName, String databaseName, boolean removeOnlyDynamicServers, boolean statusOffline)
public void removeServer(String nodeLeftName, boolean removeOnlyDynamicServers)
removeServer
in interface ODistributedServerManager
public Set<String> getActiveServers()
getActiveServers
in interface ODistributedServerManager
public void onBeforeDatabaseOpen(String url)
onBeforeDatabaseOpen
in interface OBeforeDatabaseOpenNetworkEventListener
protected void registerNode(com.hazelcast.core.Member member, String joinedNodeName)
public boolean isRunning()
public void messageReceived(ODistributedRequest request)
messageReceived
in interface ODistributedServerManager
public void messagePartitionCalculate(ODistributedRequest request, Set<Integer> involvedWorkerQueues)
messagePartitionCalculate
in interface ODistributedServerManager
public void messageBeforeOp(String op, ODistributedRequestId request)
messageBeforeOp
in interface ODistributedServerManager
public void messageAfterOp(String op, ODistributedRequestId request)
messageAfterOp
in interface ODistributedServerManager
public void messageCurrentPayload(ODistributedRequestId requestId, Object responsePayload)
messageCurrentPayload
in interface ODistributedServerManager
public void messageProcessStart(ODistributedRequest message)
messageProcessStart
in interface ODistributedServerManager
public void messageProcessEnd(ODistributedRequest iRequest, Object responsePayload)
messageProcessEnd
in interface ODistributedServerManager
Copyright © 2009–2020 OrientDB. All rights reserved.