Class ReplicationUtil
- java.lang.Object
-
- org.apache.accumulo.server.replication.ReplicationUtil
-
public class ReplicationUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
STATUS_FORMATTER_CLASS_NAME
-
Constructor Summary
Constructors Constructor Description ReplicationUtil(AccumuloServerContext context)
ReplicationUtil(AccumuloServerContext context, ZooCache cache, ReplicaSystemFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAbsolutePath(Connector conn, String workQueuePath, String queueKey)
Fetches the absolute path of the file to be replicated.int
getMaxReplicationThreads(MasterMonitorInfo mmi)
Map<String,String>
getPeers()
Extract replication peers from system configurationSet<org.apache.hadoop.fs.Path>
getPendingReplicationPaths()
Map<ReplicationTarget,Long>
getPendingReplications()
String
getProgress(Connector conn, String path, ReplicationTarget target)
Compute a progress string for the replication of the given WALSet<ReplicationTarget>
getReplicationTargets()
Map<String,String>
invert(Map<String,String> map)
-
-
-
Field Detail
-
STATUS_FORMATTER_CLASS_NAME
public static final String STATUS_FORMATTER_CLASS_NAME
-
-
Constructor Detail
-
ReplicationUtil
public ReplicationUtil(AccumuloServerContext context)
-
ReplicationUtil
public ReplicationUtil(AccumuloServerContext context, ZooCache cache, ReplicaSystemFactory factory)
-
-
Method Detail
-
getMaxReplicationThreads
public int getMaxReplicationThreads(MasterMonitorInfo mmi)
-
getPeers
public Map<String,String> getPeers()
Extract replication peers from system configuration- Returns:
- Configured replication peers
-
getReplicationTargets
public Set<ReplicationTarget> getReplicationTargets()
-
getPendingReplications
public Map<ReplicationTarget,Long> getPendingReplications()
-
getPendingReplicationPaths
public Set<org.apache.hadoop.fs.Path> getPendingReplicationPaths()
-
getAbsolutePath
public String getAbsolutePath(Connector conn, String workQueuePath, String queueKey)
Fetches the absolute path of the file to be replicated.- Parameters:
conn
- Accumulo ConnectorworkQueuePath
- Root path for the Replication WorkQueuequeueKey
- The Replication work queue key- Returns:
- The absolute path for the file, or null if the key is no longer in ZooKeeper
-
getProgress
public String getProgress(Connector conn, String path, ReplicationTarget target)
Compute a progress string for the replication of the given WAL- Parameters:
conn
- Accumulo Connectorpath
- Absolute path to a WAL, or nulltarget
- ReplicationTarget the WAL is being replicated to- Returns:
- A status message for a file being replicated
-
-