
public class ODistributedConfiguration extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ODistributedConfiguration.NEW_NODE_STRATEGIES |
static class |
ODistributedConfiguration.ROLES |
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_WILDCARD |
static Integer |
DEFAULT_READ_QUORUM |
static String |
DEFAULT_WRITE_QUORUM |
static String |
NEW_NODE_TAG |
static String |
QUORUM_ALL |
static String |
QUORUM_LOCAL_DC |
static String |
QUORUM_MAJORITY |
| Constructor and Description |
|---|
ODistributedConfiguration(com.orientechnologies.orient.core.record.impl.ODocument iConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
addNewNodeInServerList(String iNode)
Adds a server in the configuration.
|
Set<String> |
getAllConfiguredServers()
Returns the complete list of servers found in configuration.
|
String[] |
getClusterNames()
Returns the array of configured clusters
|
String |
getClusterOwner(String iClusterName)
Returns the owner server for the given cluster excluding the passed node.
|
Set<String> |
getClustersOnServer(String iNodeName)
Returns the set of clusters managed by a server.
|
Set<String> |
getClustersOwnedByServer(String iNodeName)
Returns the set of clusters where server is the owner.
|
String |
getConfiguredClusterOwner(String iClusterName)
Returns the static owner server for the given cluster.
|
String |
getDataCenterOfServer(String server)
Returns the data center where the server belongs.
|
Set<String> |
getDataCenters()
Returns all the configured data centers' names, if any.
|
List<String> |
getDataCenterServers(String dataCenter)
Returns the list of servers in a data center.
|
int |
getDataCenterWriteQuorum(String dataCenter)
Returns the data center write quorum.
|
ODistributedConfiguration.ROLES |
getDefaultServerRole()
Returns the default server role between MASTER (default) and REPLICA.
|
com.orientechnologies.orient.core.record.impl.ODocument |
getDocument() |
Object |
getGlobalReadQuorum(String iClusterName)
Returns the global read quorum.
|
ODistributedConfiguration.NEW_NODE_STRATEGIES |
getNewNodeStrategy()
Returns the new node strategy between "dynamic" and "static".
|
List<String> |
getOwnedClustersByServer(Collection<String> iClusterNames,
String iNode)
Returns the clusters where a server is owner.
|
int |
getReadQuorum(String clusterName,
int availableNodes,
String server)
Returns the read quorum.
|
Set<String> |
getRegisteredServers()
Returns the registered servers.
|
Map<String,Collection<String>> |
getServerClusterMap(Collection<String> iClusterNames,
String iLocalNode,
boolean optimizeForLocalOnly)
Returns the list of servers that can manage a list of clusters.
|
ODistributedConfiguration.ROLES |
getServerRole(String iServerName)
Returns the server role between MASTER (default) and REPLICA.
|
Set<String> |
getServers(Collection<String> iClusterNames)
Returns the set of server names involved on the passed cluster collection.
|
List<String> |
getServers(String iClusterName)
Returns the server list for the requested cluster.
|
List<String> |
getServers(String iClusterName,
String iExclude)
Returns the server list for the requested cluster cluster excluding any tags like
|
int |
getVersion() |
int |
getWriteQuorum(String clusterName,
int availableNodes,
String server)
Returns the write quorum.
|
boolean |
hasDataCenterConfiguration()
Returns true if the configuration per data centers is specified.
|
Boolean |
isExecutionModeSynchronous(String iClusterName)
Returns the execution mode if synchronous.
|
boolean |
isLocalDataCenterWriteQuorum()
Returns true if the global write quorum is "localDataCenter".
|
Boolean |
isReadYourWrites(String iClusterName)
Reads your writes.
|
boolean |
isReplicationActive(String iClusterName,
String iLocalNode)
Returns true if the replication is active, otherwise false.
|
boolean |
isServerContainingAllClusters(String server,
Collection<String> clusters)
Returns true if the local server has all the requested clusters.
|
boolean |
isServerContainingCluster(String server,
String cluster)
Returns true if the local server has the requested cluster.
|
boolean |
isSharded()
Returns true if the database is sharded across servers.
|
List<String> |
removeServer(String iNode)
Removes a server from the list.
NOTE: It must be executed in distributed database lock. |
List<String> |
setServerOffline(String iNode,
String newServerCoordinator)
Set a server offline.
|
void |
setServerOwner(String iClusterName,
String iServerName)
Sets the server as owner for the given cluster.
|
void |
setServerRole(String iServerName,
ODistributedConfiguration.ROLES role)
Sets the server role between MASTER (default) and REPLICA.
|
public static final String NEW_NODE_TAG
public static final String ALL_WILDCARD
public static final String QUORUM_MAJORITY
public static final String QUORUM_ALL
public static final String QUORUM_LOCAL_DC
public static final Integer DEFAULT_READ_QUORUM
public static final String DEFAULT_WRITE_QUORUM
public ODistributedConfiguration(com.orientechnologies.orient.core.record.impl.ODocument iConfiguration)
public boolean isReplicationActive(String iClusterName, String iLocalNode)
iClusterName - Cluster name, or null for *public boolean hasDataCenterConfiguration()
public ODistributedConfiguration.NEW_NODE_STRATEGIES getNewNodeStrategy()
public Boolean isExecutionModeSynchronous(String iClusterName)
iClusterName - Cluster name, or null for *public Boolean isReadYourWrites(String iClusterName)
iClusterName - Cluster name, or null for *public Map<String,Collection<String>> getServerClusterMap(Collection<String> iClusterNames, String iLocalNode, boolean optimizeForLocalOnly)
iClusterNames - Set of cluster names to findiLocalNode - Local node namepublic List<String> getOwnedClustersByServer(Collection<String> iClusterNames, String iNode)
iClusterNames - Set of cluster namesiNode - Nodepublic Set<String> getServers(Collection<String> iClusterNames)
iClusterNames - Collection of cluster names to findpublic boolean isServerContainingAllClusters(String server, Collection<String> clusters)
server - Server nameclusters - Collection of cluster names to findpublic boolean isServerContainingCluster(String server, String cluster)
server - Server namecluster - cluster names to findpublic List<String> getServers(String iClusterName, String iExclude)
iClusterName - Cluster name, or null for *iExclude - Node to excludepublic Set<String> getAllConfiguredServers()
public Set<String> getClustersOnServer(String iNodeName)
iNodeName - Server namepublic Set<String> getClustersOwnedByServer(String iNodeName)
iNodeName - Server namepublic String getClusterOwner(String iClusterName)
iClusterName - Cluster name, or null for *public String getConfiguredClusterOwner(String iClusterName)
iClusterName - Cluster name, or null for *public List<String> getServers(String iClusterName)
iClusterName - Cluster name, or null for *public String[] getClusterNames()
public ODistributedConfiguration.ROLES getDefaultServerRole()
public ODistributedConfiguration.ROLES getServerRole(String iServerName)
public void setServerRole(String iServerName, ODistributedConfiguration.ROLES role)
public com.orientechnologies.orient.core.record.impl.ODocument getDocument()
public List<String> addNewNodeInServerList(String iNode)
iNode - Server namepublic void setServerOwner(String iClusterName, String iServerName)
iClusterName - Cluster name or *. Does not accept null.public List<String> removeServer(String iNode)
iNode - Server namepublic Set<String> getDataCenters()
public int getDataCenterWriteQuorum(String dataCenter)
dataCenter - Data center namepublic boolean isSharded()
public List<String> getDataCenterServers(String dataCenter)
dataCenter - Data center namecom.orientechnologies.orient.core.exception.OConfigurationException - if the list of servers is not found in data center configurationpublic String getDataCenterOfServer(String server)
server - Server namepublic List<String> setServerOffline(String iNode, String newServerCoordinator)
iNode - Server namenewServerCoordinator - New coordinator server namepublic int getVersion()
public boolean isLocalDataCenterWriteQuorum()
public Object getGlobalReadQuorum(String iClusterName)
iClusterName - Cluster name, or null for *public int getReadQuorum(String clusterName, int availableNodes, String server)
clusterName - Cluster name, or null for *availableNodes - Total node availableCopyright © 2009–2016 OrientDB. All rights reserved.