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 AccumuloConfiguration
conf
protected Connector
conn
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, Connector conn)
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 AccumuloConfiguration
getConf()
protected Connector
getConnector()
protected int
getMaxQueueSize()
protected abstract Set<String>
getQueuedWork(ReplicationTarget target)
protected abstract int
getQueueSize()
protected DistributedWorkQueue
getWorkQueue()
protected ZooCache
getZooCache()
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
setConf(AccumuloConfiguration conf)
protected void
setConnector(Connector conn)
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
-
conn
protected Connector conn
-
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)
-
getConnector
protected Connector getConnector()
-
setConnector
protected void setConnector(Connector conn)
-
getConf
protected AccumuloConfiguration getConf()
-
setConf
protected void setConf(AccumuloConfiguration conf)
-
getWorkQueue
protected DistributedWorkQueue getWorkQueue()
-
setWorkQueue
protected void setWorkQueue(DistributedWorkQueue workQueue)
-
getMaxQueueSize
protected int getMaxQueueSize()
-
setMaxQueueSize
protected void setMaxQueueSize(int maxQueueSize)
-
getZooCache
protected ZooCache getZooCache()
-
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, Connector conn)
- 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
-
-