@InterfaceAudience.Private class SyncReplicationPeerInfoProviderImpl extends Object implements SyncReplicationPeerInfoProvider
Modifier and Type | Field and Description |
---|---|
private SyncReplicationPeerMappingManager |
mapping |
private ReplicationPeers |
replicationPeers |
Constructor and Description |
---|
SyncReplicationPeerInfoProviderImpl(ReplicationPeers replicationPeers,
SyncReplicationPeerMappingManager mapping) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkState(TableName table,
BiPredicate<SyncReplicationState,SyncReplicationState> checker)
Check whether the given table is contained in a sync replication peer which can pass the state
checker.
|
Optional<Pair<String,String>> |
getPeerIdAndRemoteWALDir(TableName table)
Return the peer id and remote WAL directory if the table is synchronously replicated and the
state is
SyncReplicationState.ACTIVE . |
private final ReplicationPeers replicationPeers
private final SyncReplicationPeerMappingManager mapping
SyncReplicationPeerInfoProviderImpl(ReplicationPeers replicationPeers, SyncReplicationPeerMappingManager mapping)
public Optional<Pair<String,String>> getPeerIdAndRemoteWALDir(TableName table)
SyncReplicationPeerInfoProvider
SyncReplicationState.ACTIVE
.getPeerIdAndRemoteWALDir
in interface SyncReplicationPeerInfoProvider
public boolean checkState(TableName table, BiPredicate<SyncReplicationState,SyncReplicationState> checker)
SyncReplicationPeerInfoProvider
Will call the checker with current sync replication state and new sync replication state.
checkState
in interface SyncReplicationPeerInfoProvider
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.