WeaviateEx.Cluster.Replication (WeaviateEx v0.7.4)

View Source

Replication 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

operation_type()

@type operation_type() :: :copy | :move

status()

@type status() :: :pending | :running | :completed | :failed | :cancelled

Functions

status_from_api(arg1)

@spec status_from_api(String.t()) :: status()

Parse status from API response.

Examples

iex> Replication.status_from_api("RUNNING")
:running

iex> Replication.status_from_api("COMPLETED")
:completed

status_to_api(atom)

@spec status_to_api(status()) :: String.t()

Convert status to API string.

Examples

iex> Replication.status_to_api(:running)
"RUNNING"

type_from_api(arg1)

@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

type_to_api(atom)

@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"