Class ZooKeeperReplicationConfig

java.lang.Object
com.linecorp.centraldogma.server.ZooKeeperReplicationConfig
All Implemented Interfaces:
ReplicationConfig

public final class ZooKeeperReplicationConfig extends Object implements ReplicationConfig
ZooKeeper-based replication configuration.
  • Constructor Details

    • ZooKeeperReplicationConfig

      public ZooKeeperReplicationConfig(int serverId, Map<Integer,ZooKeeperServerConfig> servers)
      Creates a new replication configuration.
      Parameters:
      serverId - the ID of this ZooKeeper server in servers
      servers - the ZooKeeper server addresses, keyed by their ZooKeeper server IDs
  • Method Details

    • method

      public ReplicationMethod method()
      Description copied from interface: ReplicationConfig
      Returns the desired replication method.
      Specified by:
      method in interface ReplicationConfig
    • serverId

      public int serverId()
      Returns the ID of this ZooKeeper server in servers().
    • serverConfig

      public ZooKeeperServerConfig serverConfig()
      Returns the configuration of this ZooKeeper server in servers().
    • servers

      public Map<Integer,ZooKeeperServerConfig> servers()
      Returns the configuration of all ZooKeeper servers, keyed by their server IDs.
    • secret

      public String secret()
      Returns the secret string used for authenticating the ZooKeeper peers.
    • additionalProperties

      public Map<String,String> additionalProperties()
      Returns the additional ZooKeeper properties. If unspecified, an empty Map is returned.
    • timeoutMillis

      public int timeoutMillis()
      Returns the ZooKeeper timeout, in milliseconds. If unspecified, the default of 10000 is returned.
    • numWorkers

      public int numWorkers()
      Returns the number of worker threads dedicated for replication. If unspecified, the default of 16 is returned.
    • maxLogCount

      public int maxLogCount()
      Returns the maximum number of log items to keep in ZooKeeper. Note that the log items will still not be removed if they are younger than minLogAgeMillis(). If unspecified, the default of 1024 is returned.
    • minLogAgeMillis

      public long minLogAgeMillis()
      Returns the minimum allowed age of log items before they are removed from ZooKeeper. If unspecified, the default of 1 hour is returned.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object