@Test(dataProvider = "priorityDataProvider") public void testPriority(final Set<FactPartition> partitions, Priority expected) throws Exception { Configuration conf = new Configuration(); QueryContext ctx = createContext("test priority query", conf); ctx.getDriverContext().setDriverRewriterPlan(driver, new DriverQueryPlan() { @Override public String getPlan() { return null; } @Override public QueryCost getCost() { return null; } }); ctx.getDriverContext().getDriverRewriterPlan(driver).getPartitions().putAll( new HashMap<String, Set<FactPartition>>() { { put("table1", partitions); } }); ctx.getDriverContext().getDriverRewriterPlan(driver).getTableWeights().putAll( new HashMap<String, Double>() { { put("table1", 1.0); } }); ctx.setOlapQuery(true); Priority priority = driver.decidePriority(ctx); assertEquals(priority, expected, "cost: " + ctx.getDriverQueryCost(driver) + "priority: " + priority); assertEquals(ctx.getConf().get("mapred.job.priority"), priority.toString()); assertEquals(driver.decidePriority(ctx, alwaysNormalPriorityDecider), Priority.NORMAL); }
@Override public Priority decidePriority(AbstractQueryContext ctx) { return decidePriority(ctx, queryPriorityDecider); }
HiveDriver extends AbstractLensDriver { @Override public Priority decidePriority(AbstractQueryContext ctx) { return decidePriority(ctx, queryPriorityDecider); } }
HiveDriver extends AbstractLensDriver { @Override public Priority decidePriority(AbstractQueryContext ctx) { return decidePriority(ctx, queryPriorityDecider); } HiveDriver(); }
HiveDriver extends AbstractLensDriver { @Override public Priority decidePriority(AbstractQueryContext ctx) { return decidePriority(ctx, queryPriorityDecider); } HiveDriver(); boolean areDBResourcesAddedForSession(String sessionHandle, String database); void setResourcesAddedForSession(String sessionHandle, String database); @Override void configure(Configuration conf, String driverType, String driverName); @Override QueryCost estimate(AbstractQueryContext qctx); @Override HiveQueryPlan explain(AbstractQueryContext explainCtx); @Override DriverQueryPlan explainAndPrepare(PreparedQueryContext pContext); @Override void prepare(PreparedQueryContext pContext); @Override void closePreparedQuery(QueryPrepareHandle handle); LensResultSet execute(QueryContext ctx); @Override void executeAsync(QueryContext ctx); @Override void updateStatus(QueryContext context); @Override void closeResultSet(QueryHandle handle); @Override void closeQuery(QueryHandle handle); @Override boolean cancelQuery(QueryHandle handle); @Override void close(); @Override void registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener); @Override Priority decidePriority(AbstractQueryContext ctx); @Override void registerForCompletionNotification(
    QueryContext context, long timeoutMillis, QueryCompletionListener listener); @Override void readExternal(ObjectInput in); @Override void writeExternal(ObjectOutput out); void closeSession(LensSessionHandle sessionHandle); boolean hasLensSession(LensSessionHandle session); }
HiveDriver extends AbstractLensDriver { @Override public Priority decidePriority(AbstractQueryContext ctx) { return decidePriority(ctx, queryPriorityDecider); } HiveDriver(); boolean areDBResourcesAddedForSession(String sessionHandle, String database); void setResourcesAddedForSession(String sessionHandle, String database); @Override void configure(Configuration conf, String driverType, String driverName); @Override QueryCost estimate(AbstractQueryContext qctx); @Override HiveQueryPlan explain(AbstractQueryContext explainCtx); @Override DriverQueryPlan explainAndPrepare(PreparedQueryContext pContext); @Override void prepare(PreparedQueryContext pContext); @Override void closePreparedQuery(QueryPrepareHandle handle); LensResultSet execute(QueryContext ctx); @Override void executeAsync(QueryContext ctx); @Override void updateStatus(QueryContext context); @Override void closeResultSet(QueryHandle handle); @Override void closeQuery(QueryHandle handle); @Override boolean cancelQuery(QueryHandle handle); @Override void close(); @Override void registerDriverEventListener(LensEventListener<DriverEvent> driverEventListener); @Override Priority decidePriority(AbstractQueryContext ctx); @Override void registerForCompletionNotification(
    QueryContext context, long timeoutMillis, QueryCompletionListener listener); @Override void readExternal(ObjectInput in); @Override void writeExternal(ObjectOutput out); void closeSession(LensSessionHandle sessionHandle); boolean hasLensSession(LensSessionHandle session); static final String HIVE_CONNECTION_CLASS; static final String HS2_CONNECTION_EXPIRY_DELAY; static final String HS2_CALCULATE_PRIORITY; static final String HS2_COST_CALCULATOR; static final String HS2_PRIORITY_RANGES; static final long DEFAULT_EXPIRY_DELAY; static final String HS2_PRIORITY_DEFAULT_RANGES; static final String SESSION_KEY_DELIMITER; }