public class Foreman extends Object implements Runnable
| Modifier and Type | Class and Description |
|---|---|
static class |
Foreman.PhysicalFromLogicalExplain |
static class |
Foreman.ProfileOption |
| Constructor and Description |
|---|
Foreman(WorkManager.WorkerBee bee,
DrillbitContext drillbitContext,
UserClientConnection connection,
UserBitShared.QueryId queryId,
UserProtos.RunQuery queryRequest)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addToEventQueue(UserBitShared.QueryResult.QueryState newState,
Exception exception)
Tells the foreman to move to a new state.
This will be added to the end of the event queue and will be processed once the foreman is ready to accept external events. |
void |
cancel()
Cancel the query.
|
QueryContext |
getQueryContext()
Get the QueryContext created for the query.
|
UserBitShared.QueryId |
getQueryId() |
QueryManager |
getQueryManager()
Get the QueryManager created for the query.
|
String |
getQueryText() |
UserBitShared.QueryResult.QueryState |
getState() |
void |
resume()
Resume the query.
|
void |
run()
Called by execution pool to do query setup, and kick off remote execution.
|
public Foreman(WorkManager.WorkerBee bee, DrillbitContext drillbitContext, UserClientConnection connection, UserBitShared.QueryId queryId, UserProtos.RunQuery queryRequest)
bee - used to submit additional workdrillbitContext - connection - queryId - the id for the queryqueryRequest - the query to executepublic QueryContext getQueryContext()
public QueryManager getQueryManager()
public void cancel()
public void resume()
public void run()
Note that completion of this function is not the end of the Foreman's role in the query's lifecycle.
public void addToEventQueue(UserBitShared.QueryResult.QueryState newState, Exception exception)
newState - the state to move toexception - if not null, the exception that drove this state transition (usually a failure)public UserBitShared.QueryId getQueryId()
public UserBitShared.QueryResult.QueryState getState()
public String getQueryText()
Copyright © 2017 The Apache Software Foundation. All rights reserved.