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 |
protected static String |
AUTO_DEPLOY |
protected static String |
CLUSTERS |
protected ODocument |
configuration |
protected static String |
DCS |
protected static List<String> |
DEFAULT_CLUSTER_NAME |
static Integer |
DEFAULT_READ_QUORUM |
static String |
DEFAULT_WRITE_QUORUM |
protected static String |
EXECUTION_MODE |
protected static String |
EXECUTION_MODE_SYNCHRONOUS |
protected static String |
NEW_NODE_STRATEGY |
static String |
NEW_NODE_TAG |
protected static String |
OWNER |
static String |
QUORUM_ALL |
static String |
QUORUM_LOCAL_DC |
static String |
QUORUM_MAJORITY |
protected static String |
READ_QUORUM |
protected static String |
READ_YOUR_WRITES |
protected static String |
SERVERS |
protected static String |
VERSION |
protected static String |
WRITE_QUORUM |
Constructor and Description |
---|
ODistributedConfiguration(ODocument iConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
clearForceWriteQuorum() |
void |
forceWriteQuorum(int quorum) |
Set<String> |
getAllConfiguredServers()
Returns the complete list of servers found in configuration.
|
protected ODocument |
getClusterConfiguration(String iClusterName)
Gets the document representing the cluster 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.
|
List<String> |
getConfiguredServers(String iClusterName)
Returns the configured server list for the requested 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.
|
ODocument |
getDocument() |
Object |
getGlobalReadQuorum(String iClusterName)
Returns the global read quorum.
|
List<String> |
getMasterServers()
Returns an ordered list of master server.
|
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 totalConfiguredServers,
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,
String iExclude)
Returns the server list for the requested cluster cluster excluding any tags like
|
int |
getVersion() |
int |
getWriteQuorum(String clusterName,
int totalConfiguredMasterServers,
String server)
Returns the write quorum.
|
boolean |
hasDataCenterConfiguration()
Returns true if the configuration per data centers is specified.
|
boolean |
isAutoDeploy() |
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.
|
OModifiableDistributedConfiguration |
modify() |
String |
toString() |
public static final String NEW_NODE_TAG
public static final String ALL_WILDCARD
protected static final String SERVERS
protected static final String DCS
protected static final String OWNER
protected static final String CLUSTERS
protected static final String VERSION
protected static final String AUTO_DEPLOY
protected static final String READ_QUORUM
protected static final String WRITE_QUORUM
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
protected static final String NEW_NODE_STRATEGY
protected static final String READ_YOUR_WRITES
protected static final String EXECUTION_MODE
protected static final String EXECUTION_MODE_SYNCHRONOUS
protected final ODocument configuration
public ODistributedConfiguration(ODocument iConfiguration)
public OModifiableDistributedConfiguration modify()
public boolean isReplicationActive(String iClusterName, String iLocalNode)
iClusterName
- Cluster name, or null for *public boolean hasDataCenterConfiguration()
public boolean isAutoDeploy()
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 List<String> getMasterServers()
public 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> getConfiguredServers(String iClusterName)
iClusterName
- Cluster name, or null for *public String[] getClusterNames()
public ODistributedConfiguration.ROLES getDefaultServerRole()
public ODistributedConfiguration.ROLES getServerRole(String iServerName)
public ODocument getDocument()
public Set<String> getDataCenters()
public int getDataCenterWriteQuorum(String dataCenter)
dataCenter
- Data center namepublic boolean isSharded()
public List<String> getDataCenterServers(String dataCenter)
dataCenter
- Data center nameOConfigurationException
- if the list of servers is not found in data center
configurationpublic String getDataCenterOfServer(String server)
server
- Server namepublic int getVersion()
public boolean isLocalDataCenterWriteQuorum()
public Object getGlobalReadQuorum(String iClusterName)
iClusterName
- Cluster name, or null for *public int getReadQuorum(String clusterName, int totalConfiguredServers, String server)
clusterName
- Cluster name, or null for *totalConfiguredServers
- Total node availablepublic int getWriteQuorum(String clusterName, int totalConfiguredMasterServers, String server)
clusterName
- Cluster name, or null for *totalConfiguredMasterServers
- Total node availableprotected ODocument getClusterConfiguration(String iClusterName)
iClusterName
- Cluster name, or null for *OConfigurationException
- in case "clusters" field is not found in configurationpublic void forceWriteQuorum(int quorum)
public void clearForceWriteQuorum()
Copyright © 2009–2020 OrientDB. All rights reserved.