@InterfaceAudience.Private public class VisibilityReplicationEndpoint extends Object implements ReplicationEndpoint
ReplicationEndpoint.Context, ReplicationEndpoint.ReplicateContext
Modifier and Type | Field and Description |
---|---|
private ReplicationEndpoint |
delegator |
private static org.slf4j.Logger |
LOG |
private VisibilityLabelService |
visibilityLabelsService |
Constructor and Description |
---|
VisibilityReplicationEndpoint(ReplicationEndpoint endpoint,
VisibilityLabelService visibilityLabelsService) |
Modifier and Type | Method and Description |
---|---|
void |
awaitRunning()
Waits for the
ReplicationEndpoint to be up and running. |
void |
awaitRunning(long timeout,
TimeUnit unit)
Waits for the
ReplicationEndpoint to to be up and running for no more
than the given time. |
void |
awaitTerminated()
Waits for the
ReplicationEndpoint to reach the terminated (internal) state. |
void |
awaitTerminated(long timeout,
TimeUnit unit)
Waits for the
ReplicationEndpoint to reach a terminal state for no
more than the given time. |
boolean |
canReplicateToSameCluster()
Whether or not, the replication endpoint can replicate to it's source cluster with the same
UUID
|
Throwable |
failureCause()
Returns the
Throwable that caused this service to fail. |
UUID |
getPeerUUID()
Returns a UUID of the provided peer id.
|
WALEntryFilter |
getWALEntryfilter()
Returns a WALEntryFilter to use for filtering out WALEntries from the log.
|
void |
init(ReplicationEndpoint.Context context)
Initialize the replication endpoint with the given context.
|
boolean |
isRunning()
Returns
true if this service is RUNNING. |
boolean |
isStarting() |
void |
peerConfigUpdated(ReplicationPeerConfig rpc)
Callback method for when users update the ReplicationPeerConfig for this peer
|
boolean |
replicate(ReplicationEndpoint.ReplicateContext replicateContext)
Replicate the given set of entries (in the context) to the other cluster.
|
void |
start()
Initiates service startup and returns immediately.
|
void |
stop()
If the service is starting or running, this initiates service shutdown and returns immediately.
|
private static final org.slf4j.Logger LOG
private final ReplicationEndpoint delegator
private final VisibilityLabelService visibilityLabelsService
public VisibilityReplicationEndpoint(ReplicationEndpoint endpoint, VisibilityLabelService visibilityLabelsService)
public void init(ReplicationEndpoint.Context context) throws IOException
ReplicationEndpoint
init
in interface ReplicationEndpoint
context
- replication contextIOException
public void peerConfigUpdated(ReplicationPeerConfig rpc)
ReplicationPeerConfigListener
peerConfigUpdated
in interface ReplicationPeerConfigListener
rpc
- The updated ReplicationPeerConfigpublic boolean replicate(ReplicationEndpoint.ReplicateContext replicateContext)
ReplicationEndpoint
replicate
in interface ReplicationEndpoint
replicateContext
- a context where WAL entries and other
parameters can be obtained.public UUID getPeerUUID()
ReplicationEndpoint
getPeerUUID
in interface ReplicationEndpoint
public boolean canReplicateToSameCluster()
ReplicationEndpoint
canReplicateToSameCluster
in interface ReplicationEndpoint
public WALEntryFilter getWALEntryfilter()
ReplicationEndpoint
getWALEntryfilter
in interface ReplicationEndpoint
WALEntryFilter
or null.public boolean isRunning()
ReplicationEndpoint
true
if this service is RUNNING.isRunning
in interface ReplicationEndpoint
public boolean isStarting()
isStarting
in interface ReplicationEndpoint
true
is this service is STARTING (but not yet RUNNING).public void start()
ReplicationEndpoint
start
in interface ReplicationEndpoint
public void awaitRunning()
ReplicationEndpoint
ReplicationEndpoint
to be up and running.awaitRunning
in interface ReplicationEndpoint
public void awaitRunning(long timeout, TimeUnit unit) throws TimeoutException
ReplicationEndpoint
ReplicationEndpoint
to to be up and running for no more
than the given time.awaitRunning
in interface ReplicationEndpoint
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentTimeoutException
- if the service has not reached the given state within the deadlinepublic void stop()
ReplicationEndpoint
stop
in interface ReplicationEndpoint
public void awaitTerminated()
ReplicationEndpoint
ReplicationEndpoint
to reach the terminated (internal) state.awaitTerminated
in interface ReplicationEndpoint
public void awaitTerminated(long timeout, TimeUnit unit) throws TimeoutException
ReplicationEndpoint
ReplicationEndpoint
to reach a terminal state for no
more than the given time.awaitTerminated
in interface ReplicationEndpoint
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentTimeoutException
- if the service has not reached the given state within the deadlinepublic Throwable failureCause()
ReplicationEndpoint
Throwable
that caused this service to fail.failureCause
in interface ReplicationEndpoint
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.