trinity.core
Functions for operating on Atomix clients, servers and replicas.
bootstrap
(bootstrap replica)
(bootstrap replica nodes)
Bootstraps the replica
.
nodes
- The nodes to bootstrap the replica into. A seq
of map
s containing :host
and :port
values. If not given, the replica is bootstrapped as a single node cluster.
bootstrap-async!
(bootstrap-async! replica)
(bootstrap-async! replica nodes)
Asynchronously bootstraps the replica
.
nodes
- The nodes to bootstrap the replica into. A seq
of map
s containing :host
and :port
values. If not given, the replica is bootstrapped as a single node cluster.
client
(client)
(client config)
Returns an io.atomix.AtomixClient
for the nodes
and config
.
config
- Amap
containing::transport
- Theio.atomix.catalyst.transport.Transport
instance for the client to use. Defaults toNettyTransport
.
connect!
(connect! client nodes)
Connects the client to a cluster.
client
- The client to connect to the cluster.nodes
- Aseq
ofmap
s containing:host
and:port
values.
disk-storage
(disk-storage)
(disk-storage config)
Returns a io.atomix.copycat.server.storage.Storage
instance for the config
.
config
(Optional) should be amap
containing::path
- The path to store logs in. Defaults to[user.dir]/logs/
get-map
(get-map atomix key)
Gets a distributed map for the atomix
instance on the resource key
.
get-map-async
(get-map-async atomix key)
Asynchronously gets a distributed map for the atomix
instance on the resource key
.
get-value
(get-value atomix key)
Gets a distributed value for the atomix
instance on the resource key
.
get-value-async
(get-value-async atomix key)
Asynchronously gets a distributed value for the atomix
instance on the resource key
.
join
(join replica nodes)
Joins the replica
to an existing cluster.
- replica The replica to join to a cluster
nodes
- Aseq
ofmap
s containing:host
and:port
values indicating the nodes to join.
join-async!
(join-async! replica nodes)
Asynchronously joins the replica
to an existing cluster.
replica
- The replica to join to a clusternodes
- Aseq
ofmap
s containing:host
and:port
values indicating the nodes to join.
replica
(replica port nodes)
(replica port nodes config)
Returns an AtomixReplica
for the port
and config
.
port
- The localhost port for the replica to listen on.config
- Amap
containing::storage
- Theio.atomix.copycat.server.storage.Storage
instance for the replica to use.:transport
- Theio.atomix.catalyst.transport.Transport
instance for the client to use. Defaults toNettyTransport
.