
public class ODistributedConfiguration extends Object
| Modifier and Type | Class and Description |
|---|---|
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_MAJORITY |
| Constructor and Description |
|---|
ODistributedConfiguration(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.
|
ODistributedConfiguration.ROLES |
getDefaultServerRole()
Returns the default server role between MASTER (default) and REPLICA.
|
ODocument |
getDocument() |
List<String> |
getOwnedClustersByServer(Collection<String> iClusterNames,
String iNode)
Returns the clusters where a server is owner.
|
int |
getReadQuorum(String iClusterName,
int iAvailableNodes)
Returns the read quorum.
|
Map<String,Collection<String>> |
getServerClusterMap(Collection<String> iClusterNames,
String iLocalNode)
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 iClusterName,
int iAvailableNodes)
Returns the write quorum.
|
boolean |
hasCluster(String iServer,
String iClusterName)
Returns true if the server has a cluster.
|
Boolean |
isExecutionModeSynchronous(String iClusterName)
Returns the execution mode if synchronous.
|
Boolean |
isReadYourWrites(String iClusterName)
Reads your writes.
|
boolean |
isReplicationActive(String iClusterName,
String iLocalNode)
Returns true if the replication is active, otherwise false.
|
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.
|
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 Integer DEFAULT_READ_QUORUM
public static final String DEFAULT_WRITE_QUORUM
public ODistributedConfiguration(ODocument iConfiguration)
public boolean isReplicationActive(String iClusterName, String iLocalNode)
iClusterName - Cluster name, or null for *public int getReadQuorum(String iClusterName, int iAvailableNodes)
iClusterName - Cluster name, or null for *iAvailableNodes - Total node availablepublic int getWriteQuorum(String iClusterName, int iAvailableNodes)
iClusterName - Cluster name, or null for *iAvailableNodes - Total node availablepublic 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)
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 - Set of cluster names to findpublic List<String> getServers(String iClusterName, String iExclude)
iClusterName - Cluster name, or null for *iExclude - Node to excludepublic boolean hasCluster(String iServer, String iClusterName)
iServer - Server nameiClusterName - Cluster namepublic 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 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 List<String> setServerOffline(String iNode, String newServerCoordinator)
iNode - Server namenewServerCoordinator - New coordinator server namepublic int getVersion()
Copyright © 2009–2016 Orient Technologies. All rights reserved.