public interface

ClusterNode

com.atlassian.bitbucket.cluster.ClusterNode

Class Overview

Describes a single node in a cluster.

Summary

Public Methods
@Nonnull InetSocketAddress getAddress()
@Nonnull String getId()
Retrieves a cluster-wide unique identifier for this node.
@Nonnull String getName()
A long living cluster name that is defined by setting the system property cluster.node.name
boolean isLocal()

Public Methods

@Nonnull public InetSocketAddress getAddress ()

Returns
  • the complete socket address, comprised of hostname and port, for the node

@Nonnull public String getId ()

Retrieves a cluster-wide unique identifier for this node.

Warning: Plugins should make no assumptions about this ID. That includes:

  • How long it is
  • What characters it contains
  • Whether it will be consistent across restarts. Don't persist long-term data against these IDs
The value is guaranteed to be unique within the cluster. If the cluster is restarted, every node's ID will still be unique but will likely not be the same as the previous value.

Returns
  • a cluster-wide unique identifier for this node

@Nonnull public String getName ()

A long living cluster name that is defined by setting the system property cluster.node.name

Returns
  • The value from the system property named above otherwise an empty string if the property is not set.

public boolean isLocal ()

Returns
  • true if this is the local node; otherwise, false for remote nodes