Class DistributedWorkQueueWorkAssigner
- java.lang.Object
-
- org.apache.accumulo.master.replication.DistributedWorkQueueWorkAssigner
-
- All Implemented Interfaces:
WorkAssigner
- Direct Known Subclasses:
SequentialWorkAssigner
,UnorderedWorkAssigner
public abstract class DistributedWorkQueueWorkAssigner extends Object implements WorkAssigner
Common methods forWorkAssigner
s
-
-
Field Summary
Fields Modifier and Type Field Description protected AccumuloClient
client
protected AccumuloConfiguration
conf
protected int
maxQueueSize
protected DistributedWorkQueue
workQueue
protected ZooCache
zooCache
-
Constructor Summary
Constructors Constructor Description DistributedWorkQueueWorkAssigner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
assignWork()
protected abstract void
cleanupFinishedWork()
Remove finished replication work from the internal statevoid
configure(AccumuloConfiguration conf, AccumuloClient client)
protected void
createWork()
Scan over theReplicationSchema.WorkSection
of the replication table adding work for entries that have data to replicate and have not already been queued.protected abstract Set<String>
getQueuedWork(ReplicationTarget target)
protected abstract int
getQueueSize()
protected abstract void
initializeQueuedWork()
Set up any internal state before using the WorkAssignerprotected void
initializeWorkQueue(AccumuloConfiguration conf)
Initialize the DistributedWorkQueue using the proper ZK locationprotected boolean
isWorkRequired(Replication.Status status)
protected abstract boolean
queueWork(org.apache.hadoop.fs.Path path, ReplicationTarget target)
Queue the given work for the targetprotected abstract void
removeQueuedWork(ReplicationTarget target, String queueKey)
Remove the given work from the internal stateprotected void
setClient(AccumuloClient client)
protected void
setMaxQueueSize(int maxQueueSize)
protected void
setWorkQueue(DistributedWorkQueue workQueue)
protected void
setZooCache(ZooCache zooCache)
protected abstract boolean
shouldQueueWork(ReplicationTarget target)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.accumulo.server.replication.WorkAssigner
getName
-
-
-
-
Field Detail
-
client
protected AccumuloClient client
-
conf
protected AccumuloConfiguration conf
-
workQueue
protected DistributedWorkQueue workQueue
-
maxQueueSize
protected int maxQueueSize
-
zooCache
protected ZooCache zooCache
-
-
Method Detail
-
isWorkRequired
protected boolean isWorkRequired(Replication.Status status)
-
setClient
protected void setClient(AccumuloClient client)
-
setWorkQueue
protected void setWorkQueue(DistributedWorkQueue workQueue)
-
setMaxQueueSize
protected void setMaxQueueSize(int maxQueueSize)
-
setZooCache
protected void setZooCache(ZooCache zooCache)
-
initializeWorkQueue
protected void initializeWorkQueue(AccumuloConfiguration conf)
Initialize the DistributedWorkQueue using the proper ZK location
-
configure
public void configure(AccumuloConfiguration conf, AccumuloClient client)
- Specified by:
configure
in interfaceWorkAssigner
-
assignWork
public void assignWork()
- Specified by:
assignWork
in interfaceWorkAssigner
-
createWork
protected void createWork()
Scan over theReplicationSchema.WorkSection
of the replication table adding work for entries that have data to replicate and have not already been queued.
-
shouldQueueWork
protected abstract boolean shouldQueueWork(ReplicationTarget target)
- Returns:
- Can replication work for the given
ReplicationTarget
be submitted to be worked on.
-
getQueueSize
protected abstract int getQueueSize()
- Returns:
- the size of the queued work
-
initializeQueuedWork
protected abstract void initializeQueuedWork()
Set up any internal state before using the WorkAssigner
-
queueWork
protected abstract boolean queueWork(org.apache.hadoop.fs.Path path, ReplicationTarget target)
Queue the given work for the target- Parameters:
path
- File to replicatetarget
- Target for the work- Returns:
- True if the work was queued, false otherwise
-
getQueuedWork
protected abstract Set<String> getQueuedWork(ReplicationTarget target)
- Parameters:
target
- Target for the work- Returns:
- Queued work for the given target
-
removeQueuedWork
protected abstract void removeQueuedWork(ReplicationTarget target, String queueKey)
Remove the given work from the internal state
-
cleanupFinishedWork
protected abstract void cleanupFinishedWork()
Remove finished replication work from the internal state
-
-