Class OModifiableDistributedConfiguration

java.lang.Object
com.orientechnologies.orient.server.distributed.ODistributedConfiguration
com.orientechnologies.orient.server.distributed.OModifiableDistributedConfiguration

public class OModifiableDistributedConfiguration extends ODistributedConfiguration
Modifiable Distributed configuration. It's created starting from a ODistributedConfiguration object. Every changes increment the field "version".
Author:
Luca Garulli (l.garulli--at--orientdb.com)
  • Constructor Details

    • OModifiableDistributedConfiguration

      public OModifiableDistributedConfiguration(ODocument iConfiguration)
  • Method Details

    • modify

      Overrides:
      modify in class ODistributedConfiguration
    • setServerRole

      public void setServerRole(String iServerName, ODistributedConfiguration.ROLES role)
      Sets the server role between MASTER (default) and REPLICA.
    • addNewNodeInServerList

      public List<String> addNewNodeInServerList(String iNode)
      Adds a server in the configuration. It replaces all the tags <NEW_NODE> with the new server name
      NOTE: It must be executed in distributed database lock.
      Parameters:
      iNode - Server name
      Returns:
      the list of changed partitions or null if no changes have applied
    • setServerOwner

      public void setServerOwner(String iClusterName, String iServerName)
      Sets the server as owner for the given cluster. The owner server is the first in server list.
      NOTE: It must be executed in distributed database lock.
      Parameters:
      iClusterName - Cluster name or *. Does not accept null.
    • removeServer

      public List<String> removeServer(String iNode)
      Removes a server from the list.
      NOTE: It must be executed in distributed database lock.
      Parameters:
      iNode - Server name
      Returns:
    • setServerOffline

      public List<String> setServerOffline(String iNode, String newLockManagerServer)
      Set a server offline. It assures the offline server is never on top of the list.
      NOTE: It must be executed in distributed database lock.
      Parameters:
      iNode - Server name
      newLockManagerServer - New Lock Manager server name
      Returns:
    • override

      public void override(ODocument newCfg)