WeaviateEx.Cluster.ShardingState (WeaviateEx v0.7.4)

View Source

Represents the sharding state of a collection.

Contains information about which shards exist and their replica nodes.

Examples

%ShardingState{
  collection: "Article",
  shards: [
    %ShardReplicas{name: "shard-0", replicas: ["node-0", "node-1"]},
    %ShardReplicas{name: "shard-1", replicas: ["node-1", "node-2"]}
  ]
}

Summary

Functions

Parse sharding state from API response.

Types

t()

@type t() :: %WeaviateEx.Cluster.ShardingState{
  collection: String.t(),
  shards: [WeaviateEx.Cluster.ShardingState.ShardReplicas.t()]
}

Functions

from_api(map)

@spec from_api(map()) :: t()

Parse sharding state from API response.

Examples

iex> ShardingState.from_api(%{
...>   "shardingState" => %{
...>     "collection" => "Article",
...>     "shards" => [%{"shard" => "shard-0", "replicas" => ["node-0"]}]
...>   }
...> })
%ShardingState{collection: "Article", shards: [%ShardReplicas{name: "shard-0", replicas: ["node-0"]}]}