@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.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
MasterProcedureScheduler.ProcedureEvent |
static class |
MasterProcedureScheduler.ServerQueue |
static class |
MasterProcedureScheduler.TableQueue |
| 构造器和说明 |
|---|
MasterProcedureScheduler(org.apache.hadoop.conf.Configuration conf,
TableLockManager lockManager) |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 ProcedureRunnableSetpublic void addBack(Procedure proc)
addBack 在接口中 ProcedureRunnableSetpublic void yield(Procedure proc)
yield 在接口中 ProcedureRunnableSetpublic Procedure poll()
poll 在接口中 ProcedureRunnableSetpublic void clear()
clear 在接口中 ProcedureRunnableSetpublic void signalAll()
signalAll 在接口中 ProcedureRunnableSetpublic int size()
size 在接口中 ProcedureRunnableSetpublic void completionCleanup(Procedure proc)
completionCleanup 在接口中 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–2021 The Apache Software Foundation. All rights reserved.