Class ClusterConfig

java.lang.Object
io.scalecube.cluster.ClusterConfig
All Implemented Interfaces:
Cloneable

public final class ClusterConfig extends Object implements Cloneable
Cluster configuration encapsulate settings needed cluster to create and successfully join.
See Also:
  • Field Details

    • DEFAULT_METADATA_TIMEOUT

      public static final int DEFAULT_METADATA_TIMEOUT
      See Also:
    • DEFAULT_WAN_METADATA_TIMEOUT

      public static final int DEFAULT_WAN_METADATA_TIMEOUT
      See Also:
    • DEFAULT_LOCAL_METADATA_TIMEOUT

      public static final int DEFAULT_LOCAL_METADATA_TIMEOUT
      See Also:
  • Constructor Details

    • ClusterConfig

      public ClusterConfig()
  • Method Details

    • defaultConfig

      public static ClusterConfig defaultConfig()
    • defaultLanConfig

      public static ClusterConfig defaultLanConfig()
      Creates ClusterConfig with default settings for cluster on LAN network.
      Returns:
      new ClusterConfig
    • defaultWanConfig

      public static ClusterConfig defaultWanConfig()
      Creates ClusterConfig with default settings for cluster on WAN network.
      Returns:
      new ClusterConfig
    • defaultLocalConfig

      public static ClusterConfig defaultLocalConfig()
      Creates MembershipConfig with default settings for cluster on local loopback interface.
      Returns:
      new MembershipConfig
    • metadata

      public <T> T metadata()
    • metadata

      public ClusterConfig metadata(Object metadata)
      Setter for metadata.
      Parameters:
      metadata - metadata
      Returns:
      new ClusterConfig instance
    • metadataTimeout

      public int metadataTimeout()
    • metadataTimeout

      public ClusterConfig metadataTimeout(int metadataTimeout)
      Setter for metadataTimeout.
      Parameters:
      metadataTimeout - metadata timeout
      Returns:
      new ClusterConfig instance
    • metadataCodec

      public MetadataCodec metadataCodec()
    • metadataCodec

      public ClusterConfig metadataCodec(MetadataCodec metadataCodec)
      Setter for metadataCodec.
      Parameters:
      metadataCodec - metadata codec
      Returns:
      new ClusterConfig instance
    • externalHost

      public String externalHost()
      Returns externalHost. externalHost is a config property for container environments, it's being set for advertising to scalecube cluster some connectable hostname which maps to scalecube transport's hostname on which scalecube transport is listening.
      Returns:
      external host
    • externalHost

      public ClusterConfig externalHost(String externalHost)
      Setter for externalHost. externalHost is a config property for container environments, it's being set for advertising to scalecube cluster some connectable hostname which maps to scalecube transport's hostname on which scalecube transport is listening.
      Parameters:
      externalHost - external host
      Returns:
      new ClusterConfig instance
    • memberId

      public String memberId()
      Returns ID to use for the local member. If null, the ID will be generated automatically.
      Returns:
      local member ID.
    • memberId

      public ClusterConfig memberId(String memberId)
      Sets ID to use for the local member. If null, the ID will be generated automatically.
      Parameters:
      memberId - local member ID
      Returns:
      new ClusterConfig instance
    • memberAlias

      public String memberAlias()
      Returns memberAlias. memberAlias is a config property which facilitates Member.toString().
      Returns:
      member alias.
    • memberAlias

      public ClusterConfig memberAlias(String memberAlias)
      Setter for memberAlias. memberAlias is a config property which facilitates Member.toString().
      Parameters:
      memberAlias - member alias
      Returns:
      new ClusterConfig instance
    • externalPort

      public Integer externalPort()
      Returns externalPort. externalPort is a config property for container environments, it's being set for advertising to scalecube cluster a port which mapped to scalecube transport's listening port.
      Returns:
      external port
    • externalPort

      public ClusterConfig externalPort(Integer externalPort)
      Setter for externalPort. externalPort is a config property for container environments, it's being set for advertising to scalecube cluster a port which mapped to scalecube transport's listening port.
      Parameters:
      externalPort - external port
      Returns:
      new ClusterConfig instance
    • transport

      Applies TransportConfig settings.
      Parameters:
      op - operator to apply TransportConfig settings
      Returns:
      new ClusterConfig instance
    • transportConfig

      public TransportConfig transportConfig()
    • failureDetector

      public ClusterConfig failureDetector(UnaryOperator<FailureDetectorConfig> op)
      Applies FailureDetectorConfig settings.
      Parameters:
      op - operator to apply FailureDetectorConfig settings
      Returns:
      new ClusterConfig instance
    • failureDetectorConfig

      public FailureDetectorConfig failureDetectorConfig()
    • gossip

      Applies GossipConfig settings.
      Parameters:
      op - operator to apply GossipConfig settings
      Returns:
      new ClusterConfig instance
    • gossipConfig

      public GossipConfig gossipConfig()
    • membership

      public ClusterConfig membership(UnaryOperator<MembershipConfig> op)
      Applies MembershipConfig settings.
      Parameters:
      op - operator to apply MembershipConfig settings
      Returns:
      new ClusterConfig instance
    • membershipConfig

      public MembershipConfig membershipConfig()
    • clone

      public ClusterConfig clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object