@InterfaceAudience.Private @InterfaceStability.Evolving public class ProcedureExecutor<TEnvironment> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ProcedureExecutor.ProcedureExecutorListener |
static class |
ProcedureExecutor.Testing |
Constructor and Description |
---|
ProcedureExecutor(org.apache.hadoop.conf.Configuration conf,
TEnvironment environment,
ProcedureStore store) |
ProcedureExecutor(org.apache.hadoop.conf.Configuration conf,
TEnvironment environment,
ProcedureStore store,
ProcedureRunnableSet runqueue) |
Modifier and Type | Method and Description |
---|---|
boolean |
abort(long procId)
Send an abort notification the specified procedure.
|
boolean |
abort(long procId,
boolean mayInterruptIfRunning)
Send an abort notification the specified procedure.
|
int |
getActiveExecutorCount() |
TEnvironment |
getEnvironment() |
int |
getNumThreads() |
Procedure |
getProcedure(long procId) |
ProcedureInfo |
getResult(long procId) |
Pair<ProcedureInfo,Procedure> |
getResultOrProcedure(long procId) |
Map<Long,ProcedureInfo> |
getResults() |
protected ProcedureRunnableSet |
getRunnableSet() |
ProcedureStore |
getStore() |
boolean |
isFinished(long procId)
Return true if the procedure is finished.
|
boolean |
isProcedureOwner(long procId,
User user)
Check if the user is this procedure's owner
|
boolean |
isRunning() |
boolean |
isStarted(long procId)
Return true if the procedure is started.
|
void |
join() |
List<ProcedureInfo> |
listProcedures()
List procedures.
|
void |
registerListener(ProcedureExecutor.ProcedureExecutorListener listener) |
void |
removeResult(long procId)
Mark the specified completed procedure, as ready to remove.
|
void |
start(int numThreads) |
void |
stop() |
long |
submitProcedure(Procedure proc)
Add a new root-procedure to the executor.
|
long |
submitProcedure(Procedure proc,
long nonceGroup,
long nonce)
Add a new root-procedure to the executor.
|
boolean |
unregisterListener(ProcedureExecutor.ProcedureExecutorListener listener) |
public ProcedureExecutor(org.apache.hadoop.conf.Configuration conf, TEnvironment environment, ProcedureStore store)
public ProcedureExecutor(org.apache.hadoop.conf.Configuration conf, TEnvironment environment, ProcedureStore store, ProcedureRunnableSet runqueue)
public void start(int numThreads) throws IOException
IOException
public void stop()
public void join()
public boolean isRunning()
public int getNumThreads()
public int getActiveExecutorCount()
public TEnvironment getEnvironment()
public ProcedureStore getStore()
public void registerListener(ProcedureExecutor.ProcedureExecutorListener listener)
public boolean unregisterListener(ProcedureExecutor.ProcedureExecutorListener listener)
public List<ProcedureInfo> listProcedures()
public long submitProcedure(Procedure proc)
proc
- the new procedure to execute.public long submitProcedure(Procedure proc, long nonceGroup, long nonce)
proc
- the new procedure to execute.nonceGroup
- nonce
- public ProcedureInfo getResult(long procId)
public boolean isFinished(long procId)
procId
- the ID of the procedure to checkpublic boolean isStarted(long procId)
procId
- the ID of the procedure to checkpublic void removeResult(long procId)
procId
- the ID of the procedure to removepublic boolean abort(long procId)
procId
- the procedure to abortpublic boolean abort(long procId, boolean mayInterruptIfRunning)
procId
- the procedure to abortmayInterruptIfRunning
- if the proc completed at least one step, should it be aborted?public boolean isProcedureOwner(long procId, User user)
procId
- the target procedureuser
- the userpublic Map<Long,ProcedureInfo> getResults()
public Procedure getProcedure(long procId)
protected ProcedureRunnableSet getRunnableSet()
public Pair<ProcedureInfo,Procedure> getResultOrProcedure(long procId)
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.