WeaviateEx.Cluster.Replication (WeaviateEx v0.7.4)
View SourceReplication operation types and status.
Weaviate supports shard replication to move or copy shards between nodes. This module provides types for tracking replication operations.
Operation Types
:copy- Copy shard to target node (source remains):move- Move shard to target node (source is removed)
Operation Status
:pending- Operation is queued:running- Operation is in progress:completed- Operation finished successfully:failed- Operation failed:cancelled- Operation was cancelled
Examples
# Create a replication operation
op = %Replication.Operation{
id: "uuid-123",
collection: "Article",
shard: "shard-0",
source_node: "node-1",
target_node: "node-2",
type: :copy,
status: :running,
progress: 0.45
}
Summary
Functions
Parse status from API response.
Convert status to API string.
Parse operation type from API response.
Convert operation type to API string.
Types
Functions
Parse status from API response.
Examples
iex> Replication.status_from_api("RUNNING")
:running
iex> Replication.status_from_api("COMPLETED")
:completed
Convert status to API string.
Examples
iex> Replication.status_to_api(:running)
"RUNNING"
@spec type_from_api(String.t()) :: operation_type()
Parse operation type from API response.
Examples
iex> Replication.type_from_api("COPY")
:copy
iex> Replication.type_from_api("MOVE")
:move
@spec type_to_api(operation_type()) :: String.t()
Convert operation type to API string.
Examples
iex> Replication.type_to_api(:copy)
"COPY"
iex> Replication.type_to_api(:move)
"MOVE"