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
client, conf, maxQueueSize, workQueue, zooCache
-
-
Constructor Summary
Constructors Constructor Description SequentialWorkAssigner()
SequentialWorkAssigner(AccumuloConfiguration conf, AccumuloClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cleanupFinishedWork()
Iterate over the queued work to remove entries that have been completed.String
getName()
protected Set<String>
getQueuedWork(ReplicationTarget target)
protected int
getQueueSize()
protected void
initializeQueuedWork()
Initialize the queuedWork set with the work already sent outprotected boolean
queueWork(org.apache.hadoop.fs.Path path, ReplicationTarget target)
Queue the given work for the targetprotected void
removeQueuedWork(ReplicationTarget target, String queueKey)
Remove the given work from the internal stateprotected void
setQueuedWork(Map<String,Map<TableId,String>> queuedWork)
protected boolean
shouldQueueWork(ReplicationTarget target)
-
Methods inherited from class org.apache.accumulo.master.replication.DistributedWorkQueueWorkAssigner
assignWork, configure, createWork, initializeWorkQueue, isWorkRequired, setClient, setMaxQueueSize, setWorkQueue, setZooCache
-
-
-
-
Constructor Detail
-
SequentialWorkAssigner
public SequentialWorkAssigner()
-
SequentialWorkAssigner
public SequentialWorkAssigner(AccumuloConfiguration conf, AccumuloClient client)
-
-
Method Detail
-
getName
public String getName()
-
initializeQueuedWork
protected void initializeQueuedWork()
Initialize the queuedWork set with the work already sent out- Specified by:
initializeQueuedWork
in classDistributedWorkQueueWorkAssigner
-
cleanupFinishedWork
protected void cleanupFinishedWork()
Iterate over the queued work to remove entries that have been completed.- Specified by:
cleanupFinishedWork
in classDistributedWorkQueueWorkAssigner
-
getQueueSize
protected int getQueueSize()
- Specified by:
getQueueSize
in classDistributedWorkQueueWorkAssigner
- Returns:
- the size of the queued work
-
shouldQueueWork
protected boolean shouldQueueWork(ReplicationTarget target)
- Specified by:
shouldQueueWork
in classDistributedWorkQueueWorkAssigner
- Returns:
- Can replication work for the given
ReplicationTarget
be submitted to be worked on.
-
queueWork
protected boolean queueWork(org.apache.hadoop.fs.Path path, ReplicationTarget target)
Description copied from class:DistributedWorkQueueWorkAssigner
Queue the given work for the target- Specified by:
queueWork
in 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:
getQueuedWork
in 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:DistributedWorkQueueWorkAssigner
Remove the given work from the internal state- Specified by:
removeQueuedWork
in classDistributedWorkQueueWorkAssigner
-
-