Class ODistributedConfiguration
java.lang.Object
com.orientechnologies.orient.server.distributed.ODistributedConfiguration
- Direct Known Subclasses:
OModifiableDistributedConfiguration
Immutable Distributed configuration. It uses an ODocument object to store the configuration.
Every changes must be done by obtaining a modifiable verson of the object through the method
`modify()`.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected static final Stringprotected static final Stringprotected final ODocumentprotected static final Stringstatic final Integerstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final Stringprotected static final Stringstatic final Stringstatic final Stringstatic final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidforceWriteQuorum(int quorum) Returns the complete list of servers found in configuration.protected ODocumentgetClusterConfiguration(String iClusterName) Gets the document representing the cluster configuration.String[]Returns the array of configured clustersgetClusterOwner(String iClusterName) Returns the owner server for the given cluster excluding the passed node.getClustersOwnedByServer(String iNodeName) Returns the set of clusters where server is the owner.getConfiguredClusterOwner(String iClusterName) Returns the static owner server for the given cluster.getConfiguredServers(String iClusterName) Returns the configured server list for the requested cluster.getDataCenterOfServer(String server) Returns the data center where the server belongs.Returns all the configured data centers' names, if any.getDataCenterServers(String dataCenter) Returns the list of servers in a data center.intgetDataCenterWriteQuorum(String dataCenter) Returns the data center write quorum.Returns the default server role between MASTER (default) and REPLICA.getGlobalReadQuorum(String iClusterName) Returns the global read quorum.Returns an ordered list of master server.Returns the new node strategy between "dynamic" and "static".getOwnedClustersByServer(Collection<String> iClusterNames, String iNode) Returns the clusters where a server is owner.intgetReadQuorum(int totalConfiguredServers, String server) Returns the read quorum.Returns the registered servers.getServerClusterMap(Collection<String> iClusterNames, String iLocalNode, boolean optimizeForLocalOnly) Returns the list of servers that can manage a list of clusters.getServerRole(String iServerName) Returns the server role between MASTER (default) and REPLICA.getServers(String iClusterName, String iExclude) Returns the server list for the requested cluster cluster excluding any tags likeand iExclude if any. getServers(Collection<String> iClusterNames) Returns the set of server names involved on the passed cluster collection.intintgetWriteQuorum(int totalConfiguredMasterServers, String server) Returns the write quorum.booleanReturns true if the configuration per data centers is specified.booleanisExecutionModeSynchronous(String iClusterName) Returns the execution mode if synchronous.booleanReturns true if the global write quorum is "localDataCenter".isReadYourWrites(String iClusterName) Reads your writes.booleanisReplicationActive(String iClusterName, String iLocalNode) Returns true if the replication is active, otherwise false.booleanisServerContainingAllClusters(String server, Collection<String> clusters) Returns true if the local server has all the requested clusters.booleanisServerContainingCluster(String server, String cluster) Returns true if the local server has the requested cluster.modify()toString()
-
Field Details
-
NEW_NODE_TAG
- See Also:
-
ALL_WILDCARD
- See Also:
-
SERVERS
- See Also:
-
DCS
- See Also:
-
OWNER
- See Also:
-
CLUSTERS
- See Also:
-
VERSION
- See Also:
-
AUTO_DEPLOY
- See Also:
-
READ_QUORUM
- See Also:
-
WRITE_QUORUM
- See Also:
-
QUORUM_MAJORITY
- See Also:
-
QUORUM_ALL
- See Also:
-
QUORUM_LOCAL_DC
- See Also:
-
DEFAULT_READ_QUORUM
-
DEFAULT_WRITE_QUORUM
- See Also:
-
NEW_NODE_STRATEGY
- See Also:
-
READ_YOUR_WRITES
- See Also:
-
EXECUTION_MODE
- See Also:
-
EXECUTION_MODE_SYNCHRONOUS
- See Also:
-
configuration
-
DEFAULT_CLUSTER_NAME
-
-
Constructor Details
-
ODistributedConfiguration
-
-
Method Details
-
modify
-
isReplicationActive
Returns true if the replication is active, otherwise false.- Parameters:
iClusterName- Cluster name, or null for *
-
hasDataCenterConfiguration
public boolean hasDataCenterConfiguration()Returns true if the configuration per data centers is specified. -
isAutoDeploy
public boolean isAutoDeploy() -
getNewNodeStrategy
Returns the new node strategy between "dynamic" and "static". If static, the node is registered under the "server" tag.- Returns:
- NEW_NODE_STRATEGIES enum
-
isExecutionModeSynchronous
Returns the execution mode if synchronous.- Parameters:
iClusterName- Cluster name, or null for *- Returns:
- true = synchronous, false = asynchronous, null = undefined
-
isReadYourWrites
Reads your writes.- Parameters:
iClusterName- Cluster name, or null for *
-
getServerClusterMap
public Map<String,Collection<String>> getServerClusterMap(Collection<String> iClusterNames, String iLocalNode, boolean optimizeForLocalOnly) Returns the list of servers that can manage a list of clusters. The algorithm makes its best to involve the less servers as it can.- Parameters:
iClusterNames- Set of cluster names to findiLocalNode- Local node name
-
getOwnedClustersByServer
Returns the clusters where a server is owner. This is used when a cluster must be selected: locality is always the best choice.- Parameters:
iClusterNames- Set of cluster namesiNode- Node
-
getServers
Returns the set of server names involved on the passed cluster collection.- Parameters:
iClusterNames- Collection of cluster names to find
-
getServers
-
isServerContainingAllClusters
Returns true if the local server has all the requested clusters.- Parameters:
server- Server nameclusters- Collection of cluster names to find
-
isServerContainingCluster
Returns true if the local server has the requested cluster.- Parameters:
server- Server namecluster- cluster names to find
-
getServers
Returns the server list for the requested cluster cluster excluding any tags likeand iExclude if any. - Parameters:
iClusterName- Cluster name, or null for *iExclude- Node to exclude
-
getMasterServers
Returns an ordered list of master server. The first in the list is the first found in configuration. This is used to determine the cluster leader. -
getAllConfiguredServers
Returns the complete list of servers found in configuration. -
getClustersOwnedByServer
Returns the set of clusters where server is the owner.- Parameters:
iNodeName- Server name
-
getClusterOwner
Returns the owner server for the given cluster excluding the passed node. The Owner server is the first in server list.- Parameters:
iClusterName- Cluster name, or null for *
-
getConfiguredClusterOwner
Returns the static owner server for the given cluster.- Parameters:
iClusterName- Cluster name, or null for *
-
getConfiguredServers
Returns the configured server list for the requested cluster.- Parameters:
iClusterName- Cluster name, or null for *
-
getClusterNames
Returns the array of configured clusters -
getDefaultServerRole
Returns the default server role between MASTER (default) and REPLICA. -
getServerRole
Returns the server role between MASTER (default) and REPLICA. -
getRegisteredServers
Returns the registered servers. -
getDocument
-
getDataCenters
Returns all the configured data centers' names, if any. -
getDataCenterWriteQuorum
Returns the data center write quorum.- Parameters:
dataCenter- Data center name
-
getDataCenterServers
Returns the list of servers in a data center.- Parameters:
dataCenter- Data center name- Throws:
OConfigurationException- if the list of servers is not found in data center configuration
-
getDataCenterOfServer
Returns the data center where the server belongs.- Parameters:
server- Server name
-
getVersion
public int getVersion() -
isLocalDataCenterWriteQuorum
public boolean isLocalDataCenterWriteQuorum()Returns true if the global write quorum is "localDataCenter". -
getGlobalReadQuorum
Returns the global read quorum.- Parameters:
iClusterName- Cluster name, or null for *
-
getReadQuorum
Returns the read quorum.- Parameters:
totalConfiguredServers- Total node available
-
getWriteQuorum
Returns the write quorum.- Parameters:
totalConfiguredMasterServers- Total node available
-
toString
-
getClusterConfiguration
Gets the document representing the cluster configuration.- Parameters:
iClusterName- Cluster name, or null for *- Returns:
- Always a ODocument
- Throws:
OConfigurationException- in case "clusters" field is not found in configuration
-
forceWriteQuorum
public void forceWriteQuorum(int quorum) -
clearForceWriteQuorum
public void clearForceWriteQuorum()
-