Class VisibilityReplicationEndpoint
java.lang.Object
org.apache.hadoop.hbase.security.visibility.VisibilityReplicationEndpoint
- All Implemented Interfaces:
ReplicationEndpoint
,ReplicationPeerConfigListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.replication.ReplicationEndpoint
ReplicationEndpoint.Context, ReplicationEndpoint.ReplicateContext
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ReplicationEndpoint
private static final org.slf4j.Logger
private final VisibilityLabelService
-
Constructor Summary
ConstructorDescriptionVisibilityReplicationEndpoint
(ReplicationEndpoint endpoint, VisibilityLabelService visibilityLabelsService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Waits for theReplicationEndpoint
to be up and running.void
awaitRunning
(long timeout, TimeUnit unit) Waits for theReplicationEndpoint
to to be up and running for no more than the given time.void
Waits for theReplicationEndpoint
to reach the terminated (internal) state.void
awaitTerminated
(long timeout, TimeUnit unit) Waits for theReplicationEndpoint
to reach a terminal state for no more than the given time.boolean
Whether or not, the replication endpoint can replicate to it's source cluster with the same UUIDReturns theThrowable
that caused this service to fail.Returns a UUID of the provided peer id.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
Returnstrue
if this service is RUNNING.boolean
Returns Returntrue
is this service is STARTING (but not yet RUNNING).void
Callback method for when users update the ReplicationPeerConfig for this peerboolean
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.
-
Field Details
-
LOG
-
delegator
-
visibilityLabelsService
-
-
Constructor Details
-
VisibilityReplicationEndpoint
public VisibilityReplicationEndpoint(ReplicationEndpoint endpoint, VisibilityLabelService visibilityLabelsService)
-
-
Method Details
-
init
Description copied from interface:ReplicationEndpoint
Initialize the replication endpoint with the given context.- Specified by:
init
in interfaceReplicationEndpoint
- Parameters:
context
- replication context- Throws:
IOException
- error occur when initialize the endpoint.
-
peerConfigUpdated
Description copied from interface:ReplicationPeerConfigListener
Callback method for when users update the ReplicationPeerConfig for this peer- Specified by:
peerConfigUpdated
in interfaceReplicationPeerConfigListener
- Parameters:
rpc
- The updated ReplicationPeerConfig
-
replicate
Description copied from interface:ReplicationEndpoint
Replicate the given set of entries (in the context) to the other cluster. Can block until all the given entries are replicated. Upon this method is returned, all entries that were passed in the context are assumed to be persisted in the target cluster.- Specified by:
replicate
in interfaceReplicationEndpoint
- Parameters:
replicateContext
- a context where WAL entries and other parameters can be obtained.
-
getPeerUUID
Description copied from interface:ReplicationEndpoint
Returns a UUID of the provided peer id. Every HBase cluster instance has a persisted associated UUID. If the replication is not performed to an actual HBase cluster (but some other system), the UUID returned has to uniquely identify the connected target system.- Specified by:
getPeerUUID
in interfaceReplicationEndpoint
- Returns:
- a UUID or null if the peer cluster does not exist or is not connected.
-
canReplicateToSameCluster
Description copied from interface:ReplicationEndpoint
Whether or not, the replication endpoint can replicate to it's source cluster with the same UUID- Specified by:
canReplicateToSameCluster
in interfaceReplicationEndpoint
-
getWALEntryfilter
Description copied from interface:ReplicationEndpoint
Returns a WALEntryFilter to use for filtering out WALEntries from the log. Replication infrastructure will call this filter before sending the edits to shipEdits().- Specified by:
getWALEntryfilter
in interfaceReplicationEndpoint
- Returns:
- a
WALEntryFilter
or null.
-
isRunning
Description copied from interface:ReplicationEndpoint
Returnstrue
if this service is RUNNING.- Specified by:
isRunning
in interfaceReplicationEndpoint
-
isStarting
Description copied from interface:ReplicationEndpoint
Returns Returntrue
is this service is STARTING (but not yet RUNNING).- Specified by:
isStarting
in interfaceReplicationEndpoint
-
start
Description copied from interface:ReplicationEndpoint
Initiates service startup and returns immediately. A stopped service may not be restarted. Equivalent of startAsync call in Guava Service.- Specified by:
start
in interfaceReplicationEndpoint
-
awaitRunning
Description copied from interface:ReplicationEndpoint
Waits for theReplicationEndpoint
to be up and running.- Specified by:
awaitRunning
in interfaceReplicationEndpoint
-
awaitRunning
Description copied from interface:ReplicationEndpoint
Waits for theReplicationEndpoint
to to be up and running for no more than the given time.- Specified by:
awaitRunning
in interfaceReplicationEndpoint
- Parameters:
timeout
- the maximum time to waitunit
- the time unit of the timeout argument- Throws:
TimeoutException
- if the service has not reached the given state within the deadline
-
stop
Description copied from interface:ReplicationEndpoint
If the service is starting or running, this initiates service shutdown and returns immediately. If the service has already been stopped, this method returns immediately without taking action. Equivalent of stopAsync call in Guava Service.- Specified by:
stop
in interfaceReplicationEndpoint
-
awaitTerminated
Description copied from interface:ReplicationEndpoint
Waits for theReplicationEndpoint
to reach the terminated (internal) state.- Specified by:
awaitTerminated
in interfaceReplicationEndpoint
-
awaitTerminated
Description copied from interface:ReplicationEndpoint
Waits for theReplicationEndpoint
to reach a terminal state for no more than the given time.- Specified by:
awaitTerminated
in interfaceReplicationEndpoint
- Parameters:
timeout
- the maximum time to waitunit
- the time unit of the timeout argument- Throws:
TimeoutException
- if the service has not reached the given state within the deadline
-
failureCause
Description copied from interface:ReplicationEndpoint
Returns theThrowable
that caused this service to fail.- Specified by:
failureCause
in interfaceReplicationEndpoint
-