View Source Xandra.Cluster.Host (Xandra v0.16.0)

The data structure to represent a host in a Cassandra cluster.

The fields of this struct are public. See t/0 for information on their type, and %Xandra.Cluster.Host{} for more information.

Link to this section Summary

Functions

The struct that represents a host in a Cassandra cluster.

Formats a host's address and port as a string.

Link to this section Types

@type t() :: %Xandra.Cluster.Host{
  address: :inet.ip_address() | :inet.hostname(),
  data_center: String.t(),
  host_id: String.t(),
  port: :inet.port_number(),
  rack: String.t(),
  release_version: String.t(),
  schema_version: String.t(),
  tokens: MapSet.t(String.t())
}

Link to this section Functions

Link to this function

%Xandra.Cluster.Host{}

View Source (since 0.15.0) (struct)

The struct that represents a host in a Cassandra cluster.

See t/0 for the type of each field.

Link to this function

format_address(host)

View Source (since 0.15.0)
@spec format_address(t()) :: String.t()

Formats a host's address and port as a string.

examples

Examples

iex> host = %Xandra.Cluster.Host{address: {127, 0, 0, 1}, port: 9042}
iex> Xandra.Cluster.Host.format_address(host)
"127.0.0.1:9042"