public abstract class AbstractQueryContext extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractQueryContext.DriverEstimateRunnable
Runnable to wrap estimate computation for a driver.
|
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG
The Constant LOG
|
Modifier and Type | Method and Description |
---|---|
void |
clearTransientStateAfterCompleted() |
void |
clearTransientStateAfterLaunch() |
void |
estimateCostForDrivers()
Estimate cost for each driver and set in context
|
String |
getDatabase()
Returns database set while launching query
|
org.apache.hadoop.conf.Configuration |
getDriverConf(LensDriver driver)
Get driver conf
|
Map<LensDriver,AbstractQueryContext.DriverEstimateRunnable> |
getDriverEstimateRunnables()
Get runnables wrapping estimate computation, which could be processed offline
|
String |
getDriverQuery(LensDriver driver)
Get driver query
|
QueryCost |
getDriverQueryCost(LensDriver driver)
Get query cost for the driver
|
Exception |
getDriverRewriteError(LensDriver driver)
Get exception during rewrite.
|
String |
getFinalDriverQuery(LensDriver driver) |
org.apache.hadoop.hive.conf.HiveConf |
getHiveConf()
Gets HiveConf corresponding to query conf.
|
String |
getLogHandle()
Get handle of the query for logging purposes
|
LensDriver |
getSelectedDriver()
Wrapper method for convenience on driver context
|
org.apache.hadoop.conf.Configuration |
getSelectedDriverConf()
Wrapper method for convenience on driver context
|
String |
getSelectedDriverQuery()
Wrapper method for convenience on driver context
|
QueryCost |
getSelectedDriverQueryCost()
Get selected driver's cost
|
DriverQueryPlan |
getSelectedDriverQueryPlan()
Wrapper method for convenience on driver context
|
void |
initTransientState() |
void |
setDriverQueries(Map<LensDriver,String> driverQueries)
Set driver queries
|
void |
setDriverQuery(LensDriver driver,
String query)
Set query for a given driver
|
void |
setDriverRewriteError(LensDriver driver,
Exception exp)
Set exception during rewrite.
|
void |
setFinalDriverQuery(LensDriver driver,
String rewrittenQuery)
Set final driver rewritten query for the driver.
|
void |
setSelectedDriver(LensDriver driver)
Wrapper method for convenience on driver context
|
void |
setSelectedDriverQuery(String driverQuery)
Sets the selected driver query for persistence and also in the driver context
|
public void initTransientState()
public void setDriverQueries(Map<LensDriver,String> driverQueries) throws LensException
driverQueries
- Map of LensDriver to driver's queryLensException
public void estimateCostForDrivers() throws LensException
LensException
public Map<LensDriver,AbstractQueryContext.DriverEstimateRunnable> getDriverEstimateRunnables() throws LensException
LensException
public String getSelectedDriverQuery()
public String getDriverQuery(LensDriver driver)
driver
- public String getFinalDriverQuery(LensDriver driver)
public org.apache.hadoop.conf.Configuration getDriverConf(LensDriver driver)
driver
- public QueryCost getDriverQueryCost(LensDriver driver)
driver
- public org.apache.hadoop.conf.Configuration getSelectedDriverConf()
public void setSelectedDriverQuery(String driverQuery)
driverQuery
- public void setSelectedDriver(LensDriver driver)
driver
- Lens driverpublic LensDriver getSelectedDriver()
public DriverQueryPlan getSelectedDriverQueryPlan() throws LensException
LensException
public QueryCost getSelectedDriverQueryCost() throws LensException
LensException
public void setDriverRewriteError(LensDriver driver, Exception exp)
driver
- exp
- public Exception getDriverRewriteError(LensDriver driver)
driver
- public org.apache.hadoop.hive.conf.HiveConf getHiveConf()
public void setFinalDriverQuery(LensDriver driver, String rewrittenQuery)
driver
- rewrittenQuery
- public void setDriverQuery(LensDriver driver, String query)
driver
- driver instancequery
- query stringpublic String getLogHandle()
public String getDatabase()
public void clearTransientStateAfterLaunch()
public void clearTransientStateAfterCompleted()
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.