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 | Method and Description |
---|---|
void |
clearTransientStateAfterCompleted() |
void |
clearTransientStateAfterLaunch() |
void |
estimateCostForDrivers()
Estimate cost for each driver and set in context
|
org.apache.hadoop.conf.Configuration |
getConf()
The merged Query conf.
|
String |
getDatabase()
Returns database set while launching query
|
org.apache.hadoop.conf.Configuration |
getDriverConf(LensDriver driver)
Get driver conf
|
DriverSelectorQueryContext |
getDriverContext()
The driver ctx
|
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.
|
DriverQueryPlan |
getDriverRewriterPlan(LensDriver driver) |
String |
getFinalDriverQuery(LensDriver driver) |
org.apache.hadoop.hive.conf.HiveConf |
getHiveConf()
Gets HiveConf corresponding to query conf.
|
LensConf |
getLensConf()
The query conf.
|
String |
getLensSessionIdentifier()
The lens session identifier.
|
abstract String |
getLogHandle()
Get handle of the query for logging purposes
|
String |
getPhase1RewrittenQuery()
The replaced user query.
|
String |
getQueue() |
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()
The selected Driver query cost
|
DriverQueryPlan |
getSelectedDriverQueryPlan()
Wrapper method for convenience on driver context
|
String |
getSubmittedUser()
The submitted user.
|
Map<String,Double> |
getTableWeights(LensDriver driver) |
String |
getUserQuery()
The user query.
|
void |
initTransientState() |
boolean |
isDriverQueryExplicitlySet()
Will be set to true when the driver queries are explicitly set
This will help avoiding rewrites in case of system restarts.
|
boolean |
isOlapQuery()
Is olap cube query or not
|
void |
setConf(org.apache.hadoop.conf.Configuration conf)
The merged Query conf.
|
void |
setDriverContext(DriverSelectorQueryContext driverContext)
The driver ctx
|
void |
setDriverCost(LensDriver driver,
QueryCost cost) |
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 |
setLensSessionIdentifier(String lensSessionIdentifier)
The lens session identifier.
|
void |
setOlapQuery(boolean olapQuery)
Is olap cube query or not
|
void |
setPhase1RewrittenQuery(String phase1RewrittenQuery)
The replaced user query.
|
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
|
void |
setSelectedDriverQueryCost(QueryCost selectedDriverQueryCost)
The selected Driver query cost
|
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 Map<String,Double> getTableWeights(LensDriver driver)
public DriverQueryPlan getDriverRewriterPlan(LensDriver driver)
public String getQueue()
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 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 void setDriverCost(LensDriver driver, QueryCost cost)
public abstract String getLogHandle()
public String getDatabase()
public void clearTransientStateAfterLaunch()
public void clearTransientStateAfterCompleted()
@Generated(value="lombok") public String getUserQuery()
@Generated(value="lombok") public String getPhase1RewrittenQuery()
@Generated(value="lombok") public void setPhase1RewrittenQuery(String phase1RewrittenQuery)
@Generated(value="lombok") public org.apache.hadoop.conf.Configuration getConf()
@Generated(value="lombok") public void setConf(org.apache.hadoop.conf.Configuration conf)
@Generated(value="lombok") public LensConf getLensConf()
@Generated(value="lombok") public DriverSelectorQueryContext getDriverContext()
@Generated(value="lombok") public void setDriverContext(DriverSelectorQueryContext driverContext)
@Generated(value="lombok") public QueryCost getSelectedDriverQueryCost()
@Generated(value="lombok") public void setSelectedDriverQueryCost(QueryCost selectedDriverQueryCost)
@Generated(value="lombok") public String getSubmittedUser()
@Generated(value="lombok") public String getLensSessionIdentifier()
@Generated(value="lombok") public void setLensSessionIdentifier(String lensSessionIdentifier)
@Generated(value="lombok") public boolean isDriverQueryExplicitlySet()
@Generated(value="lombok") public boolean isOlapQuery()
@Generated(value="lombok") public void setOlapQuery(boolean olapQuery)
Copyright © 2014–2016 Apache Software Foundation. All rights reserved.