Couchbase C++ SDK 1.3.2 (rev. 49d3be2)
Loading...
Searching...
No Matches
node_id Class Reference

Uniquely identifies a cluster node. More...

#include <couchbase/node_id.hxx>

Public Member Functions

 node_id ()=default
 Creates an empty (invalid) node_id.
auto id () const -> const std::string &
 User-facing identifier string.
auto node_uuid () const -> const std::string &
 The server-assigned node UUID (empty on servers before 8.0.1).
auto hostname () const -> const std::string &
 The hostname of the node.
auto port () const -> std::uint16_t
 The port of the node's key-value service.
 operator bool () const
 Returns true when the node_id was properly initialized (not default-constructed).
auto operator== (const node_id &other) const -> bool
auto operator!= (const node_id &other) const -> bool
auto operator< (const node_id &other) const -> bool

Friends

class internal_node_id

Detailed Description

Uniquely identifies a cluster node.

On Couchbase Server 8.0.1+ the identifier is the server-assigned node UUID. On older releases, a stable opaque token is derived from the node's hostname and management port.

The type is equality-comparable, ordered, and hashable.

Since
1.3.2
Uncommitted
Might be changed in the future, and eventually promoted to committed

Constructor & Destructor Documentation

◆ node_id()

node_id ( )
default

Creates an empty (invalid) node_id.

Since
1.3.2
Uncommitted
Might be changed in the future, and eventually promoted to committed

Member Function Documentation

◆ hostname()

auto hostname ( ) const -> const std::string &
nodiscard

The hostname of the node.

Since
1.3.2
Uncommitted
Might be changed in the future, and eventually promoted to committed

◆ id()

auto id ( ) const -> const std::string &
nodiscard

User-facing identifier string.

Returns node_uuid when the server provides one, otherwise a stable hex-encoded hash derived from hostname and management port.

Returns
opaque identifier string (empty for default-constructed instances)
Since
1.3.2
Uncommitted
Might be changed in the future, and eventually promoted to committed

◆ node_uuid()

auto node_uuid ( ) const -> const std::string &
nodiscard

The server-assigned node UUID (empty on servers before 8.0.1).

Since
1.3.2
Uncommitted
Might be changed in the future, and eventually promoted to committed

◆ operator bool()

operator bool ( ) const
explicit

Returns true when the node_id was properly initialized (not default-constructed).

Since
1.3.2
Uncommitted
Might be changed in the future, and eventually promoted to committed

◆ operator!=()

auto operator!= ( const node_id & other) const -> bool

◆ operator<()

auto operator< ( const node_id & other) const -> bool

◆ operator==()

auto operator== ( const node_id & other) const -> bool

◆ port()

auto port ( ) const -> std::uint16_t
nodiscard

The port of the node's key-value service.

This reflects the port actually used by the client: the TLS port when the cluster connection is TLS-enabled, otherwise the plain port.

Since
1.3.2
Uncommitted
Might be changed in the future, and eventually promoted to committed

◆ internal_node_id

friend class internal_node_id
friend

The documentation for this class was generated from the following file: