SuperCache.Cluster.Raft.Adapter (SuperCache v1.9.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

Delegate to the backend's RaftEx.add_member/4 with an explicit membership role.

Return the configured backend module.

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

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

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

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

Functions

add_member(leader, server_id, timeout)

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

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

add_member(leader, server_id, membership, timeout)

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

Delegate to the backend's RaftEx.add_member/4 with an explicit membership role.

backend()

@spec backend() :: module()

Return the configured backend module.

consistent_query(server, query, timeout)

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

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

demote_member(leader, server_id, timeout)

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

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

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.

force_delete_server(system, server_id)

@spec force_delete_server(term(), term()) :: term()

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

key_metrics(server, timeout)

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

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

leader_query(server, query, timeout)

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

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

local_query(server, query, timeout)

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

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

member_overview(server, timeout)

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

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

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.

promote_member(leader, server_id, timeout)

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

Delegate to the backend's RaftEx.promote_member/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.

transfer_leadership(leader, target, timeout)

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

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