Interface ReplicationPeerStorage
- All Known Implementing Classes:
FSReplicationPeerStorage
,ZKReplicationPeerStorage
Perform read/write to the replication peer storage.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPeer
(String peerId, ReplicationPeerConfig peerConfig, boolean enabled, SyncReplicationState syncReplicationState) Add a replication peer.getPeerConfig
(String peerId) Get the peer config of a replication peer.getPeerNewSyncReplicationState
(String peerId) Get the new sync replication state.getPeerSyncReplicationState
(String peerId) Get the sync replication state.boolean
isPeerEnabled
(String peerId) Test whether a replication peer is enabled.Return the peer ids of all replication peers.void
removePeer
(String peerId) Remove a replication peer.void
setPeerNewSyncReplicationState
(String peerId, SyncReplicationState state) Set the new sync replication state that we are going to transit to.void
setPeerState
(String peerId, boolean enabled) Set the state of peer,true
toENABLED
, otherwise toDISABLED
.void
Overwrite the sync replication state with the new sync replication state which is set with thesetPeerNewSyncReplicationState(String, SyncReplicationState)
method above, and clear the new sync replication state.void
updatePeerConfig
(String peerId, ReplicationPeerConfig peerConfig) Update the config a replication peer.
-
Method Details
-
addPeer
void addPeer(String peerId, ReplicationPeerConfig peerConfig, boolean enabled, SyncReplicationState syncReplicationState) throws ReplicationException Add a replication peer.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
removePeer
Remove a replication peer.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
setPeerState
Set the state of peer,true
toENABLED
, otherwise toDISABLED
.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
updatePeerConfig
Update the config a replication peer.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
listPeerIds
Return the peer ids of all replication peers.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
isPeerEnabled
Test whether a replication peer is enabled.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
getPeerConfig
Get the peer config of a replication peer.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
setPeerNewSyncReplicationState
void setPeerNewSyncReplicationState(String peerId, SyncReplicationState state) throws ReplicationException Set the new sync replication state that we are going to transit to.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
transitPeerSyncReplicationState
Overwrite the sync replication state with the new sync replication state which is set with thesetPeerNewSyncReplicationState(String, SyncReplicationState)
method above, and clear the new sync replication state.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
getPeerSyncReplicationState
Get the sync replication state.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-
getPeerNewSyncReplicationState
Get the new sync replication state. Will returnSyncReplicationState.NONE
if we are not in a transition.- Throws:
ReplicationException
- if there are errors accessing the storage service.
-