Package com.github.ambry.replication
Interface ReplicationAPI
-
public interface ReplicationAPI
This defines the API implemented by Ambry replication nodes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
controlReplicationForPartitions(java.util.Collection<PartitionId> ids, java.util.List<java.lang.String> origins, boolean enable)
Enables/disables replication of the givenids
fromorigins
.long
getRemoteReplicaLagFromLocalInBytes(PartitionId partitionId, java.lang.String hostName, java.lang.String replicaPath)
Gets the replica lag of the remote replica with the local storevoid
updateTotalBytesReadByRemoteReplica(PartitionId partitionId, java.lang.String hostName, java.lang.String replicaPath, long totalBytesRead)
Updates the total bytes read by a remote replica from local store
-
-
-
Method Detail
-
controlReplicationForPartitions
boolean controlReplicationForPartitions(java.util.Collection<PartitionId> ids, java.util.List<java.lang.String> origins, boolean enable)
Enables/disables replication of the givenids
fromorigins
. The disabling is in-memory and therefore is not valid across restarts.- Parameters:
ids
- thePartitionId
s to enable/disable it on.origins
- the list of datacenters from which replication should be enabled/disabled. Having an empty list disables replication from all datacenters.enable
- whether to enable (true
) or disable.- Returns:
true
if disabling succeeded,false
otherwise. Disabling fails iforigins
is empty or contains unrecognized datacenters.
-
updateTotalBytesReadByRemoteReplica
void updateTotalBytesReadByRemoteReplica(PartitionId partitionId, java.lang.String hostName, java.lang.String replicaPath, long totalBytesRead) throws StoreException
Updates the total bytes read by a remote replica from local store- Parameters:
partitionId
- PartitionId to which the replica belongs tohostName
- HostName of the datanode where the replica belongs toreplicaPath
- Replica Path of the replica interested intotalBytesRead
- Total bytes read by the replica- Throws:
StoreException
-
getRemoteReplicaLagFromLocalInBytes
long getRemoteReplicaLagFromLocalInBytes(PartitionId partitionId, java.lang.String hostName, java.lang.String replicaPath)
Gets the replica lag of the remote replica with the local store- Parameters:
partitionId
- The partition to which the remote replica belongs tohostName
- The hostname where the remote replica is presentreplicaPath
- The path of the remote replica on the host- Returns:
- The lag in bytes that the remote replica is behind the local store
-
-