public class QueryContext extends AbstractQueryContext
AbstractQueryContext.DriverEstimateRunnable
Constructor and Description |
---|
QueryContext(PreparedQueryContext prepared,
String user,
LensConf qconf,
org.apache.hadoop.conf.Configuration conf)
Creates context from PreparedQueryContext
|
QueryContext(String query,
String user,
LensConf qconf,
org.apache.hadoop.conf.Configuration conf,
Collection<LensDriver> drivers)
Creates context from query
|
Modifier and Type | Method and Description |
---|---|
static QueryContext |
createContextWithSingleDriver(String query,
String user,
LensConf qconf,
org.apache.hadoop.conf.Configuration conf,
LensDriver driver,
String lensSessionPublicId,
boolean mergeDriverConf)
Utility create method to create context with single driver.
|
boolean |
finished() |
long |
getClosedTime()
The closed time.
|
String |
getClusterUser() |
boolean |
getCompressOutput() |
String |
getDriverOpHandle()
The driver op handle.
|
LensResultSet |
getDriverResult()
Query result registered by driver
|
String |
getDriverResultPath()
The hdfsout path.
|
DriverQueryStatus |
getDriverStatus()
The driver status.
|
long |
getEndTime()
The end time.
|
long |
getExecuteTimeoutMillis()
This is the timeout that the client may have provided while initiating query execution
This value is used for pre fetching in-memory result if applicable
Note: in case the timeout is not provided, this value will not be set.
|
org.apache.hadoop.fs.Path |
getHDFSResultDir() |
long |
getLaunchTime()
The launch time.
|
String |
getLogHandle()
Get query handle string
|
long |
getMaxResultSplitRows() |
String |
getOuptutFileExtn() |
byte[] |
getQueryConfHash() |
QueryHandle |
getQueryHandle()
The query handle.
|
String |
getQueryHandleString() |
Future |
getQueryLauncher() |
String |
getQueryName()
The query name.
|
QueryOutputFormatter |
getQueryOutputFormatter()
The query output formatter.
|
String |
getResultEncoding() |
String |
getResultFooter() |
String |
getResultHeader() |
String |
getResultSetParentDir() |
String |
getResultSetPath()
The result set path.
|
com.google.common.collect.ImmutableSet<QueryLaunchingConstraint> |
getSelectedDriverQueryConstraints() |
com.google.common.collect.ImmutableSet<WaitingQueriesSelectionPolicy> |
getSelectedDriverSelectionPolicies() |
QueryStatus |
getStatus()
The status.
|
long |
getSubmissionTime()
The submission time.
|
void |
initTransientState() |
boolean |
isDriverPersistent()
The is driver persistent.
|
boolean |
isDriverResultRegistered()
True if driver has registered the result
|
boolean |
isFinishedQueryPersisted()
The finished query persisted.
|
boolean |
isLaunching() |
boolean |
isPersistent()
The is persistent.
|
boolean |
isQueryClosedOnDriver() |
boolean |
isResultAvailableInDriver() |
boolean |
launched() |
boolean |
queued() |
void |
registerDriverResult(LensResultSet result) |
boolean |
running() |
void |
setClosedTime(long closedTime)
The closed time.
|
void |
setDriverOpHandle(String driverOpHandle)
The driver op handle.
|
void |
setDriverResultPath(String driverResultPath)
The hdfsout path.
|
void |
setEndTime(long endTime)
The end time.
|
void |
setExecuteTimeoutMillis(long executeTimeoutMillis)
This is the timeout that the client may have provided while initiating query execution
This value is used for pre fetching in-memory result if applicable
Note: in case the timeout is not provided, this value will not be set.
|
void |
setFinishedQueryPersisted(boolean finishedQueryPersisted)
The finished query persisted.
|
void |
setLaunching(boolean isLaunching) |
void |
setLaunchTime(long launchTime)
The launch time.
|
void |
setQueryClosedOnDriver(boolean isQueryClosedOnDriver) |
void |
setQueryConfHash(byte[] queryConfHash) |
void |
setQueryHandle(QueryHandle queryHandle)
The query handle.
|
void |
setQueryLauncher(Future queryLauncher) |
void |
setQueryName(String queryName)
The query name.
|
void |
setQueryOutputFormatter(QueryOutputFormatter queryOutputFormatter)
The query output formatter.
|
void |
setResultSetPath(String resultSetPath)
The result set path.
|
void |
setStatus(QueryStatus newStatus) |
void |
setStatusSkippingTransitionTest(QueryStatus newStatus) |
boolean |
splitResultIntoMultipleFiles()
Split result into multiple files.
|
boolean |
successful() |
LensQuery |
toLensQuery()
To lens query.
|
String |
toString() |
void |
unSetDriverPersistent()
Set whether result is persisted on driver to false.
|
void |
updateDriverStatus(BackOffRetryHandler statusUpdateRetryHandler)
Update status from selected driver
|
void |
validateTransition(QueryStatus newStatus) |
clearTransientStateAfterCompleted, clearTransientStateAfterLaunch, estimateCostForDrivers, getConf, getDatabase, getDriverConf, getDriverContext, getDriverEstimateRunnables, getDriverQuery, getDriverQueryCost, getDriverRewriteError, getDriverRewriterPlan, getFinalDriverQuery, getHiveConf, getLensConf, getLensSessionIdentifier, getPhase1RewrittenQuery, getPriority, getQueue, getSelectedDriver, getSelectedDriverConf, getSelectedDriverQuery, getSelectedDriverQueryCost, getSelectedDriverQueryPlan, getSubmittedUser, getTableWeights, getUserQuery, isDriverQueryExplicitlySet, isOlapQuery, setConf, setDriverContext, setDriverCost, setDriverQueries, setDriverQuery, setDriverRewriteError, setFinalDriverQuery, setLensSessionIdentifier, setOlapQuery, setPhase1RewrittenQuery, setPriority, setSelectedDriver, setSelectedDriverQuery, setSelectedDriverQueryCost, updateConf
public QueryContext(String query, String user, LensConf qconf, org.apache.hadoop.conf.Configuration conf, Collection<LensDriver> drivers)
query
- the queryuser
- the userqconf
- The query lensconfconf
- the confpublic QueryContext(PreparedQueryContext prepared, String user, LensConf qconf, org.apache.hadoop.conf.Configuration conf)
prepared
- the prepareduser
- the userqconf
- the qconfconf
- the confpublic static QueryContext createContextWithSingleDriver(String query, String user, LensConf qconf, org.apache.hadoop.conf.Configuration conf, LensDriver driver, String lensSessionPublicId, boolean mergeDriverConf)
query
- The user queryuser
- The submitted queryqconf
- The query lens confconf
- Query configuration object - merged with sessiondriver
- The driverlensSessionPublicId
- The session idpublic void initTransientState()
initTransientState
in class AbstractQueryContext
public String getResultSetParentDir()
public org.apache.hadoop.fs.Path getHDFSResultDir()
public LensQuery toLensQuery()
public boolean isResultAvailableInDriver()
public void unSetDriverPersistent()
public void setStatusSkippingTransitionTest(QueryStatus newStatus)
public void setStatus(QueryStatus newStatus) throws LensException
LensException
public void updateDriverStatus(BackOffRetryHandler statusUpdateRetryHandler) throws LensException
statusUpdateRetryHandler
- The exponential retry handlerLensException
- Throws exception if update from driver has failed.public String getResultHeader()
public String getResultFooter()
public String getResultEncoding()
public String getOuptutFileExtn()
public boolean getCompressOutput()
public long getMaxResultSplitRows()
public boolean splitResultIntoMultipleFiles()
public String getClusterUser()
public String getLogHandle()
getLogHandle
in class AbstractQueryContext
public String getQueryHandleString()
public void validateTransition(QueryStatus newStatus) throws LensException
LensException
public boolean finished()
public boolean successful()
public boolean launched()
public boolean running()
public boolean queued()
public com.google.common.collect.ImmutableSet<QueryLaunchingConstraint> getSelectedDriverQueryConstraints()
public com.google.common.collect.ImmutableSet<WaitingQueriesSelectionPolicy> getSelectedDriverSelectionPolicies()
public void registerDriverResult(LensResultSet result) throws LensException
LensException
@Generated(value="lombok") public QueryHandle getQueryHandle()
@Generated(value="lombok") public void setQueryHandle(QueryHandle queryHandle)
@Generated(value="lombok") public boolean isPersistent()
@Generated(value="lombok") public boolean isDriverPersistent()
@Generated(value="lombok") public QueryStatus getStatus()
@Generated(value="lombok") public String getResultSetPath()
@Generated(value="lombok") public void setResultSetPath(String resultSetPath)
@Generated(value="lombok") public String getDriverResultPath()
@Generated(value="lombok") public void setDriverResultPath(String driverResultPath)
@Generated(value="lombok") public long getSubmissionTime()
@Generated(value="lombok") public long getLaunchTime()
@Generated(value="lombok") public void setLaunchTime(long launchTime)
@Generated(value="lombok") public long getEndTime()
@Generated(value="lombok") public void setEndTime(long endTime)
@Generated(value="lombok") public long getClosedTime()
@Generated(value="lombok") public void setClosedTime(long closedTime)
@Generated(value="lombok") public String getDriverOpHandle()
@Generated(value="lombok") public void setDriverOpHandle(String driverOpHandle)
@Generated(value="lombok") public DriverQueryStatus getDriverStatus()
@Generated(value="lombok") public QueryOutputFormatter getQueryOutputFormatter()
@Generated(value="lombok") public void setQueryOutputFormatter(QueryOutputFormatter queryOutputFormatter)
@Generated(value="lombok") public boolean isFinishedQueryPersisted()
@Generated(value="lombok") public void setFinishedQueryPersisted(boolean finishedQueryPersisted)
@Generated(value="lombok") public boolean isQueryClosedOnDriver()
@Generated(value="lombok") public void setQueryClosedOnDriver(boolean isQueryClosedOnDriver)
@Generated(value="lombok") public String getQueryName()
@Generated(value="lombok") public void setQueryName(String queryName)
@Generated(value="lombok") public void setExecuteTimeoutMillis(long executeTimeoutMillis)
@Generated(value="lombok") public long getExecuteTimeoutMillis()
@Generated(value="lombok") public LensResultSet getDriverResult()
@Generated(value="lombok") public boolean isDriverResultRegistered()
@Generated(value="lombok") public byte[] getQueryConfHash()
@Generated(value="lombok") public void setQueryConfHash(byte[] queryConfHash)
@Generated(value="lombok") public boolean isLaunching()
@Generated(value="lombok") public void setLaunching(boolean isLaunching)
@Generated(value="lombok") public Future getQueryLauncher()
@Generated(value="lombok") public void setQueryLauncher(Future queryLauncher)
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.