@InterfaceAudience.Private @InterfaceStability.Evolving public class MasterProcedureScheduler extends Object implements ProcedureRunnableSet
Each procedure should implement an interface providing information for this queue. for example table related procedures should implement TableProcedureInterface. each procedure will be pushed in its own queue, and based on the operation type we may take smarter decision. e.g. we can abort all the operations preceding a delete table, or similar.
| Modifier and Type | Class and Description |
|---|---|
static class |
MasterProcedureScheduler.ProcedureEvent |
static class |
MasterProcedureScheduler.ServerQueue |
static class |
MasterProcedureScheduler.TableQueue |
| Constructor and Description |
|---|
MasterProcedureScheduler(org.apache.hadoop.conf.Configuration conf,
TableLockManager lockManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBack(Procedure proc) |
void |
addFront(Procedure proc) |
void |
clear() |
void |
completionCleanup(Procedure proc) |
long |
getNullPollCalls() |
long |
getPollCalls() |
protected boolean |
markTableAsDeleted(TableName table)
Tries to remove the queue and the table-lock of the specified table.
|
Procedure |
poll() |
void |
releaseNamespaceExclusiveLock(Procedure procedure,
String nsName)
Release the exclusive lock
|
void |
releaseServerExclusiveLock(Procedure procedure,
ServerName serverName)
Release the exclusive lock
|
void |
releaseServerSharedLock(Procedure procedure,
ServerName serverName)
Release the shared lock taken
|
void |
releaseTableExclusiveLock(Procedure procedure,
TableName table)
Release the exclusive lock taken with tryAcquireTableWrite()
|
void |
releaseTableSharedLock(Procedure procedure,
TableName table)
Release the shared lock taken with tryAcquireTableRead()
|
void |
signalAll() |
int |
size() |
void |
suspend(MasterProcedureScheduler.ProcedureEvent event) |
boolean |
tryAcquireNamespaceExclusiveLock(Procedure procedure,
String nsName)
Try to acquire the exclusive lock on the specified namespace.
|
boolean |
tryAcquireServerExclusiveLock(Procedure procedure,
ServerName serverName)
Try to acquire the exclusive lock on the specified server.
|
boolean |
tryAcquireServerSharedLock(Procedure procedure,
ServerName serverName)
Try to acquire the shared lock on the specified server.
|
boolean |
tryAcquireTableExclusiveLock(Procedure procedure,
TableName table)
Try to acquire the exclusive lock on the specified table.
|
boolean |
tryAcquireTableSharedLock(Procedure procedure,
TableName table)
Try to acquire the shared lock on the specified table.
|
boolean |
waitEvent(MasterProcedureScheduler.ProcedureEvent event,
Procedure procedure) |
boolean |
waitEvent(MasterProcedureScheduler.ProcedureEvent event,
Procedure procedure,
boolean suspendQueue) |
void |
wake(MasterProcedureScheduler.ProcedureEvent event) |
void |
yield(Procedure proc) |
public MasterProcedureScheduler(org.apache.hadoop.conf.Configuration conf,
TableLockManager lockManager)
public void addFront(Procedure proc)
addFront in interface ProcedureRunnableSetpublic void addBack(Procedure proc)
addBack in interface ProcedureRunnableSetpublic void yield(Procedure proc)
yield in interface ProcedureRunnableSetpublic Procedure poll()
poll in interface ProcedureRunnableSetpublic void clear()
clear in interface ProcedureRunnableSetpublic void signalAll()
signalAll in interface ProcedureRunnableSetpublic int size()
size in interface ProcedureRunnableSetpublic void completionCleanup(Procedure proc)
completionCleanup in interface ProcedureRunnableSetpublic long getPollCalls()
public long getNullPollCalls()
public boolean waitEvent(MasterProcedureScheduler.ProcedureEvent event, Procedure procedure)
public boolean waitEvent(MasterProcedureScheduler.ProcedureEvent event, Procedure procedure, boolean suspendQueue)
public void suspend(MasterProcedureScheduler.ProcedureEvent event)
public void wake(MasterProcedureScheduler.ProcedureEvent event)
public boolean tryAcquireTableExclusiveLock(Procedure procedure, TableName table)
procedure - the procedure trying to acquire the locktable - Table to lockpublic void releaseTableExclusiveLock(Procedure procedure, TableName table)
procedure - the procedure releasing the locktable - the name of the table that has the exclusive lockpublic boolean tryAcquireTableSharedLock(Procedure procedure, TableName table)
procedure - the procedure trying to acquire the locktable - Table to lockpublic void releaseTableSharedLock(Procedure procedure, TableName table)
procedure - the procedure releasing the locktable - the name of the table that has the shared lockprotected boolean markTableAsDeleted(TableName table)
table - the name of the table that should be marked as deletedpublic boolean tryAcquireNamespaceExclusiveLock(Procedure procedure, String nsName)
procedure - the procedure trying to acquire the locknsName - Namespace to lockreleaseNamespaceExclusiveLock(Procedure,String)public void releaseNamespaceExclusiveLock(Procedure procedure, String nsName)
procedure - the procedure releasing the locknsName - the namespace that has the exclusive locktryAcquireNamespaceExclusiveLock(Procedure,String)public boolean tryAcquireServerExclusiveLock(Procedure procedure, ServerName serverName)
procedure - the procedure trying to acquire the lockserverName - Server to lockreleaseServerExclusiveLock(Procedure,ServerName)public void releaseServerExclusiveLock(Procedure procedure, ServerName serverName)
procedure - the procedure releasing the lockserverName - the server that has the exclusive locktryAcquireServerExclusiveLock(Procedure,ServerName)public boolean tryAcquireServerSharedLock(Procedure procedure, ServerName serverName)
procedure - the procedure releasing the lockserverName - Server to lockreleaseServerSharedLock(Procedure,ServerName)public void releaseServerSharedLock(Procedure procedure, ServerName serverName)
procedure - the procedure releasing the lockserverName - the server that has the shared locktryAcquireServerSharedLock(Procedure,ServerName)Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.