Class VcrReplicationManager

  • All Implemented Interfaces:
    com.github.ambry.replication.ReplicationAPI

    public class VcrReplicationManager
    extends com.github.ambry.replication.ReplicationEngine
    VcrReplicationManager is used to backup partitions to Cloud. Partitions assignment is handled by Helix.
    • Field Summary

      • Fields inherited from class com.github.ambry.replication.ReplicationEngine

        clusterMap, dataNodeId, dataNodeIdToReplicaThread, leaderBasedReplicationAdmin, logger, metricRegistry, mountPathToPartitionInfos, nextReplicaThreadIndexByDc, partitionToPartitionInfo, persistor, replicaSyncUpManager, replicaThreadPoolByDc, Replication_Delay_Multiplier, replicationConfig, replicationMetrics, replicaTokenFileName, rwLock, scheduler, storeKeyConverterFactory, storeManager, tokenHelper
    • Constructor Summary

      Constructors 
      Constructor Description
      VcrReplicationManager​(com.github.ambry.config.CloudConfig cloudConfig, com.github.ambry.config.ReplicationConfig replicationConfig, com.github.ambry.config.ClusterMapConfig clusterMapConfig, com.github.ambry.config.StoreConfig storeConfig, com.github.ambry.server.StoreManager storeManager, com.github.ambry.store.StoreKeyFactory storeKeyFactory, com.github.ambry.clustermap.ClusterMap clusterMap, com.github.ambry.clustermap.VirtualReplicatorCluster virtualReplicatorCluster, CloudDestination cloudDestination, java.util.concurrent.ScheduledExecutorService scheduler, com.github.ambry.network.ConnectionPool connectionPool, VcrMetrics vcrMetrics, com.github.ambry.notification.NotificationSystem requestNotification, com.github.ambry.store.StoreKeyConverterFactory storeKeyConverterFactory, java.lang.String transformerClassName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getRemoteReplicaLagFromLocalInBytes​(com.github.ambry.clustermap.PartitionId partitionId, java.lang.String hostName, java.lang.String replicaPath)  
      VcrMetrics getVcrMetrics()  
      void shutdown()  
      void start()  
      void updateTotalBytesReadByRemoteReplica​(com.github.ambry.clustermap.PartitionId partitionId, java.lang.String hostName, java.lang.String replicaPath, long totalBytesRead)  
      • Methods inherited from class com.github.ambry.replication.ReplicationEngine

        addRemoteReplicaInfoToReplicaThread, controlReplicationForPartitions, getRemoteReplicaInfo, isTokenForRemoteReplicaInfo, reloadReplicationTokenIfExists, removeRemoteReplicaInfoFromReplicaThread, retrieveReplicaTokensAndPersistIfNecessary, stopPartitionReplication
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • VcrReplicationManager

        public VcrReplicationManager​(com.github.ambry.config.CloudConfig cloudConfig,
                                     com.github.ambry.config.ReplicationConfig replicationConfig,
                                     com.github.ambry.config.ClusterMapConfig clusterMapConfig,
                                     com.github.ambry.config.StoreConfig storeConfig,
                                     com.github.ambry.server.StoreManager storeManager,
                                     com.github.ambry.store.StoreKeyFactory storeKeyFactory,
                                     com.github.ambry.clustermap.ClusterMap clusterMap,
                                     com.github.ambry.clustermap.VirtualReplicatorCluster virtualReplicatorCluster,
                                     CloudDestination cloudDestination,
                                     java.util.concurrent.ScheduledExecutorService scheduler,
                                     com.github.ambry.network.ConnectionPool connectionPool,
                                     VcrMetrics vcrMetrics,
                                     com.github.ambry.notification.NotificationSystem requestNotification,
                                     com.github.ambry.store.StoreKeyConverterFactory storeKeyConverterFactory,
                                     java.lang.String transformerClassName)
                              throws com.github.ambry.replication.ReplicationException,
                                     java.lang.IllegalStateException
        Throws:
        com.github.ambry.replication.ReplicationException
        java.lang.IllegalStateException
    • Method Detail

      • start

        public void start()
                   throws com.github.ambry.replication.ReplicationException
        Specified by:
        start in class com.github.ambry.replication.ReplicationEngine
        Throws:
        com.github.ambry.replication.ReplicationException
      • shutdown

        public void shutdown()
                      throws com.github.ambry.replication.ReplicationException
        Overrides:
        shutdown in class com.github.ambry.replication.ReplicationEngine
        Throws:
        com.github.ambry.replication.ReplicationException
      • getVcrMetrics

        public VcrMetrics getVcrMetrics()
      • updateTotalBytesReadByRemoteReplica

        public void updateTotalBytesReadByRemoteReplica​(com.github.ambry.clustermap.PartitionId partitionId,
                                                        java.lang.String hostName,
                                                        java.lang.String replicaPath,
                                                        long totalBytesRead)
        Specified by:
        updateTotalBytesReadByRemoteReplica in interface com.github.ambry.replication.ReplicationAPI
        Overrides:
        updateTotalBytesReadByRemoteReplica in class com.github.ambry.replication.ReplicationEngine
      • getRemoteReplicaLagFromLocalInBytes

        public long getRemoteReplicaLagFromLocalInBytes​(com.github.ambry.clustermap.PartitionId partitionId,
                                                        java.lang.String hostName,
                                                        java.lang.String replicaPath)
        Specified by:
        getRemoteReplicaLagFromLocalInBytes in interface com.github.ambry.replication.ReplicationAPI
        Overrides:
        getRemoteReplicaLagFromLocalInBytes in class com.github.ambry.replication.ReplicationEngine