R
- the concrete AbstractReplication
subclass: SingleChronicleHashReplication
or ReplicationHub
B
- the concrete builder subclass: SingleChronicleHashReplication.Builder
or
ReplicationHub.Builder
public abstract static class AbstractReplication.Builder<R extends AbstractReplication,B extends AbstractReplication.Builder<R,B>> extends Object
AbstractReplication
configurations. This class and it's subclasses are
mutable, configuration methods mutate the builder and return it back for convenient
chaining.Modifier and Type | Method and Description |
---|---|
B |
bootstrapOnlyLocalEntries(boolean bootstrapOnlyLocalEntries)
Configures if the node, provided with replication, created by this builder, should
replicate only local data, last updated with own identifier, or all data currently
present on the node, when a new node joins the replication grid.
|
B |
connectionListener(ConnectionListener connectionListener) |
abstract R |
createWithId(byte identifier)
Creates a Replication instance with the given node (server) identifier.
|
B |
engineReplication(EngineReplicationLangBytesConsumer engineReplicationLangBytesConsumer) |
B |
remoteNodeValidator(RemoteNodeValidator remoteNodeValidator) |
B |
tcpTransportAndNetwork(TcpTransportAndNetworkConfig tcpConfig) |
String |
toString() |
B |
udpTransport(UdpTransportConfig udpConfig)
Configures UDP transport settings, used by Replications, created by this builder.
|
@NotNull public B engineReplication(EngineReplicationLangBytesConsumer engineReplicationLangBytesConsumer)
@NotNull public B tcpTransportAndNetwork(@Nullable TcpTransportAndNetworkConfig tcpConfig)
@NotNull public B udpTransport(@Nullable UdpTransportConfig udpConfig)
null
means that UDP transport shouldn't being used.udpConfig
- the new UDP transport config for replications, created by this builder.AbstractReplication.udpTransport()
@NotNull public B remoteNodeValidator(@Nullable RemoteNodeValidator remoteNodeValidator)
@NotNull public B connectionListener(@Nullable ConnectionListener connectionListener)
@NotNull public B bootstrapOnlyLocalEntries(boolean bootstrapOnlyLocalEntries)
Default configuration is false
, potentially swamping new nodes with
duplicates. However, this does guarantee that all the data is replicated over to the new
node and is useful especially in the case that the originating node of some data is not
currently running.
bootstrapOnlyLocalEntries
- if a node provided with this replication should
replicate only local data to the new nodes joining the
replication network@NotNull public abstract R createWithId(byte identifier)
identifier
- the node (server) identifier of the returned replicationIllegalArgumentException
- if the given identifier is non-positiveIllegalStateException
- if neither tcpTransportAndNetwork(TcpTransportAndNetworkConfig)
nor udpTransport(UdpTransportConfig)
are
configured to non-null
. At least one of the
transport-level configs should be specified.Copyright © 2015. All rights reserved.