You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lens.apache.org by am...@apache.org on 2014/11/13 12:50:13 UTC

[46/50] incubator-lens git commit: Added javadoc and apt files.

Added javadoc and apt files.


Project: http://git-wip-us.apache.org/repos/asf/incubator-lens/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-lens/commit/403cb7d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-lens/tree/403cb7d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-lens/diff/403cb7d0

Branch: refs/heads/toapache
Commit: 403cb7d07f6aa6be88a51d1990ff32f0122c1a8e
Parents: 6e64562
Author: Rajat Khandelwal <ra...@inmobi.com>
Authored: Thu Nov 13 12:17:03 2014 +0530
Committer: Rajat Khandelwal <ra...@inmobi.com>
Committed: Thu Nov 13 16:33:27 2014 +0530

----------------------------------------------------------------------
 .../org/apache/lens/driver/hive/HiveDriver.java |  2 +-
 .../DurationBasedQueryPriorityDecider.java      | 86 +++++++++++++++++---
 .../apache/lens/driver/hive/TestHiveDriver.java |  6 ++
 .../lens/server/api/driver/MockDriver.java      |  7 --
 .../api/priority/CostToPriorityRangeConf.java   | 27 ++++++
 .../api/priority/QueryPriorityDecider.java      |  9 +-
 .../lens/server/api/priority/RangeConf.java     | 56 +++++++++++--
 .../server/api/query/AbstractQueryContext.java  |  1 +
 .../api/query/DriverSelectorQueryContext.java   | 18 +++-
 .../server/api/query/ExplainQueryContext.java   |  8 ++
 .../server/query/QueryExecutionServiceImpl.java |  1 -
 .../lens/server/query/TestQueryService.java     |  6 +-
 src/site/apt/admin/config.apt                   |  2 +-
 src/site/apt/admin/hivedriver-config.apt        | 12 ++-
 14 files changed, 205 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java
----------------------------------------------------------------------
diff --git a/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java b/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java
index 89ca7d1..65d6988 100644
--- a/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java
+++ b/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/HiveDriver.java
@@ -77,7 +77,7 @@ public class HiveDriver implements LensDriver {
   public static final String HIVE_CONNECTION_CLASS = "lens.driver.hive.connection.class";
 
   /** The Constant HS2_CONNECTION_EXPIRY_DELAY. */
-  public  static final String HS2_CONNECTION_EXPIRY_DELAY = "lens.driver.hive.connection.expiry.delay";
+  public  static final String HS2_CONNECTION_EXPIRY_DELAY = "lens.driver.hive.hs2.connection.expiry.delay";
 
   public static final String HS2_CALCULATE_PRIORITY = "lens.driver.hive.calculate.priority";
   public static final String HS2_PARTITION_WEIGHT_MONTHLY = "lens.driver.hive.priority.partition.weight.monthly";

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/priority/DurationBasedQueryPriorityDecider.java
----------------------------------------------------------------------
diff --git a/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/priority/DurationBasedQueryPriorityDecider.java b/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/priority/DurationBasedQueryPriorityDecider.java
index 5965309..c9ab9bd 100644
--- a/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/priority/DurationBasedQueryPriorityDecider.java
+++ b/lens-driver-hive/src/main/java/org/apache/lens/driver/hive/priority/DurationBasedQueryPriorityDecider.java
@@ -1,3 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.lens.driver.hive.priority;
 
 import org.apache.lens.api.LensException;
@@ -12,24 +30,59 @@ import java.util.List;
 import java.util.Map;
 
 public class DurationBasedQueryPriorityDecider implements QueryPriorityDecider {
+
+  /** Partition Weights for priority calculation based on selected partitions **/
+
+  /** weight of monthly partition **/
   private float monthlyPartitionWeight;
+  /** weight of daily partition **/
   private float dailyPartitionWeight;
+  /** weight of hourly partition **/
   private float hourlyPartitionWeight;
 
-  public DurationBasedQueryPriorityDecider(float mw, float dw, float hw){
-    monthlyPartitionWeight = mw;
-    dailyPartitionWeight = dw;
-    hourlyPartitionWeight = hw;
+  /**
+   * Constructor. Takes three weights for partitions.
+   * @param mmonthlyPartitoinWeight
+   * @param dailyPartitionWeight
+   * @param hourlyPartitionWeight
+   */
+  public DurationBasedQueryPriorityDecider(float mmonthlyPartitoinWeight,
+    float dailyPartitionWeight, float hourlyPartitionWeight){
+    monthlyPartitionWeight = mmonthlyPartitoinWeight;
+    this.dailyPartitionWeight = dailyPartitionWeight;
+    this.hourlyPartitionWeight = hourlyPartitionWeight;
   }
+
+  /**
+   * Hard Coded
+   * Arbitrary for now. Will need to tune it.
+   * Some perspective wrt default weights(1 for hourly, 0.75 for daily, 0.5 for monthly)
+   * For exclusively hourly data this translates to VERY_HIGH,7days,HIGH,30days,NORMAL,90days,LOW
+   * FOR exclusively daily data this translates to VERY_HIGH,9days,HIGH,40days,NORMAL,120days,LOW
+   * for exclusively monthly data this translates to VERY_HIGH,never,HIGH,1month,NORMAL,6months,LOW
+   */
   static final CostToPriorityRangeConf costToPriorityRangeMap =
-    // Hard Coded
-    // Arbitrary for now. Will need to tune it.
+
     new CostToPriorityRangeConf("VERY_HIGH,7.0,HIGH,30.0,NORMAL,90,LOW");
 
-  public Priority decidePriority(AbstractQueryContext queryContext) throws LensException {
-    return costToPriorityRangeMap.get(getDurationCost(queryContext));
+  /**
+   * The Implementation
+   * @param abstractQueryContext
+   * @return decided Priority
+   * @throws LensException
+   * Exception occurs mostly when one of drivers/explained queries/plans is null
+   */
+  public Priority decidePriority(AbstractQueryContext abstractQueryContext) throws LensException {
+    return costToPriorityRangeMap.get(getDurationCost(abstractQueryContext));
   }
 
+  /**
+   * Extract partitions from AbstractQueryContext. Hive currently gives partitions in the format
+   * {a:[dt partition1, dt partition2]...}. This method removes the "dt"
+   * @param queryContext
+   * @return all the tables along with their selected partitions.
+   * @throws LensException
+   */
   protected Map<String,List<String>> extractPartitions(AbstractQueryContext queryContext) throws LensException{
     Map<String, List<String>> partitions = new HashMap<String, List<String>>();
     for(Map.Entry<String, List<String>> entry: queryContext.getSelectedDriverQueryPlan().getPartitions().entrySet()) {
@@ -42,6 +95,12 @@ public class DurationBasedQueryPriorityDecider implements QueryPriorityDecider {
     return partitions;
   }
 
+  /**
+   * Calculates total cost based on weights of selected tables and their selected partitions
+   * @param queryContext
+   * @return Query Cost
+   * @throws LensException
+   */
 
   float getDurationCost(AbstractQueryContext queryContext) throws LensException {
     final Map<String, List<String>> partitions = extractPartitions(queryContext);
@@ -49,14 +108,21 @@ public class DurationBasedQueryPriorityDecider implements QueryPriorityDecider {
     for(String table: partitions.keySet()) {
       for(String partition: partitions.get(table)) {
         if(!partition.equals("latest")) {
-          cost += queryContext.getSelectedDriverQueryPlan().getTableWeight(table) * getPartitionCost(partition);
+          cost +=
+            queryContext.getSelectedDriverQueryPlan().getTableWeight(table) * getNormalizedPartitionCost(partition);
         }
       }
     }
     return cost;
   }
 
-  float getPartitionCost(String partition) throws LensException {
+  /**
+   * Normalized cost of a partition. PartitionWeight multiplied by number of days in that partition.
+   * @param partition
+   * @return normalized cost.
+   * @throws LensException
+   */
+  float getNormalizedPartitionCost(String partition) throws LensException {
     switch (partition.length()) {
       case 7: //monthly
         return 30 * monthlyPartitionWeight;

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-driver-hive/src/test/java/org/apache/lens/driver/hive/TestHiveDriver.java
----------------------------------------------------------------------
diff --git a/lens-driver-hive/src/test/java/org/apache/lens/driver/hive/TestHiveDriver.java b/lens-driver-hive/src/test/java/org/apache/lens/driver/hive/TestHiveDriver.java
index 403fbfb..dfbdb79 100644
--- a/lens-driver-hive/src/test/java/org/apache/lens/driver/hive/TestHiveDriver.java
+++ b/lens-driver-hive/src/test/java/org/apache/lens/driver/hive/TestHiveDriver.java
@@ -768,6 +768,12 @@ public class TestHiveDriver {
     assertEquals(ctx.getHdfsoutPath(), path);
     driver.closeQuery(plan2.getHandle());
   }
+
+  /**
+   * Testing Duration Based Priority Logic by mocking everything except partitions.
+   * @throws IOException
+   * @throws LensException
+   */
   @Test
   public void testPriority() throws IOException, LensException {
     final MockDriver mockDriver = new MockDriver();

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server-api/src/main/java/org/apache/lens/server/api/driver/MockDriver.java
----------------------------------------------------------------------
diff --git a/lens-server-api/src/main/java/org/apache/lens/server/api/driver/MockDriver.java b/lens-server-api/src/main/java/org/apache/lens/server/api/driver/MockDriver.java
index 8487058..6763e2e 100644
--- a/lens-server-api/src/main/java/org/apache/lens/server/api/driver/MockDriver.java
+++ b/lens-server-api/src/main/java/org/apache/lens/server/api/driver/MockDriver.java
@@ -101,13 +101,6 @@ public class MockDriver implements LensDriver {
     @Getter @Setter
     private Map<String, List<String>> partitions;
 
-//    public Map<String, List<String>> getPartitions() {
-//      return partitions;
-//    }
-//    public void setPartitions(Map<String, List<String>> partitions) {
-//      this.partitions = partitions;
-//    }
-
     @Override
     public String getPlan() {
       return query;

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server-api/src/main/java/org/apache/lens/server/api/priority/CostToPriorityRangeConf.java
----------------------------------------------------------------------
diff --git a/lens-server-api/src/main/java/org/apache/lens/server/api/priority/CostToPriorityRangeConf.java b/lens-server-api/src/main/java/org/apache/lens/server/api/priority/CostToPriorityRangeConf.java
index 995666a..1310244 100644
--- a/lens-server-api/src/main/java/org/apache/lens/server/api/priority/CostToPriorityRangeConf.java
+++ b/lens-server-api/src/main/java/org/apache/lens/server/api/priority/CostToPriorityRangeConf.java
@@ -23,20 +23,47 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.lens.api.Priority;
 
+/**
+ * Cost to priority range conf class.
+ * @see RangeConf
+ */
+
 public class CostToPriorityRangeConf extends RangeConf<Float, Priority>{
+  /**
+   * Super constructor
+   * @see RangeConf#RangeConf(String)
+   * @param confValue
+   */
   public CostToPriorityRangeConf(String confValue) {
     super(confValue);
   }
+
+  /**
+   * Parse key method
+   * @param s
+   * @return parsed float from string s
+   * @see RangeConf#parseKey(String)
+   */
   @Override
   protected Float parseKey(String s) {
     return Float.parseFloat(s);
   }
 
+  /**
+   * Parse value method
+   * @param s
+   * @return parsed Priority from String s
+   * @see RangeConf#parseValue(String)
+   */
   @Override
   protected Priority parseValue(String s) {
     return Priority.valueOf(s);
   }
 
+  /**
+   * Default value is "NORMAL". Which implies {@link #get(Comparable)} will always return Priotity.NORMAL
+   * @return "NORMAL"
+   */
   @Override
   protected String getDefaultConf() {
     return Priority.NORMAL.toString();

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server-api/src/main/java/org/apache/lens/server/api/priority/QueryPriorityDecider.java
----------------------------------------------------------------------
diff --git a/lens-server-api/src/main/java/org/apache/lens/server/api/priority/QueryPriorityDecider.java b/lens-server-api/src/main/java/org/apache/lens/server/api/priority/QueryPriorityDecider.java
index 5fb0bda..9a3b2f2 100644
--- a/lens-server-api/src/main/java/org/apache/lens/server/api/priority/QueryPriorityDecider.java
+++ b/lens-server-api/src/main/java/org/apache/lens/server/api/priority/QueryPriorityDecider.java
@@ -24,7 +24,14 @@ import org.apache.lens.server.api.query.AbstractQueryContext;
 import org.apache.log4j.Logger;
 
 public interface QueryPriorityDecider {
-
+  /** The Constant LOG. */
   public static final Logger LOG = Logger.getLogger(QueryPriorityDecider.class);
+
+  /**
+   *
+   * @param queryContext
+   * @return calculated Priority based on the explained plans for each driver
+   * @throws LensException when can't decide priority.
+   */
   public Priority decidePriority(AbstractQueryContext queryContext) throws LensException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server-api/src/main/java/org/apache/lens/server/api/priority/RangeConf.java
----------------------------------------------------------------------
diff --git a/lens-server-api/src/main/java/org/apache/lens/server/api/priority/RangeConf.java b/lens-server-api/src/main/java/org/apache/lens/server/api/priority/RangeConf.java
index c999fee..71303f8 100644
--- a/lens-server-api/src/main/java/org/apache/lens/server/api/priority/RangeConf.java
+++ b/lens-server-api/src/main/java/org/apache/lens/server/api/priority/RangeConf.java
@@ -24,9 +24,42 @@ import org.apache.lens.server.api.LensConfConstants;
 
 import java.util.TreeMap;
 
+/**
+ * Class for storing range configurations. An Example would be grading system.
+ * The value F,30,D,40,C,60,B,80,A corresponds to a system where
+ *    - inf < marks <= 30         : F
+ *    30 < marks <= 40            : D
+ *    40 < marks <= 60            : C
+ *    60 < marks <= 80            : B
+ *    80 < marks <= + Inf         : A
+ *
+ * rangeConfInstance.get(marks) would give you the grade depending on the range.
+ *
+ * The utility is for easily storing range configs in config xml files.
+ *
+ * Implementation is done by storing the least value(floor) and keeping a treemap on rest of values
+ *
+ * @param <K> Key type. Integer in the grade range example
+ * @param <V> Value Type. String(or a Grade class) in the grade range example
+ */
+
 public abstract class RangeConf<K extends Comparable<K>, V> {
+
+  /**
+   * The data structure is one map and one floor value
+   *
+   */
+
+  /** Treemap of lower boundary value and next grade */
   TreeMap<K, V> map = new TreeMap<K, V>();
+
+  /** Lowest boundary value. */
   V floor;
+
+  /**
+   * Constructor. parses the string to form the data structure.
+   * @param confValue
+   */
   RangeConf(String confValue) {
     if(confValue == null || confValue.isEmpty()) {
       confValue = getDefaultConf();
@@ -38,22 +71,27 @@ public abstract class RangeConf<K extends Comparable<K>, V> {
       map.put(parseKey(split[i]), parseValue(split[i + 1]));
     }
   }
-
+  /** parse key type from its string representation */
   protected abstract K parseKey(String s);
+  /** parse value type from its string representation */
   protected abstract V parseValue(String s);
+
+  /** When null/blank conf string passed, this would be the value from which data structure will be formed */
   protected abstract String getDefaultConf();
+
+  /**
+   * Get method.
+   * @param key
+   * @return the value depending on which range the key lies in
+   */
   public V get(K key) {
     return map.floorEntry(key) == null ? floor : map.floorEntry(key).getValue();
   }
-  static String getFirstNonNullValueFromConf(Configuration conf, String... keys) {
-    for (String key: keys){
-      if(conf.get(key) != null) {
-        return conf.get(key);
-      }
-    }
-    return null;
-  }
 
+  /**
+   * toString representation
+   * @return string representation
+   */
   @Override
   public String toString() {
     return "lower value: " + floor + ", map: " + map;

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server-api/src/main/java/org/apache/lens/server/api/query/AbstractQueryContext.java
----------------------------------------------------------------------
diff --git a/lens-server-api/src/main/java/org/apache/lens/server/api/query/AbstractQueryContext.java b/lens-server-api/src/main/java/org/apache/lens/server/api/query/AbstractQueryContext.java
index 72a893c..0b3e976 100644
--- a/lens-server-api/src/main/java/org/apache/lens/server/api/query/AbstractQueryContext.java
+++ b/lens-server-api/src/main/java/org/apache/lens/server/api/query/AbstractQueryContext.java
@@ -26,6 +26,7 @@ import org.apache.lens.api.LensConf;
 import java.io.Serializable;
 
 public abstract class AbstractQueryContext extends DriverSelectorQueryContext implements Serializable {
+  /** The Constant LOG */
   public static final Log LOG = LogFactory.getLog(AbstractQueryContext.class);
 
   /** The user query. */

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server-api/src/main/java/org/apache/lens/server/api/query/DriverSelectorQueryContext.java
----------------------------------------------------------------------
diff --git a/lens-server-api/src/main/java/org/apache/lens/server/api/query/DriverSelectorQueryContext.java b/lens-server-api/src/main/java/org/apache/lens/server/api/query/DriverSelectorQueryContext.java
index 6847162..0098a1a 100644
--- a/lens-server-api/src/main/java/org/apache/lens/server/api/query/DriverSelectorQueryContext.java
+++ b/lens-server-api/src/main/java/org/apache/lens/server/api/query/DriverSelectorQueryContext.java
@@ -31,6 +31,8 @@ import java.util.HashMap;
 import java.util.Map;
 
 public abstract class DriverSelectorQueryContext {
+
+  /** The constant LOG */
   public static final Log LOG = LogFactory.getLog(DriverSelectorQueryContext.class);
 
   /** The conf. */
@@ -46,15 +48,24 @@ public abstract class DriverSelectorQueryContext {
   @Getter
   @Setter
   protected String driverQuery;
-
+  /** Map of driver to driver query */
   @Getter
   protected Map<LensDriver, String> driverQueries;
 
+  /** Map of driver to query plan */
   @Getter
   protected Map<LensDriver, DriverQueryPlan> driverQueryPlans;
 
+  /** Map of exceptions occurred while trying to generate plans by explain call */
   protected Map<LensDriver, Exception> driverQueryPlanGenerationErrors;
 
+  /**
+   * Sets driver queries, generates plans for each driver by calling explain with respective queries,
+   * Sets driverQueryPlans
+   * @param driverQueries
+   * @throws LensException
+   * @see #driverQueryPlans
+   */
   public void setDriverQueriesAndPlans(Map<LensDriver, String> driverQueries) throws LensException {
     driverQueryPlanGenerationErrors = new HashMap<LensDriver, Exception>();
     this.driverQueries = driverQueries;
@@ -71,6 +82,11 @@ public abstract class DriverSelectorQueryContext {
     }
   }
 
+  /**
+   * Return selected driver's query plan, but check for null conditions first.
+   * @return DriverQueryPlan of Selected Driver
+   * @throws LensException
+   */
   public DriverQueryPlan getSelectedDriverQueryPlan() throws LensException {
     if(getDriverQueryPlans() == null) {
       throw new LensException("No Driver query plans. Check if re-write happened or not");

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server-api/src/main/java/org/apache/lens/server/api/query/ExplainQueryContext.java
----------------------------------------------------------------------
diff --git a/lens-server-api/src/main/java/org/apache/lens/server/api/query/ExplainQueryContext.java b/lens-server-api/src/main/java/org/apache/lens/server/api/query/ExplainQueryContext.java
index 86fd727..e248437 100644
--- a/lens-server-api/src/main/java/org/apache/lens/server/api/query/ExplainQueryContext.java
+++ b/lens-server-api/src/main/java/org/apache/lens/server/api/query/ExplainQueryContext.java
@@ -20,7 +20,15 @@ package org.apache.lens.server.api.query;
 
 import org.apache.hadoop.conf.Configuration;
 
+/**
+ * The class ExplainQueryContext
+ */
 public class ExplainQueryContext extends AbstractQueryContext{
+  /**
+   * Constructor. Only needs user query and conf.
+   * @param query
+   * @param qconf
+   */
   public ExplainQueryContext(String query, Configuration qconf) {
     userQuery = query;
     conf = qconf;

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
----------------------------------------------------------------------
diff --git a/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java b/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
index c2c5810..a3144f0 100644
--- a/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
+++ b/lens-server/src/main/java/org/apache/lens/server/query/QueryExecutionServiceImpl.java
@@ -919,7 +919,6 @@ public class QueryExecutionServiceImpl extends LensService implements QueryExecu
     LensDriver driver = driverSelector.select(ctx, conf);
 
     ctx.setSelectedDriver(driver);
-    //TODO: remove this. Note the Redundancy. 
     ctx.setDriverQuery(ctx.getDriverQueries().get(ctx.getSelectedDriver()));
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/lens-server/src/test/java/org/apache/lens/server/query/TestQueryService.java
----------------------------------------------------------------------
diff --git a/lens-server/src/test/java/org/apache/lens/server/query/TestQueryService.java b/lens-server/src/test/java/org/apache/lens/server/query/TestQueryService.java
index fc10723..8334d95 100644
--- a/lens-server/src/test/java/org/apache/lens/server/query/TestQueryService.java
+++ b/lens-server/src/test/java/org/apache/lens/server/query/TestQueryService.java
@@ -344,9 +344,9 @@ public class TestQueryService extends LensJerseyTest {
       Thread.sleep(1000);
     }
     assertTrue(ctx.getSubmissionTime() > 0);
-//    assertTrue(ctx.getLaunchTime() > 0);
-//    assertTrue(ctx.getDriverStartTime() > 0);
-//    assertTrue(ctx.getDriverFinishTime() > 0);
+    assertTrue(ctx.getLaunchTime() > 0);
+    assertTrue(ctx.getDriverStartTime() > 0);
+    assertTrue(ctx.getDriverFinishTime() > 0);
     assertTrue(ctx.getFinishTime() > 0);
     Assert.assertEquals(ctx.getStatus().getStatus(), QueryStatus.Status.FAILED);
 

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/src/site/apt/admin/config.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/admin/config.apt b/src/site/apt/admin/config.apt
index abaf2dc..e982b07 100644
--- a/src/site/apt/admin/config.apt
+++ b/src/site/apt/admin/config.apt
@@ -174,7 +174,7 @@ Lens server configuration
 *--+--+---+--+
 |75|lens.server.user.resolver.ldap.url| |Required for LDAP_BACKED_DATABASE user resolvers.      ldap url to connect to.|
 *--+--+---+--+
-|76|lens.server.user.resolver.propertybased.filename|/path/to/propertyfile|Required for PROPERTYBASED user resolver.      when lens.server.user.resolver.type is PROPERTYBASED, then this file will be read and parsed to      determine cluster user. example schema of the file is:      user1, user2, user3 = clusteruser1      user4, user5 = clusteruser2      * = clusteruser3  |
+|76|lens.server.user.resolver.propertybased.filename|/path/to/propertyfile|Required for PROPERTYBASED user resolver.      when lens.server.user.resolver.type is PROPERTYBASED, then this file will be read and parsed to      determine cluster user. Each line should contain username followed by DOT followed by property full name      followed by equal-to sign and followed by value.      example schema of the file is:      user1.lens.server.cluster.user=clusteruser1      user1.mapred.job.queue.name=queue1      *.lens.server.cluster.user=defaultclusteruser      *.mapred.job.queue.name=default  |
 *--+--+---+--+
 |77|lens.server.user.resolver.type|FIXED|Type of user config resolver. allowed values are FIXED, PROPERTYBASED, DATABASE, LDAP_BACKED_DATABASE, CUSTOM.|
 *--+--+---+--+

http://git-wip-us.apache.org/repos/asf/incubator-lens/blob/403cb7d0/src/site/apt/admin/hivedriver-config.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/admin/hivedriver-config.apt b/src/site/apt/admin/hivedriver-config.apt
index 30b53bc..f59faab 100644
--- a/src/site/apt/admin/hivedriver-config.apt
+++ b/src/site/apt/admin/hivedriver-config.apt
@@ -44,8 +44,16 @@ Hive driver configuration
 *--+--+---+--+
 |10|lens.cube.query.replace.timedim|true|Tells whether timedim attribute queried in the time range should be replaced with its corresponding partition column name.|
 *--+--+---+--+
-|11|lens.driver.hive.connection.class|org.apache.lens.driver.hive.EmbeddedThriftConnection|The connection class from HiveDriver to HiveServer. The default is   an embedded connection which does not require a remote hive server.   For connecting to a hiveserver end point, remote connection should be used.   The possible values are org.apache.lens.driver.hive.EmbeddedThriftConnection   and org.apache.lens.driver.hive.RemoteThriftConnection. |
+|11|lens.driver.hive.calculate.priority|true|Whether priority should be calculated for hive mr jobs or not|
 *--+--+---+--+
-|12|lens.driver.hive.hs2.connection.expiry.delay|600000|The idle time (in milliseconds) for expiring connection from hivedriver to HiveServer2|
+|12|lens.driver.hive.connection.class|org.apache.lens.driver.hive.EmbeddedThriftConnection|The connection class from HiveDriver to HiveServer. The default is   an embedded connection which does not require a remote hive server.   For connecting to a hiveserver end point, remote connection should be used.   The possible values are org.apache.lens.driver.hive.EmbeddedThriftConnection   and org.apache.lens.driver.hive.RemoteThriftConnection. |
+*--+--+---+--+
+|13|lens.driver.hive.hs2.connection.expiry.delay|600000|The idle time (in milliseconds) for expiring connection from hivedriver to HiveServer2|
+*--+--+---+--+
+|14|lens.driver.hive.priority.partition.weight.daily|0.75|Weight of monthly partition in cost calculation|
+*--+--+---+--+
+|15|lens.driver.hive.priority.partition.weight.hourly|1.0|Weight of monthly partition in cost calculation|
+*--+--+---+--+
+|16|lens.driver.hive.priority.partition.weight.monthly|0.5|Weight of monthly partition in cost calculation|
 *--+--+---+--+
 The configuration parameters and their default values