Class SequentialWorkAssigner
- java.lang.Object
-
- org.apache.accumulo.master.replication.DistributedWorkQueueWorkAssigner
-
- org.apache.accumulo.master.replication.SequentialWorkAssigner
-
- All Implemented Interfaces:
WorkAssigner
public class SequentialWorkAssigner extends DistributedWorkQueueWorkAssigner
Creates work in ZK which isfilename.serialized_ReplicationTarget => filename, but replicates files in the order in which they were created.The intent is to ensure that WALs are replayed in the same order on the peer in which they were applied on the primary.
-
-
Field Summary
-
Fields inherited from class org.apache.accumulo.master.replication.DistributedWorkQueueWorkAssigner
conf, conn, maxQueueSize, workQueue, zooCache
-
-
Constructor Summary
Constructors Constructor Description SequentialWorkAssigner()SequentialWorkAssigner(AccumuloConfiguration conf, Connector conn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcleanupFinishedWork()Iterate over the queued work to remove entries that have been completed.StringgetName()protected Map<String,Map<String,String>>getQueuedWork()protected Set<String>getQueuedWork(ReplicationTarget target)protected intgetQueueSize()protected voidinitializeQueuedWork()Initialize the queuedWork set with the work already sent outprotected booleanqueueWork(org.apache.hadoop.fs.Path path, ReplicationTarget target)Queue the given work for the targetprotected voidremoveQueuedWork(ReplicationTarget target, String queueKey)Remove the given work from the internal stateprotected voidsetQueuedWork(Map<String,Map<String,String>> queuedWork)protected booleanshouldQueueWork(ReplicationTarget target)-
Methods inherited from class org.apache.accumulo.master.replication.DistributedWorkQueueWorkAssigner
assignWork, configure, createWork, getConf, getConnector, getMaxQueueSize, getWorkQueue, getZooCache, initializeWorkQueue, isWorkRequired, setConf, setConnector, setMaxQueueSize, setWorkQueue, setZooCache
-
-
-
-
Constructor Detail
-
SequentialWorkAssigner
public SequentialWorkAssigner()
-
SequentialWorkAssigner
public SequentialWorkAssigner(AccumuloConfiguration conf, Connector conn)
-
-
Method Detail
-
getName
public String getName()
-
initializeQueuedWork
protected void initializeQueuedWork()
Initialize the queuedWork set with the work already sent out- Specified by:
initializeQueuedWorkin classDistributedWorkQueueWorkAssigner
-
cleanupFinishedWork
protected void cleanupFinishedWork()
Iterate over the queued work to remove entries that have been completed.- Specified by:
cleanupFinishedWorkin classDistributedWorkQueueWorkAssigner
-
getQueueSize
protected int getQueueSize()
- Specified by:
getQueueSizein classDistributedWorkQueueWorkAssigner- Returns:
- the size of the queued work
-
shouldQueueWork
protected boolean shouldQueueWork(ReplicationTarget target)
- Specified by:
shouldQueueWorkin classDistributedWorkQueueWorkAssigner- Returns:
- Can replication work for the given
ReplicationTargetbe submitted to be worked on.
-
queueWork
protected boolean queueWork(org.apache.hadoop.fs.Path path, ReplicationTarget target)Description copied from class:DistributedWorkQueueWorkAssignerQueue the given work for the target- Specified by:
queueWorkin classDistributedWorkQueueWorkAssigner- Parameters:
path- File to replicatetarget- Target for the work- Returns:
- True if the work was queued, false otherwise
-
getQueuedWork
protected Set<String> getQueuedWork(ReplicationTarget target)
- Specified by:
getQueuedWorkin classDistributedWorkQueueWorkAssigner- Parameters:
target- Target for the work- Returns:
- Queued work for the given target
-
removeQueuedWork
protected void removeQueuedWork(ReplicationTarget target, String queueKey)
Description copied from class:DistributedWorkQueueWorkAssignerRemove the given work from the internal state- Specified by:
removeQueuedWorkin classDistributedWorkQueueWorkAssigner
-
-