SuperCache.Cluster.Raft.Adapter (SuperCache v1.7.0)

Copy Markdown View Source

Thin boundary around the experimental raft_ex API.

Production always delegates to RaftEx. Tests can set the application env :raft_adapter to a module exposing the same functions, which makes Raft failure and membership branches deterministic without a live cluster.

Summary

Functions

add_member(leader, server_id, timeout)

@spec add_member(term(), term(), timeout()) :: term()

Delegate to the backend's RaftEx.add_member/3.

backend()

@spec backend() :: module()

Return the configured backend module.

derive_names(system)

@spec derive_names(atom()) :: map()

Delegate to the backend's RaftEx.App.System.derive_names/1.

find_leader(cluster_name)

@spec find_leader(term()) :: term()

Delegate to the backend's RaftEx.find_leader/1.

members(server, timeout)

@spec members(term(), timeout()) :: term()

Delegate to the backend's RaftEx.members/2.

process_command(server, command, timeout)

@spec process_command(term(), term(), timeout()) :: term()

Delegate to the backend's RaftEx.process_command/3.

remove_member(leader, server_id, timeout)

@spec remove_member(term(), term(), timeout()) :: term()

Delegate to the backend's RaftEx.remove_member/3.

start_cluster(system, cluster_name, machine, desired, timeout)

@spec start_cluster(term(), term(), term(), [term()], timeout()) :: term()

Delegate to the backend's RaftEx.start_cluster/5.

start_or_restart_cluster(system, cluster_name, machine, desired, timeout)

@spec start_or_restart_cluster(term(), term(), term(), [term()], timeout()) :: term()

Delegate to the backend's RaftEx.start_or_restart_cluster/5.

start_server(system, cluster_name, server_id, machine, desired)

@spec start_server(term(), term(), term(), term(), [term()]) :: term()

Delegate to the backend's RaftEx.start_server/5.

stop_server(system, server_id)

@spec stop_server(term(), term()) :: term()

Delegate to the backend's RaftEx.stop_server/2.

system_start(config)

@spec system_start(map()) :: term()

Delegate to the backend's RaftEx.App.System.start/1.

system_stop(system)

@spec system_stop(system :: atom()) :: term()

Delegate to the backend's RaftEx.App.System.stop/1.