@InterfaceAudience.Private @InterfaceStability.Evolving public class MasterProcedureQueue extends Object implements ProcedureRunnableSet
Constructor and Description |
---|
MasterProcedureQueue(org.apache.hadoop.conf.Configuration conf,
TableLockManager lockManager) |
Modifier and Type | Method and Description |
---|---|
void |
addBack(Procedure proc)
Inserts the specified element at the end of this queue.
|
void |
addFront(Procedure proc)
Inserts the specified element at the front of this queue.
|
void |
clear()
Removes all of the elements from this collection.
|
void |
completionCleanup(Procedure proc)
The procedure in execution completed.
|
protected boolean |
markTableAsDeleted(TableName table)
Tries to remove the queue and the table-lock of the specified table.
|
Long |
poll()
Fetch one Procedure from the queue
|
void |
releaseTableRead(TableName table)
Release the read lock taken with tryAcquireTableRead()
|
void |
releaseTableWrite(TableName table)
Release the write lock taken with tryAcquireTableWrite()
|
void |
signalAll()
In case the class is blocking on poll() waiting for items to be added,
this method should awake poll() and poll() should return.
|
int |
size()
Returns the number of elements in this collection.
|
String |
toString() |
boolean |
tryAcquireTableRead(TableName table,
String purpose)
Try to acquire the read lock on the specified table.
|
boolean |
tryAcquireTableWrite(TableName table,
String purpose)
Try to acquire the write lock on the specified table.
|
void |
yield(Procedure proc)
The procedure can't run at the moment.
|
public MasterProcedureQueue(org.apache.hadoop.conf.Configuration conf, TableLockManager lockManager)
public void addFront(Procedure proc)
ProcedureRunnableSet
addFront
in interface ProcedureRunnableSet
proc
- the Procedure to addpublic void addBack(Procedure proc)
ProcedureRunnableSet
addBack
in interface ProcedureRunnableSet
proc
- the Procedure to addpublic void yield(Procedure proc)
ProcedureRunnableSet
yield
in interface ProcedureRunnableSet
proc
- the Procedure to add back to the listpublic Long poll()
ProcedureRunnableSet
poll
in interface ProcedureRunnableSet
public void signalAll()
ProcedureRunnableSet
signalAll
in interface ProcedureRunnableSet
public void clear()
ProcedureRunnableSet
clear
in interface ProcedureRunnableSet
public int size()
ProcedureRunnableSet
size
in interface ProcedureRunnableSet
public void completionCleanup(Procedure proc)
ProcedureRunnableSet
completionCleanup
in interface ProcedureRunnableSet
proc
- the Procedure that completed the execution.public boolean tryAcquireTableRead(TableName table, String purpose)
table
- Table to lockpurpose
- Human readable reason for locking the tablepublic void releaseTableRead(TableName table)
table
- the name of the table that has the read lockpublic boolean tryAcquireTableWrite(TableName table, String purpose)
table
- Table to lockpurpose
- Human readable reason for locking the tablepublic void releaseTableWrite(TableName table)
table
- the name of the table that has the write lockprotected boolean markTableAsDeleted(TableName table)
table
- the name of the table that should be marked as deletedCopyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.