Repository: drill
Updated Branches:
  refs/heads/master a03f5429e -> bbc422404


http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/exec/java-exec/src/main/java/org/apache/drill/exec/work/user/PlanSplitter.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/work/user/PlanSplitter.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/work/user/PlanSplitter.java
index 2f945d8..29b3580 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/work/user/PlanSplitter.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/work/user/PlanSplitter.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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
@@ -35,9 +35,9 @@ import 
org.apache.drill.exec.proto.UserProtos.GetQueryPlanFragments;
 import org.apache.drill.exec.proto.UserProtos.QueryPlanFragments;
 import org.apache.drill.exec.rpc.UserClientConnection;
 import org.apache.drill.exec.server.DrillbitContext;
-import org.apache.drill.exec.util.MemoryAllocationUtilities;
 import org.apache.drill.exec.util.Pointer;
 import org.apache.drill.exec.work.QueryWorkUnit;
+import org.apache.drill.exec.work.foreman.rm.QueryResourceAllocator;
 
 import com.google.common.collect.Lists;
 
@@ -60,6 +60,7 @@ public class PlanSplitter {
    * @param connection
    * @return
    */
+  @SuppressWarnings("resource")
   public QueryPlanFragments planFragments(DrillbitContext dContext, QueryId 
queryId,
       GetQueryPlanFragments req, UserClientConnection connection) {
     QueryPlanFragments.Builder responseBuilder = 
QueryPlanFragments.newBuilder();
@@ -97,7 +98,8 @@ public class PlanSplitter {
       throw new IllegalStateException("Planning fragments supports only SQL or 
PHYSICAL QueryType");
     }
 
-    MemoryAllocationUtilities.setupBufferedOpsMemoryAllocations(plan, 
queryContext);
+    QueryResourceAllocator planner = 
dContext.getResourceManager().newResourceAllocator(queryContext);
+    planner.visitAbstractPlan(plan);
 
     final PhysicalOperator rootOperator = 
plan.getSortedOperators(false).iterator().next();
 
@@ -113,6 +115,8 @@ public class PlanSplitter {
           queryContext.getSession(), queryContext.getQueryContextInfo());
 
       for (QueryWorkUnit queryWorkUnit : queryWorkUnits) {
+        planner.visitPhysicalPlan(queryWorkUnit);
+        queryWorkUnit.applyPlan(dContext.getPlanReader());
         fragments.add(queryWorkUnit.getRootFragment());
 
         List<PlanFragment> childFragments = queryWorkUnit.getFragments();
@@ -122,8 +126,10 @@ public class PlanSplitter {
       }
     } else {
       final QueryWorkUnit queryWorkUnit = 
parallelizer.getFragments(queryContext.getOptions().getOptionList(), 
queryContext.getCurrentEndpoint(),
-          queryId, queryContext.getActiveEndpoints(), 
dContext.getPlanReader(), rootFragment,
+          queryId, queryContext.getActiveEndpoints(), rootFragment,
           queryContext.getSession(), queryContext.getQueryContextInfo());
+      planner.visitPhysicalPlan(queryWorkUnit);
+      queryWorkUnit.applyPlan(dContext.getPlanReader());
       fragments.add(queryWorkUnit.getRootFragment());
       fragments.addAll(queryWorkUnit.getFragments());
     }

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/exec/java-exec/src/main/resources/drill-module.conf
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/drill-module.conf 
b/exec/java-exec/src/main/resources/drill-module.conf
index 836b297..7ebdd5a 100644
--- a/exec/java-exec/src/main/resources/drill-module.conf
+++ b/exec/java-exec/src/main/resources/drill-module.conf
@@ -286,6 +286,19 @@ drill.exec: {
       }
     }
   },
+  queue : {
+    // Settings for the local query queue available for embedded drillbits.
+    embedded : {
+      // Enable the local query queue
+      enable: false,
+      // Maximum number of queries that can run simultaneously.
+      // All others queue.
+      size: 2,
+      // Maximum wait time in the queue before the query times out and
+      // fails.
+      timeout: 5000 // 5 seconds
+    }
+  }
   memory: {
     operator: {
       max: 20000000000,
@@ -334,6 +347,20 @@ drill.exec: {
   # Full workspace name should be indicated (including schema and workspace 
separated by dot).
   # Workspace MUST be file-based and writable. Workspace name is 
case-sensitive.
   default_temporary_workspace: "dfs.tmp"
+
+  // Resource management
+  rm : {
+    // Memory per node normally comes from the direct memory alloated on the 
JVM
+    // command line. This parameter, if other than 0, further limits the 
amount.
+    // Primarily for testing.
+    memory_per_node: 0,
+    // The number of available CPUs normally comes directly from the system 
itself.
+    // This parameter, if other than 0, further limits the number of CPUs will
+    // will consider when planning. Note that, sadly, this parameter does not
+    // limit *actual* CPU usage; only the amount of CPU assumed to exist when
+    // planning and managing queries. Primarily for testing.
+    cpus_per_node: 0,
+  }
 }
 
 drill.jdbc: {
@@ -392,10 +419,15 @@ drill.exec.options:  {
     exec.query_profile.debug_mode: false,
     exec.query_profile.save: true,
     exec.queue.enable: false,
-    exec.queue.large: 10,
-    exec.queue.small: 100,
+    # Default queue values for an 8 GB direct memory default
+    # Drill install. Users are expected to adjust these based
+    # on load and available resources.
+    exec.queue.large: 2,
+    exec.queue.small: 4,
     exec.queue.threshold: 30000000,
     exec.queue.timeout_millis: 300000,
+    exec.queue.memory_ratio: 10.0,
+    exec.queue.memory_reserve_ratio: 0.2,
     exec.sort.disable_managed : false,
     exec.storage.enable_new_text_reader: true,
     exec.udf.enable_dynamic_support: true,

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/exec/java-exec/src/main/resources/rest/index.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/index.ftl 
b/exec/java-exec/src/main/resources/rest/index.ftl
index d1aa844..04effba 100644
--- a/exec/java-exec/src/main/resources/rest/index.ftl
+++ b/exec/java-exec/src/main/resources/rest/index.ftl
@@ -11,6 +11,11 @@
 
 <#include "*/generic.ftl">
 <#macro page_head>
+<style>
+.list-value {
+    text-align: right !important;
+}
+</style>
 </#macro>
 
 <#macro page_body>
@@ -74,23 +79,66 @@
 
   <div class="row">
       <div class="col-md-12">
-        <h3>Encryption Info <span class="label label-primary"></span></h3>
+        <h3>Encryption</h3>
         <div class="table-responsive">
-          <table class="table table-hover">
+          <table class="table table-hover" style="width: auto;">
             <tbody>
                 <tr>
-                  <td>Client to Bit Encryption:</td>
-                  <td>${model.isUserEncryptionEnabled()?string("enabled", 
"disabled")}</td>
+                  <td>Client to Bit Encryption</td>
+                  <td 
class="list-value">${model.isUserEncryptionEnabled()?string("Enabled", 
"Disabled")}</td>
                 </tr>
                 <tr>
-                  <td>Bit to Bit Encryption:</td>
-                  <td>${model.isBitEncryptionEnabled()?string("enabled", 
"disabled")}</td>
+                  <td>Bit to Bit Encryption</td>
+                  <td 
class="list-value">${model.isBitEncryptionEnabled()?string("Enabled", 
"Disabled")}</td>
                 </tr>
             </tbody>
           </table>
         </div>
       </div>
   </div>
+
+  <#assign queueInfo = model.queueInfo() />
+  <div class="row">
+      <div class="col-md-12">
+        <h3>Query Throttling</h3>
+        <div class="table-responsive">
+          <table class="table table-hover" style="width: auto;">
+            <tbody>
+               <tr>
+                  <td>Queue Status</td>
+                  <td 
class="list-value">${queueInfo.isEnabled()?string("Enabled", "Disabled")}</td>
+                </tr>
+  <#if queueInfo.isEnabled() >
+                <tr>
+                  <td>Maximum Concurrent "Small" Queries</td>
+                  <td class="list-value">${queueInfo.smallQueueSize()}</td>
+                 </tr>
+                 <tr>
+                  <td>Maximum Concurrent "Large" Queries</td>
+                  <td class="list-value">${queueInfo.largeQueueSize()}</td>
+                </tr>
+                  <tr>
+                  <td>Cost Threshhold for Large vs. Small Queries</td>
+                  <td class="list-value">${queueInfo.threshold()}</td>
+                </tr>
+                <tr>
+                  <td>Total Memory</td>
+                  <td class="list-value">${queueInfo.totalMemory()}</td>
+                </tr>
+                <tr>
+                  <td>Memory per Small Query</td>
+                  <td class="list-value">${queueInfo.smallQueueMemory()}</td>
+                </tr>
+                <tr>
+                  <td>Memory per Large Query</td>
+                  <td class="list-value">${queueInfo.largeQueueMemory()}</td>
+                </tr>
+  </#if>
+            </tbody>
+          </table>
+        </div>
+      </div>
+  </div>
 </#macro>
 
 <@page_html/>

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/exec/java-exec/src/main/resources/rest/profile/profile.ftl
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/resources/rest/profile/profile.ftl 
b/exec/java-exec/src/main/resources/rest/profile/profile.ftl
index 468297e..889e17a 100644
--- a/exec/java-exec/src/main/resources/rest/profile/profile.ftl
+++ b/exec/java-exec/src/main/resources/rest/profile/profile.ftl
@@ -133,6 +133,8 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
 
   </div>
 
+  <#assign queueName = model.getProfile().getQueueName() />
+  <#assign queued = queueName != "" && queueName != "-" />
   <div class="page-header"></div>
   <h3>Query Profile</h3>
   <div class="panel-group" id="query-profile-accordion">
@@ -152,6 +154,10 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
                 <th>State</th>
                 <th>Foreman</th>
                 <th>Total Fragments</th>
+     <#if queued>
+                <th>Total Cost</th>
+                <th>Queue</th>
+     </#if>
             </tr>
             </thead>
             <tbody>
@@ -159,12 +165,17 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
                   <td>${model.getProfile().getState().name()}</td>
                   <td>${model.getProfile().getForeman().getAddress()}</td>
                   <td>${model.getProfile().getTotalFragments()}</td>
+     <#if queued>
+                  <td>${model.getProfile().getTotalCost()}</td>
+                  <td>${queueName}</td>
+     </#if>
               </tr>
             </tbody>
           </table>
         </div>
       </div>
     </div>
+
     <div class="panel panel-default">
       <div class="panel-heading">
         <h4 class="panel-title">
@@ -179,7 +190,9 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
             <thead>
               <tr>
                 <th>Planning</th>
+     <#if queued>
                 <th>Queued</th>
+     </#if>
                 <th>Execution</th>
                 <th>Total</th>
               </tr>
@@ -187,7 +200,9 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
             <tbody>
               <tr>
                 <td>${model.getPlanningDuration()}</td>
+     <#if queued>
                 <td>${model.getQueuedDuration()}</td>
+     </#if>
                 <td>${model.getExecutionDuration()}</td>
                 <td>${model.getProfileDuration()}</td>
               </tr>

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestLocalExchange.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestLocalExchange.java
 
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestLocalExchange.java
index 6b28a7c..f712930 100644
--- 
a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestLocalExchange.java
+++ 
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/TestLocalExchange.java
@@ -410,7 +410,8 @@ public class TestLocalExchange extends PlanTestBase {
     final QueryContextInformation queryContextInfo = 
Utilities.createQueryContextInfo("dummySchemaName", 
"938ea2d9-7cb9-4baf-9414-a5a0b7777e8e");
     QueryWorkUnit qwu = PARALLELIZER.getFragments(new OptionList(), 
drillbitContext.getEndpoint(),
         QueryId.getDefaultInstance(),
-        drillbitContext.getBits(), planReader, rootFragment, USER_SESSION, 
queryContextInfo);
+        drillbitContext.getBits(), rootFragment, USER_SESSION, 
queryContextInfo);
+    qwu.applyPlan(planReader);
 
     // Make sure the number of minor fragments with HashPartitioner within a 
major fragment is not more than the
     // number of Drillbits in cluster

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/partitionsender/TestPartitionSender.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/partitionsender/TestPartitionSender.java
 
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/partitionsender/TestPartitionSender.java
index 91d41e6..e35fba7 100644
--- 
a/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/partitionsender/TestPartitionSender.java
+++ 
b/exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/partitionsender/TestPartitionSender.java
@@ -223,7 +223,8 @@ public class TestPartitionSender extends PlanTestBase {
     final QueryContextInformation queryContextInfo = 
Utilities.createQueryContextInfo("dummySchemaName", 
"938ea2d9-7cb9-4baf-9414-a5a0b7777e8e");
     final QueryWorkUnit qwu = PARALLELIZER.getFragments(options, 
drillbitContext.getEndpoint(),
         QueryId.getDefaultInstance(),
-        drillbitContext.getBits(), planReader, rootFragment, USER_SESSION, 
queryContextInfo);
+        drillbitContext.getBits(), rootFragment, USER_SESSION, 
queryContextInfo);
+    qwu.applyPlan(planReader);
 
     final List<MinorFragmentEndpoint> mfEndPoints = 
PhysicalOperatorUtil.getIndexOrderedEndpoints(Lists.newArrayList(drillbitContext.getBits()));
 

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java
 
b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java
index 59d3c78..4c1f046 100644
--- 
a/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java
+++ 
b/exec/java-exec/src/test/java/org/apache/drill/exec/pop/TestFragmentChecker.java
@@ -66,9 +66,10 @@ public class TestFragmentChecker extends PopUnitTestBase{
     }
 
     final QueryContextInformation queryContextInfo = 
Utilities.createQueryContextInfo("dummySchemaName", 
"938ea2d9-7cb9-4baf-9414-a5a0b7777e8e");
-    QueryWorkUnit qwu = par.getFragments(new OptionList(), localBit, 
QueryId.getDefaultInstance(), endpoints, ppr, fragmentRoot,
+    QueryWorkUnit qwu = par.getFragments(new OptionList(), localBit, 
QueryId.getDefaultInstance(), endpoints, fragmentRoot,
         
UserSession.Builder.newBuilder().withCredentials(UserBitShared.UserCredentials.newBuilder().setUserName("foo").build()).build(),
         queryContextInfo);
+    qwu.applyPlan(ppr);
     System.out.println(String.format("=========ROOT FRAGMENT [%d:%d] 
=========", qwu.getRootFragment().getHandle().getMajorFragmentId(), 
qwu.getRootFragment().getHandle().getMinorFragmentId()));
 
     System.out.print(qwu.getRootFragment().getFragmentJson());

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserBitShared.java
----------------------------------------------------------------------
diff --git 
a/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserBitShared.java 
b/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserBitShared.java
index 21c2589..79755db 100644
--- 
a/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserBitShared.java
+++ 
b/protocol/src/main/java/org/apache/drill/exec/proto/SchemaUserBitShared.java
@@ -1618,6 +1618,10 @@ public final class SchemaUserBitShared
 
                 if(message.hasOptionsJson())
                     output.writeString(6, message.getOptionsJson(), false);
+                if(message.hasTotalCost())
+                    output.writeDouble(7, message.getTotalCost(), false);
+                if(message.hasQueueName())
+                    output.writeString(8, message.getQueueName(), false);
             }
             public boolean 
isInitialized(org.apache.drill.exec.proto.UserBitShared.QueryInfo message)
             {
@@ -1676,6 +1680,12 @@ public final class SchemaUserBitShared
                         case 6:
                             builder.setOptionsJson(input.readString());
                             break;
+                        case 7:
+                            builder.setTotalCost(input.readDouble());
+                            break;
+                        case 8:
+                            builder.setQueueName(input.readString());
+                            break;
                         default:
                             input.handleUnknownField(number, this);
                     }
@@ -1722,6 +1732,8 @@ public final class SchemaUserBitShared
                 case 4: return "user";
                 case 5: return "foreman";
                 case 6: return "optionsJson";
+                case 7: return "totalCost";
+                case 8: return "queueName";
                 default: return null;
             }
         }
@@ -1739,6 +1751,8 @@ public final class SchemaUserBitShared
             fieldMap.put("user", 4);
             fieldMap.put("foreman", 5);
             fieldMap.put("optionsJson", 6);
+            fieldMap.put("totalCost", 7);
+            fieldMap.put("queueName", 8);
         }
     }
 
@@ -1794,6 +1808,10 @@ public final class SchemaUserBitShared
                     output.writeInt64(18, message.getPlanEnd(), false);
                 if(message.hasQueueWaitEnd())
                     output.writeInt64(19, message.getQueueWaitEnd(), false);
+                if(message.hasTotalCost())
+                    output.writeDouble(20, message.getTotalCost(), false);
+                if(message.hasQueueName())
+                    output.writeString(21, message.getQueueName(), false);
             }
             public boolean 
isInitialized(org.apache.drill.exec.proto.UserBitShared.QueryProfile message)
             {
@@ -1893,6 +1911,12 @@ public final class SchemaUserBitShared
                         case 19:
                             builder.setQueueWaitEnd(input.readInt64());
                             break;
+                        case 20:
+                            builder.setTotalCost(input.readDouble());
+                            break;
+                        case 21:
+                            builder.setQueueName(input.readString());
+                            break;
                         default:
                             input.handleUnknownField(number, this);
                     }
@@ -1952,6 +1976,8 @@ public final class SchemaUserBitShared
                 case 17: return "optionsJson";
                 case 18: return "planEnd";
                 case 19: return "queueWaitEnd";
+                case 20: return "totalCost";
+                case 21: return "queueName";
                 default: return null;
             }
         }
@@ -1982,6 +2008,8 @@ public final class SchemaUserBitShared
             fieldMap.put("optionsJson", 17);
             fieldMap.put("planEnd", 18);
             fieldMap.put("queueWaitEnd", 19);
+            fieldMap.put("totalCost", 20);
+            fieldMap.put("queueName", 21);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
----------------------------------------------------------------------
diff --git 
a/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java 
b/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
index bf38dce..9a3b1d9 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java
@@ -12140,6 +12140,31 @@ public final class UserBitShared {
      */
     com.google.protobuf.ByteString
         getOptionsJsonBytes();
+
+    // optional double total_cost = 7;
+    /**
+     * <code>optional double total_cost = 7;</code>
+     */
+    boolean hasTotalCost();
+    /**
+     * <code>optional double total_cost = 7;</code>
+     */
+    double getTotalCost();
+
+    // optional string queue_name = 8 [default = "-"];
+    /**
+     * <code>optional string queue_name = 8 [default = "-"];</code>
+     */
+    boolean hasQueueName();
+    /**
+     * <code>optional string queue_name = 8 [default = "-"];</code>
+     */
+    java.lang.String getQueueName();
+    /**
+     * <code>optional string queue_name = 8 [default = "-"];</code>
+     */
+    com.google.protobuf.ByteString
+        getQueueNameBytes();
   }
   /**
    * Protobuf type {@code exec.shared.QueryInfo}
@@ -12236,6 +12261,16 @@ public final class UserBitShared {
               optionsJson_ = input.readBytes();
               break;
             }
+            case 57: {
+              bitField0_ |= 0x00000040;
+              totalCost_ = input.readDouble();
+              break;
+            }
+            case 66: {
+              bitField0_ |= 0x00000080;
+              queueName_ = input.readBytes();
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -12459,6 +12494,65 @@ public final class UserBitShared {
       }
     }
 
+    // optional double total_cost = 7;
+    public static final int TOTAL_COST_FIELD_NUMBER = 7;
+    private double totalCost_;
+    /**
+     * <code>optional double total_cost = 7;</code>
+     */
+    public boolean hasTotalCost() {
+      return ((bitField0_ & 0x00000040) == 0x00000040);
+    }
+    /**
+     * <code>optional double total_cost = 7;</code>
+     */
+    public double getTotalCost() {
+      return totalCost_;
+    }
+
+    // optional string queue_name = 8 [default = "-"];
+    public static final int QUEUE_NAME_FIELD_NUMBER = 8;
+    private java.lang.Object queueName_;
+    /**
+     * <code>optional string queue_name = 8 [default = "-"];</code>
+     */
+    public boolean hasQueueName() {
+      return ((bitField0_ & 0x00000080) == 0x00000080);
+    }
+    /**
+     * <code>optional string queue_name = 8 [default = "-"];</code>
+     */
+    public java.lang.String getQueueName() {
+      java.lang.Object ref = queueName_;
+      if (ref instanceof java.lang.String) {
+        return (java.lang.String) ref;
+      } else {
+        com.google.protobuf.ByteString bs = 
+            (com.google.protobuf.ByteString) ref;
+        java.lang.String s = bs.toStringUtf8();
+        if (bs.isValidUtf8()) {
+          queueName_ = s;
+        }
+        return s;
+      }
+    }
+    /**
+     * <code>optional string queue_name = 8 [default = "-"];</code>
+     */
+    public com.google.protobuf.ByteString
+        getQueueNameBytes() {
+      java.lang.Object ref = queueName_;
+      if (ref instanceof java.lang.String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (java.lang.String) ref);
+        queueName_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+
     private void initFields() {
       query_ = "";
       start_ = 0L;
@@ -12466,6 +12560,8 @@ public final class UserBitShared {
       user_ = "-";
       foreman_ = 
org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint.getDefaultInstance();
       optionsJson_ = "";
+      totalCost_ = 0D;
+      queueName_ = "-";
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -12497,6 +12593,12 @@ public final class UserBitShared {
       if (((bitField0_ & 0x00000020) == 0x00000020)) {
         output.writeBytes(6, getOptionsJsonBytes());
       }
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        output.writeDouble(7, totalCost_);
+      }
+      if (((bitField0_ & 0x00000080) == 0x00000080)) {
+        output.writeBytes(8, getQueueNameBytes());
+      }
       getUnknownFields().writeTo(output);
     }
 
@@ -12530,6 +12632,14 @@ public final class UserBitShared {
         size += com.google.protobuf.CodedOutputStream
           .computeBytesSize(6, getOptionsJsonBytes());
       }
+      if (((bitField0_ & 0x00000040) == 0x00000040)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeDoubleSize(7, totalCost_);
+      }
+      if (((bitField0_ & 0x00000080) == 0x00000080)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBytesSize(8, getQueueNameBytes());
+      }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
@@ -12663,6 +12773,10 @@ public final class UserBitShared {
         bitField0_ = (bitField0_ & ~0x00000010);
         optionsJson_ = "";
         bitField0_ = (bitField0_ & ~0x00000020);
+        totalCost_ = 0D;
+        bitField0_ = (bitField0_ & ~0x00000040);
+        queueName_ = "-";
+        bitField0_ = (bitField0_ & ~0x00000080);
         return this;
       }
 
@@ -12719,6 +12833,14 @@ public final class UserBitShared {
           to_bitField0_ |= 0x00000020;
         }
         result.optionsJson_ = optionsJson_;
+        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
+          to_bitField0_ |= 0x00000040;
+        }
+        result.totalCost_ = totalCost_;
+        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
+          to_bitField0_ |= 0x00000080;
+        }
+        result.queueName_ = queueName_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -12759,6 +12881,14 @@ public final class UserBitShared {
           optionsJson_ = other.optionsJson_;
           onChanged();
         }
+        if (other.hasTotalCost()) {
+          setTotalCost(other.getTotalCost());
+        }
+        if (other.hasQueueName()) {
+          bitField0_ |= 0x00000080;
+          queueName_ = other.queueName_;
+          onChanged();
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
@@ -13194,6 +13324,113 @@ public final class UserBitShared {
         return this;
       }
 
+      // optional double total_cost = 7;
+      private double totalCost_ ;
+      /**
+       * <code>optional double total_cost = 7;</code>
+       */
+      public boolean hasTotalCost() {
+        return ((bitField0_ & 0x00000040) == 0x00000040);
+      }
+      /**
+       * <code>optional double total_cost = 7;</code>
+       */
+      public double getTotalCost() {
+        return totalCost_;
+      }
+      /**
+       * <code>optional double total_cost = 7;</code>
+       */
+      public Builder setTotalCost(double value) {
+        bitField0_ |= 0x00000040;
+        totalCost_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional double total_cost = 7;</code>
+       */
+      public Builder clearTotalCost() {
+        bitField0_ = (bitField0_ & ~0x00000040);
+        totalCost_ = 0D;
+        onChanged();
+        return this;
+      }
+
+      // optional string queue_name = 8 [default = "-"];
+      private java.lang.Object queueName_ = "-";
+      /**
+       * <code>optional string queue_name = 8 [default = "-"];</code>
+       */
+      public boolean hasQueueName() {
+        return ((bitField0_ & 0x00000080) == 0x00000080);
+      }
+      /**
+       * <code>optional string queue_name = 8 [default = "-"];</code>
+       */
+      public java.lang.String getQueueName() {
+        java.lang.Object ref = queueName_;
+        if (!(ref instanceof java.lang.String)) {
+          java.lang.String s = ((com.google.protobuf.ByteString) ref)
+              .toStringUtf8();
+          queueName_ = s;
+          return s;
+        } else {
+          return (java.lang.String) ref;
+        }
+      }
+      /**
+       * <code>optional string queue_name = 8 [default = "-"];</code>
+       */
+      public com.google.protobuf.ByteString
+          getQueueNameBytes() {
+        java.lang.Object ref = queueName_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (java.lang.String) ref);
+          queueName_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>optional string queue_name = 8 [default = "-"];</code>
+       */
+      public Builder setQueueName(
+          java.lang.String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000080;
+        queueName_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional string queue_name = 8 [default = "-"];</code>
+       */
+      public Builder clearQueueName() {
+        bitField0_ = (bitField0_ & ~0x00000080);
+        queueName_ = getDefaultInstance().getQueueName();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional string queue_name = 8 [default = "-"];</code>
+       */
+      public Builder setQueueNameBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000080;
+        queueName_ = value;
+        onChanged();
+        return this;
+      }
+
       // @@protoc_insertion_point(builder_scope:exec.shared.QueryInfo)
     }
 
@@ -13460,6 +13697,31 @@ public final class UserBitShared {
      * <code>optional int64 queueWaitEnd = 19;</code>
      */
     long getQueueWaitEnd();
+
+    // optional double total_cost = 20;
+    /**
+     * <code>optional double total_cost = 20;</code>
+     */
+    boolean hasTotalCost();
+    /**
+     * <code>optional double total_cost = 20;</code>
+     */
+    double getTotalCost();
+
+    // optional string queue_name = 21 [default = "-"];
+    /**
+     * <code>optional string queue_name = 21 [default = "-"];</code>
+     */
+    boolean hasQueueName();
+    /**
+     * <code>optional string queue_name = 21 [default = "-"];</code>
+     */
+    java.lang.String getQueueName();
+    /**
+     * <code>optional string queue_name = 21 [default = "-"];</code>
+     */
+    com.google.protobuf.ByteString
+        getQueueNameBytes();
   }
   /**
    * Protobuf type {@code exec.shared.QueryProfile}
@@ -13638,6 +13900,16 @@ public final class UserBitShared {
               queueWaitEnd_ = input.readInt64();
               break;
             }
+            case 161: {
+              bitField0_ |= 0x00040000;
+              totalCost_ = input.readDouble();
+              break;
+            }
+            case 170: {
+              bitField0_ |= 0x00080000;
+              queueName_ = input.readBytes();
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -14233,6 +14505,65 @@ public final class UserBitShared {
       return queueWaitEnd_;
     }
 
+    // optional double total_cost = 20;
+    public static final int TOTAL_COST_FIELD_NUMBER = 20;
+    private double totalCost_;
+    /**
+     * <code>optional double total_cost = 20;</code>
+     */
+    public boolean hasTotalCost() {
+      return ((bitField0_ & 0x00040000) == 0x00040000);
+    }
+    /**
+     * <code>optional double total_cost = 20;</code>
+     */
+    public double getTotalCost() {
+      return totalCost_;
+    }
+
+    // optional string queue_name = 21 [default = "-"];
+    public static final int QUEUE_NAME_FIELD_NUMBER = 21;
+    private java.lang.Object queueName_;
+    /**
+     * <code>optional string queue_name = 21 [default = "-"];</code>
+     */
+    public boolean hasQueueName() {
+      return ((bitField0_ & 0x00080000) == 0x00080000);
+    }
+    /**
+     * <code>optional string queue_name = 21 [default = "-"];</code>
+     */
+    public java.lang.String getQueueName() {
+      java.lang.Object ref = queueName_;
+      if (ref instanceof java.lang.String) {
+        return (java.lang.String) ref;
+      } else {
+        com.google.protobuf.ByteString bs = 
+            (com.google.protobuf.ByteString) ref;
+        java.lang.String s = bs.toStringUtf8();
+        if (bs.isValidUtf8()) {
+          queueName_ = s;
+        }
+        return s;
+      }
+    }
+    /**
+     * <code>optional string queue_name = 21 [default = "-"];</code>
+     */
+    public com.google.protobuf.ByteString
+        getQueueNameBytes() {
+      java.lang.Object ref = queueName_;
+      if (ref instanceof java.lang.String) {
+        com.google.protobuf.ByteString b = 
+            com.google.protobuf.ByteString.copyFromUtf8(
+                (java.lang.String) ref);
+        queueName_ = b;
+        return b;
+      } else {
+        return (com.google.protobuf.ByteString) ref;
+      }
+    }
+
     private void initFields() {
       id_ = 
org.apache.drill.exec.proto.UserBitShared.QueryId.getDefaultInstance();
       type_ = org.apache.drill.exec.proto.UserBitShared.QueryType.SQL;
@@ -14253,6 +14584,8 @@ public final class UserBitShared {
       optionsJson_ = "";
       planEnd_ = 0L;
       queueWaitEnd_ = 0L;
+      totalCost_ = 0D;
+      queueName_ = "-";
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -14323,6 +14656,12 @@ public final class UserBitShared {
       if (((bitField0_ & 0x00020000) == 0x00020000)) {
         output.writeInt64(19, queueWaitEnd_);
       }
+      if (((bitField0_ & 0x00040000) == 0x00040000)) {
+        output.writeDouble(20, totalCost_);
+      }
+      if (((bitField0_ & 0x00080000) == 0x00080000)) {
+        output.writeBytes(21, getQueueNameBytes());
+      }
       getUnknownFields().writeTo(output);
     }
 
@@ -14408,6 +14747,14 @@ public final class UserBitShared {
         size += com.google.protobuf.CodedOutputStream
           .computeInt64Size(19, queueWaitEnd_);
       }
+      if (((bitField0_ & 0x00040000) == 0x00040000)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeDoubleSize(20, totalCost_);
+      }
+      if (((bitField0_ & 0x00080000) == 0x00080000)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBytesSize(21, getQueueNameBytes());
+      }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
@@ -14577,6 +14924,10 @@ public final class UserBitShared {
         bitField0_ = (bitField0_ & ~0x00020000);
         queueWaitEnd_ = 0L;
         bitField0_ = (bitField0_ & ~0x00040000);
+        totalCost_ = 0D;
+        bitField0_ = (bitField0_ & ~0x00080000);
+        queueName_ = "-";
+        bitField0_ = (bitField0_ & ~0x00100000);
         return this;
       }
 
@@ -14694,6 +15045,14 @@ public final class UserBitShared {
           to_bitField0_ |= 0x00020000;
         }
         result.queueWaitEnd_ = queueWaitEnd_;
+        if (((from_bitField0_ & 0x00080000) == 0x00080000)) {
+          to_bitField0_ |= 0x00040000;
+        }
+        result.totalCost_ = totalCost_;
+        if (((from_bitField0_ & 0x00100000) == 0x00100000)) {
+          to_bitField0_ |= 0x00080000;
+        }
+        result.queueName_ = queueName_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -14806,6 +15165,14 @@ public final class UserBitShared {
         if (other.hasQueueWaitEnd()) {
           setQueueWaitEnd(other.getQueueWaitEnd());
         }
+        if (other.hasTotalCost()) {
+          setTotalCost(other.getTotalCost());
+        }
+        if (other.hasQueueName()) {
+          bitField0_ |= 0x00100000;
+          queueName_ = other.queueName_;
+          onChanged();
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
@@ -16169,6 +16536,113 @@ public final class UserBitShared {
         return this;
       }
 
+      // optional double total_cost = 20;
+      private double totalCost_ ;
+      /**
+       * <code>optional double total_cost = 20;</code>
+       */
+      public boolean hasTotalCost() {
+        return ((bitField0_ & 0x00080000) == 0x00080000);
+      }
+      /**
+       * <code>optional double total_cost = 20;</code>
+       */
+      public double getTotalCost() {
+        return totalCost_;
+      }
+      /**
+       * <code>optional double total_cost = 20;</code>
+       */
+      public Builder setTotalCost(double value) {
+        bitField0_ |= 0x00080000;
+        totalCost_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional double total_cost = 20;</code>
+       */
+      public Builder clearTotalCost() {
+        bitField0_ = (bitField0_ & ~0x00080000);
+        totalCost_ = 0D;
+        onChanged();
+        return this;
+      }
+
+      // optional string queue_name = 21 [default = "-"];
+      private java.lang.Object queueName_ = "-";
+      /**
+       * <code>optional string queue_name = 21 [default = "-"];</code>
+       */
+      public boolean hasQueueName() {
+        return ((bitField0_ & 0x00100000) == 0x00100000);
+      }
+      /**
+       * <code>optional string queue_name = 21 [default = "-"];</code>
+       */
+      public java.lang.String getQueueName() {
+        java.lang.Object ref = queueName_;
+        if (!(ref instanceof java.lang.String)) {
+          java.lang.String s = ((com.google.protobuf.ByteString) ref)
+              .toStringUtf8();
+          queueName_ = s;
+          return s;
+        } else {
+          return (java.lang.String) ref;
+        }
+      }
+      /**
+       * <code>optional string queue_name = 21 [default = "-"];</code>
+       */
+      public com.google.protobuf.ByteString
+          getQueueNameBytes() {
+        java.lang.Object ref = queueName_;
+        if (ref instanceof String) {
+          com.google.protobuf.ByteString b = 
+              com.google.protobuf.ByteString.copyFromUtf8(
+                  (java.lang.String) ref);
+          queueName_ = b;
+          return b;
+        } else {
+          return (com.google.protobuf.ByteString) ref;
+        }
+      }
+      /**
+       * <code>optional string queue_name = 21 [default = "-"];</code>
+       */
+      public Builder setQueueName(
+          java.lang.String value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00100000;
+        queueName_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional string queue_name = 21 [default = "-"];</code>
+       */
+      public Builder clearQueueName() {
+        bitField0_ = (bitField0_ & ~0x00100000);
+        queueName_ = getDefaultInstance().getQueueName();
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional string queue_name = 21 [default = "-"];</code>
+       */
+      public Builder setQueueNameBytes(
+          com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00100000;
+        queueName_ = value;
+        onChanged();
+        return this;
+      }
+
       // @@protoc_insertion_point(builder_scope:exec.shared.QueryProfile)
     }
 
@@ -23469,79 +23943,82 @@ public final class UserBitShared {
       "ENQUEUED\020\006\"p\n\tQueryData\022&\n\010query_id\030\001 \001(" +
       "\0132\024.exec.shared.QueryId\022\021\n\trow_count\030\002 \001" +
       "(\005\022(\n\003def\030\003 \001(\0132\033.exec.shared.RecordBatc" +
-      "hDef\"\255\001\n\tQueryInfo\022\r\n\005query\030\001 
\001(\t\022\r\n\005sta" +
+      "hDef\"\330\001\n\tQueryInfo\022\r\n\005query\030\001 
\001(\t\022\r\n\005sta" +
       "rt\030\002 \001(\003\0222\n\005state\030\003 
\001(\0162#.exec.shared.Qu",
       "eryResult.QueryState\022\017\n\004user\030\004 \001(\t:\001-\022\'\n" +
       "\007foreman\030\005 \001(\0132\026.exec.DrillbitEndpoint\022\024" +
-      "\n\014options_json\030\006 \001(\t\"\367\003\n\014QueryProfile\022 \n" +
-      "\002id\030\001 \001(\0132\024.exec.shared.QueryId\022$\n\004type\030" +
-      "\002 \001(\0162\026.exec.shared.QueryType\022\r\n\005start\030\003" +
-      " \001(\003\022\013\n\003end\030\004 \001(\003\022\r\n\005query\030\005 
\001(\t\022\014\n\004plan" +
-      "\030\006 \001(\t\022\'\n\007foreman\030\007 
\001(\0132\026.exec.DrillbitE" +
-      "ndpoint\0222\n\005state\030\010 \001(\0162#.exec.shared.Que" +
-      "ryResult.QueryState\022\027\n\017total_fragments\030\t" +
-      " \001(\005\022\032\n\022finished_fragments\030\n 
\001(\005\022;\n\020frag",
-      "ment_profile\030\013 \003(\0132!.exec.shared.MajorFr" +
-      "agmentProfile\022\017\n\004user\030\014 
\001(\t:\001-\022\r\n\005error\030" +
-      "\r \001(\t\022\024\n\014verboseError\030\016 
\001(\t\022\020\n\010error_id\030" +
-      "\017 \001(\t\022\022\n\nerror_node\030\020 
\001(\t\022\024\n\014options_jso" +
-      "n\030\021 \001(\t\022\017\n\007planEnd\030\022 
\001(\003\022\024\n\014queueWaitEnd" +
-      "\030\023 \001(\003\"t\n\024MajorFragmentProfile\022\031\n\021major_" +
-      "fragment_id\030\001 \001(\005\022A\n\026minor_fragment_prof" +
-      "ile\030\002 \003(\0132!.exec.shared.MinorFragmentPro" +
-      "file\"\350\002\n\024MinorFragmentProfile\022)\n\005state\030\001" +
-      " \001(\0162\032.exec.shared.FragmentState\022(\n\005erro",
-      "r\030\002 \001(\0132\031.exec.shared.DrillPBError\022\031\n\021mi" +
-      "nor_fragment_id\030\003 \001(\005\0226\n\020operator_profil" +
-      "e\030\004 \003(\0132\034.exec.shared.OperatorProfile\022\022\n" +
-      "\nstart_time\030\005 \001(\003\022\020\n\010end_time\030\006 
\001(\003\022\023\n\013m" +
-      "emory_used\030\007 \001(\003\022\027\n\017max_memory_used\030\010 
\001(" +
-      "\003\022(\n\010endpoint\030\t \001(\0132\026.exec.DrillbitEndpo" +
-      "int\022\023\n\013last_update\030\n \001(\003\022\025\n\rlast_progres" +
-      "s\030\013 \001(\003\"\377\001\n\017OperatorProfile\0221\n\rinput_pro" +
-      "file\030\001 \003(\0132\032.exec.shared.StreamProfile\022\023" +
-      "\n\013operator_id\030\003 \001(\005\022\025\n\roperator_type\030\004 
\001",
-      "(\005\022\023\n\013setup_nanos\030\005 
\001(\003\022\025\n\rprocess_nanos" +
-      "\030\006 \001(\003\022#\n\033peak_local_memory_allocated\030\007 " +
-      "\001(\003\022(\n\006metric\030\010 \003(\0132\030.exec.shared.Metric" +
-      "Value\022\022\n\nwait_nanos\030\t \001(\003\"B\n\rStreamProfi" +
-      "le\022\017\n\007records\030\001 \001(\003\022\017\n\007batches\030\002 
\001(\003\022\017\n\007" +
-      "schemas\030\003 \001(\003\"J\n\013MetricValue\022\021\n\tmetric_i" +
-      "d\030\001 \001(\005\022\022\n\nlong_value\030\002 
\001(\003\022\024\n\014double_va" +
-      "lue\030\003 \001(\001\")\n\010Registry\022\035\n\003jar\030\001 
\003(\0132\020.exe" +
-      "c.shared.Jar\"/\n\003Jar\022\014\n\004name\030\001 
\001(\t\022\032\n\022fun" +
-      "ction_signature\030\002 \003(\t\"W\n\013SaslMessage\022\021\n\t",
-      "mechanism\030\001 \001(\t\022\014\n\004data\030\002 
\001(\014\022\'\n\006status\030" +
-      "\003 \001(\0162\027.exec.shared.SaslStatus*5\n\nRpcCha" +
-      
"nnel\022\017\n\013BIT_CONTROL\020\000\022\014\n\010BIT_DATA\020\001\022\010\n\004U"
 +
-      
"SER\020\002*V\n\tQueryType\022\007\n\003SQL\020\001\022\013\n\007LOGICAL\020\002"
 +
-      
"\022\014\n\010PHYSICAL\020\003\022\r\n\tEXECUTION\020\004\022\026\n\022PREPARE"
 +
-      "D_STATEMENT\020\005*\207\001\n\rFragmentState\022\013\n\007SENDI" +
-      
"NG\020\000\022\027\n\023AWAITING_ALLOCATION\020\001\022\013\n\007RUNNING" +
-      
"\020\002\022\014\n\010FINISHED\020\003\022\r\n\tCANCELLED\020\004\022\n\n\006FAILE"
 +
-      
"D\020\005\022\032\n\026CANCELLATION_REQUESTED\020\006*\335\005\n\020Core" +
-      "OperatorType\022\021\n\rSINGLE_SENDER\020\000\022\024\n\020BROAD",
-      "CAST_SENDER\020\001\022\n\n\006FILTER\020\002\022\022\n\016HASH_AGGREG" 
+
-      
"ATE\020\003\022\r\n\tHASH_JOIN\020\004\022\016\n\nMERGE_JOIN\020\005\022\031\n\025"
 +
-      "HASH_PARTITION_SENDER\020\006\022\t\n\005LIMIT\020\007\022\024\n\020ME" 
+
-      "RGING_RECEIVER\020\010\022\034\n\030ORDERED_PARTITION_SE" +
-      "NDER\020\t\022\013\n\007PROJECT\020\n\022\026\n\022UNORDERED_RECEIVE" +
-      
"R\020\013\022\020\n\014RANGE_SENDER\020\014\022\n\n\006SCREEN\020\r\022\034\n\030SEL"
 +
-      "ECTION_VECTOR_REMOVER\020\016\022\027\n\023STREAMING_AGG" +
-      "REGATE\020\017\022\016\n\nTOP_N_SORT\020\020\022\021\n\rEXTERNAL_SOR" +
-      
"T\020\021\022\t\n\005TRACE\020\022\022\t\n\005UNION\020\023\022\014\n\010OLD_SORT\020\024\022"
 +
-      "\032\n\026PARQUET_ROW_GROUP_SCAN\020\025\022\021\n\rHIVE_SUB_",
-      "SCAN\020\026\022\025\n\021SYSTEM_TABLE_SCAN\020\027\022\021\n\rMOCK_SU" 
+
-      
"B_SCAN\020\030\022\022\n\016PARQUET_WRITER\020\031\022\023\n\017DIRECT_S" +
-      "UB_SCAN\020\032\022\017\n\013TEXT_WRITER\020\033\022\021\n\rTEXT_SUB_S" 
+
-      "CAN\020\034\022\021\n\rJSON_SUB_SCAN\020\035\022\030\n\024INFO_SCHEMA_" 
+
-      
"SUB_SCAN\020\036\022\023\n\017COMPLEX_TO_JSON\020\037\022\025\n\021PRODU" +
-      "CER_CONSUMER\020 \022\022\n\016HBASE_SUB_SCAN\020!\022\n\n\006WI" +
-      "NDOW\020\"\022\024\n\020NESTED_LOOP_JOIN\020#\022\021\n\rAVRO_SUB" +
-      "_SCAN\020$*g\n\nSaslStatus\022\020\n\014SASL_UNKNOWN\020\000\022" +
-      
"\016\n\nSASL_START\020\001\022\024\n\020SASL_IN_PROGRESS\020\002\022\020\n" +
-      "\014SASL_SUCCESS\020\003\022\017\n\013SASL_FAILED\020\004B.\n\033org.",
-      "apache.drill.exec.protoB\rUserBitSharedH\001"
+      "\n\014options_json\030\006 \001(\t\022\022\n\ntotal_cost\030\007 
\001(\001" +
+      "\022\025\n\nqueue_name\030\010 
\001(\t:\001-\"\242\004\n\014QueryProfile" +
+      "\022 \n\002id\030\001 \001(\0132\024.exec.shared.QueryId\022$\n\004ty" +
+      "pe\030\002 \001(\0162\026.exec.shared.QueryType\022\r\n\005star" +
+      "t\030\003 \001(\003\022\013\n\003end\030\004 
\001(\003\022\r\n\005query\030\005 \001(\t\022\014\n\004p" +
+      "lan\030\006 \001(\t\022\'\n\007foreman\030\007 
\001(\0132\026.exec.Drillb" +
+      "itEndpoint\0222\n\005state\030\010 \001(\0162#.exec.shared." +
+      "QueryResult.QueryState\022\027\n\017total_fragment",
+      "s\030\t \001(\005\022\032\n\022finished_fragments\030\n 
\001(\005\022;\n\020f" +
+      "ragment_profile\030\013 \003(\0132!.exec.shared.Majo" +
+      "rFragmentProfile\022\017\n\004user\030\014 
\001(\t:\001-\022\r\n\005err" +
+      "or\030\r \001(\t\022\024\n\014verboseError\030\016 
\001(\t\022\020\n\010error_" +
+      "id\030\017 \001(\t\022\022\n\nerror_node\030\020 
\001(\t\022\024\n\014options_" +
+      "json\030\021 \001(\t\022\017\n\007planEnd\030\022 
\001(\003\022\024\n\014queueWait" +
+      "End\030\023 \001(\003\022\022\n\ntotal_cost\030\024 
\001(\001\022\025\n\nqueue_n" +
+      "ame\030\025 \001(\t:\001-\"t\n\024MajorFragmentProfile\022\031\n\021" +
+      "major_fragment_id\030\001 \001(\005\022A\n\026minor_fragmen" +
+      "t_profile\030\002 \003(\0132!.exec.shared.MinorFragm",
+      "entProfile\"\350\002\n\024MinorFragmentProfile\022)\n\005s" +
+      "tate\030\001 \001(\0162\032.exec.shared.FragmentState\022(" +
+      "\n\005error\030\002 \001(\0132\031.exec.shared.DrillPBError" +
+      "\022\031\n\021minor_fragment_id\030\003 \001(\005\0226\n\020operator_" +
+      "profile\030\004 \003(\0132\034.exec.shared.OperatorProf" +
+      "ile\022\022\n\nstart_time\030\005 
\001(\003\022\020\n\010end_time\030\006 \001(" +
+      "\003\022\023\n\013memory_used\030\007 
\001(\003\022\027\n\017max_memory_use" +
+      "d\030\010 \001(\003\022(\n\010endpoint\030\t 
\001(\0132\026.exec.Drillbi" +
+      "tEndpoint\022\023\n\013last_update\030\n \001(\003\022\025\n\rlast_p" +
+      "rogress\030\013 \001(\003\"\377\001\n\017OperatorProfile\0221\n\rinp",
+      "ut_profile\030\001 \003(\0132\032.exec.shared.StreamPro" +
+      "file\022\023\n\013operator_id\030\003 \001(\005\022\025\n\roperator_ty" 
+
+      "pe\030\004 \001(\005\022\023\n\013setup_nanos\030\005 
\001(\003\022\025\n\rprocess" +
+      "_nanos\030\006 \001(\003\022#\n\033peak_local_memory_alloca" +
+      "ted\030\007 \001(\003\022(\n\006metric\030\010 
\003(\0132\030.exec.shared." +
+      "MetricValue\022\022\n\nwait_nanos\030\t \001(\003\"B\n\rStrea" +
+      "mProfile\022\017\n\007records\030\001 
\001(\003\022\017\n\007batches\030\002 \001" +
+      "(\003\022\017\n\007schemas\030\003 
\001(\003\"J\n\013MetricValue\022\021\n\tme" +
+      "tric_id\030\001 \001(\005\022\022\n\nlong_value\030\002 
\001(\003\022\024\n\014dou" +
+      "ble_value\030\003 \001(\001\")\n\010Registry\022\035\n\003jar\030\001 
\003(\013",
+      "2\020.exec.shared.Jar\"/\n\003Jar\022\014\n\004name\030\001 
\001(\t\022" +
+      "\032\n\022function_signature\030\002 \003(\t\"W\n\013SaslMessa" +
+      "ge\022\021\n\tmechanism\030\001 \001(\t\022\014\n\004data\030\002 
\001(\014\022\'\n\006s" +
+      "tatus\030\003 \001(\0162\027.exec.shared.SaslStatus*5\n\n" +
+      "RpcChannel\022\017\n\013BIT_CONTROL\020\000\022\014\n\010BIT_DATA\020" +
+      
"\001\022\010\n\004USER\020\002*V\n\tQueryType\022\007\n\003SQL\020\001\022\013\n\007LOG"
 +
+      
"ICAL\020\002\022\014\n\010PHYSICAL\020\003\022\r\n\tEXECUTION\020\004\022\026\n\022P"
 +
+      "REPARED_STATEMENT\020\005*\207\001\n\rFragmentState\022\013\n" +
+      
"\007SENDING\020\000\022\027\n\023AWAITING_ALLOCATION\020\001\022\013\n\007R" +
+      
"UNNING\020\002\022\014\n\010FINISHED\020\003\022\r\n\tCANCELLED\020\004\022\n\n",
+      
"\006FAILED\020\005\022\032\n\026CANCELLATION_REQUESTED\020\006*\360\005" +
+      "\n\020CoreOperatorType\022\021\n\rSINGLE_SENDER\020\000\022\024\n" +
+      
"\020BROADCAST_SENDER\020\001\022\n\n\006FILTER\020\002\022\022\n\016HASH_" +
+      "AGGREGATE\020\003\022\r\n\tHASH_JOIN\020\004\022\016\n\nMERGE_JOIN" +
+      
"\020\005\022\031\n\025HASH_PARTITION_SENDER\020\006\022\t\n\005LIMIT\020\007" +
+      "\022\024\n\020MERGING_RECEIVER\020\010\022\034\n\030ORDERED_PARTIT" +
+      "ION_SENDER\020\t\022\013\n\007PROJECT\020\n\022\026\n\022UNORDERED_R" +
+      
"ECEIVER\020\013\022\020\n\014RANGE_SENDER\020\014\022\n\n\006SCREEN\020\r\022" 
+
+      "\034\n\030SELECTION_VECTOR_REMOVER\020\016\022\027\n\023STREAMI" +
+      "NG_AGGREGATE\020\017\022\016\n\nTOP_N_SORT\020\020\022\021\n\rEXTERN",
+      
"AL_SORT\020\021\022\t\n\005TRACE\020\022\022\t\n\005UNION\020\023\022\014\n\010OLD_S"
 +
+      "ORT\020\024\022\032\n\026PARQUET_ROW_GROUP_SCAN\020\025\022\021\n\rHIV" 
+
+      "E_SUB_SCAN\020\026\022\025\n\021SYSTEM_TABLE_SCAN\020\027\022\021\n\rM" 
+
+      
"OCK_SUB_SCAN\020\030\022\022\n\016PARQUET_WRITER\020\031\022\023\n\017DI" +
+      "RECT_SUB_SCAN\020\032\022\017\n\013TEXT_WRITER\020\033\022\021\n\rTEXT" 
+
+      "_SUB_SCAN\020\034\022\021\n\rJSON_SUB_SCAN\020\035\022\030\n\024INFO_S" 
+
+      "CHEMA_SUB_SCAN\020\036\022\023\n\017COMPLEX_TO_JSON\020\037\022\025\n" +
+      "\021PRODUCER_CONSUMER\020 \022\022\n\016HBASE_SUB_SCAN\020!" +
+      
"\022\n\n\006WINDOW\020\"\022\024\n\020NESTED_LOOP_JOIN\020#\022\021\n\rAV" +
+      "RO_SUB_SCAN\020$\022\021\n\rPCAP_SUB_SCAN\020%*g\n\nSasl",
+      "Status\022\020\n\014SASL_UNKNOWN\020\000\022\016\n\nSASL_START\020\001" 
+
+      
"\022\024\n\020SASL_IN_PROGRESS\020\002\022\020\n\014SASL_SUCCESS\020\003" +
+      "\022\017\n\013SASL_FAILED\020\004B.\n\033org.apache.drill.ex" +
+      "ec.protoB\rUserBitSharedH\001"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner 
assigner =
       new 
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -23625,13 +24102,13 @@ public final class UserBitShared {
           internal_static_exec_shared_QueryInfo_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_exec_shared_QueryInfo_descriptor,
-              new java.lang.String[] { "Query", "Start", "State", "User", 
"Foreman", "OptionsJson", });
+              new java.lang.String[] { "Query", "Start", "State", "User", 
"Foreman", "OptionsJson", "TotalCost", "QueueName", });
           internal_static_exec_shared_QueryProfile_descriptor =
             getDescriptor().getMessageTypes().get(13);
           internal_static_exec_shared_QueryProfile_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_exec_shared_QueryProfile_descriptor,
-              new java.lang.String[] { "Id", "Type", "Start", "End", "Query", 
"Plan", "Foreman", "State", "TotalFragments", "FinishedFragments", 
"FragmentProfile", "User", "Error", "VerboseError", "ErrorId", "ErrorNode", 
"OptionsJson", "PlanEnd", "QueueWaitEnd", });
+              new java.lang.String[] { "Id", "Type", "Start", "End", "Query", 
"Plan", "Foreman", "State", "TotalFragments", "FinishedFragments", 
"FragmentProfile", "User", "Error", "VerboseError", "ErrorId", "ErrorNode", 
"OptionsJson", "PlanEnd", "QueueWaitEnd", "TotalCost", "QueueName", });
           internal_static_exec_shared_MajorFragmentProfile_descriptor =
             getDescriptor().getMessageTypes().get(14);
           internal_static_exec_shared_MajorFragmentProfile_fieldAccessorTable 
= new

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryInfo.java
----------------------------------------------------------------------
diff --git 
a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryInfo.java 
b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryInfo.java
index 4331ca3..1a6b197 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryInfo.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryInfo.java
@@ -48,6 +48,7 @@ public final class QueryInfo implements Externalizable, 
Message<QueryInfo>, Sche
     static final QueryInfo DEFAULT_INSTANCE = new QueryInfo();
 
     static final String DEFAULT_USER = ByteString.stringDefaultValue("-");
+    static final String DEFAULT_QUEUE_NAME = 
ByteString.stringDefaultValue("-");
     
     private String query;
     private long start;
@@ -55,6 +56,8 @@ public final class QueryInfo implements Externalizable, 
Message<QueryInfo>, Sche
     private String user = DEFAULT_USER;
     private DrillbitEndpoint foreman;
     private String optionsJson;
+    private double totalCost;
+    private String queueName = DEFAULT_QUEUE_NAME;
 
     public QueryInfo()
     {
@@ -141,6 +144,32 @@ public final class QueryInfo implements Externalizable, 
Message<QueryInfo>, Sche
         return this;
     }
 
+    // totalCost
+
+    public double getTotalCost()
+    {
+        return totalCost;
+    }
+
+    public QueryInfo setTotalCost(double totalCost)
+    {
+        this.totalCost = totalCost;
+        return this;
+    }
+
+    // queueName
+
+    public String getQueueName()
+    {
+        return queueName;
+    }
+
+    public QueryInfo setQueueName(String queueName)
+    {
+        this.queueName = queueName;
+        return this;
+    }
+
     // java serialization
 
     public void readExternal(ObjectInput in) throws IOException
@@ -214,6 +243,12 @@ public final class QueryInfo implements Externalizable, 
Message<QueryInfo>, Sche
                 case 6:
                     message.optionsJson = input.readString();
                     break;
+                case 7:
+                    message.totalCost = input.readDouble();
+                    break;
+                case 8:
+                    message.queueName = input.readString();
+                    break;
                 default:
                     input.handleUnknownField(number, this);
             }   
@@ -241,6 +276,12 @@ public final class QueryInfo implements Externalizable, 
Message<QueryInfo>, Sche
 
         if(message.optionsJson != null)
             output.writeString(6, message.optionsJson, false);
+
+        if(message.totalCost != 0)
+            output.writeDouble(7, message.totalCost, false);
+
+        if(message.queueName != null && message.queueName != 
DEFAULT_QUEUE_NAME)
+            output.writeString(8, message.queueName, false);
     }
 
     public String getFieldName(int number)
@@ -253,6 +294,8 @@ public final class QueryInfo implements Externalizable, 
Message<QueryInfo>, Sche
             case 4: return "user";
             case 5: return "foreman";
             case 6: return "optionsJson";
+            case 7: return "totalCost";
+            case 8: return "queueName";
             default: return null;
         }
     }
@@ -272,6 +315,8 @@ public final class QueryInfo implements Externalizable, 
Message<QueryInfo>, Sche
         __fieldMap.put("user", 4);
         __fieldMap.put("foreman", 5);
         __fieldMap.put("optionsJson", 6);
+        __fieldMap.put("totalCost", 7);
+        __fieldMap.put("queueName", 8);
     }
     
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java
----------------------------------------------------------------------
diff --git 
a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java 
b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java
index 216ce63..f3ac966 100644
--- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java
+++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/QueryProfile.java
@@ -50,6 +50,7 @@ public final class QueryProfile implements Externalizable, 
Message<QueryProfile>
     static final QueryProfile DEFAULT_INSTANCE = new QueryProfile();
 
     static final String DEFAULT_USER = ByteString.stringDefaultValue("-");
+    static final String DEFAULT_QUEUE_NAME = 
ByteString.stringDefaultValue("-");
     
     private QueryId id;
     private QueryType type;
@@ -70,6 +71,8 @@ public final class QueryProfile implements Externalizable, 
Message<QueryProfile>
     private String optionsJson;
     private long planEnd;
     private long queueWaitEnd;
+    private double totalCost;
+    private String queueName = DEFAULT_QUEUE_NAME;
 
     public QueryProfile()
     {
@@ -325,6 +328,32 @@ public final class QueryProfile implements Externalizable, 
Message<QueryProfile>
         return this;
     }
 
+    // totalCost
+
+    public double getTotalCost()
+    {
+        return totalCost;
+    }
+
+    public QueryProfile setTotalCost(double totalCost)
+    {
+        this.totalCost = totalCost;
+        return this;
+    }
+
+    // queueName
+
+    public String getQueueName()
+    {
+        return queueName;
+    }
+
+    public QueryProfile setQueueName(String queueName)
+    {
+        this.queueName = queueName;
+        return this;
+    }
+
     // java serialization
 
     public void readExternal(ObjectInput in) throws IOException
@@ -441,6 +470,12 @@ public final class QueryProfile implements Externalizable, 
Message<QueryProfile>
                 case 19:
                     message.queueWaitEnd = input.readInt64();
                     break;
+                case 20:
+                    message.totalCost = input.readDouble();
+                    break;
+                case 21:
+                    message.queueName = input.readString();
+                    break;
                 default:
                     input.handleUnknownField(number, this);
             }   
@@ -515,6 +550,12 @@ public final class QueryProfile implements Externalizable, 
Message<QueryProfile>
 
         if(message.queueWaitEnd != 0)
             output.writeInt64(19, message.queueWaitEnd, false);
+
+        if(message.totalCost != 0)
+            output.writeDouble(20, message.totalCost, false);
+
+        if(message.queueName != null && message.queueName != 
DEFAULT_QUEUE_NAME)
+            output.writeString(21, message.queueName, false);
     }
 
     public String getFieldName(int number)
@@ -540,6 +581,8 @@ public final class QueryProfile implements Externalizable, 
Message<QueryProfile>
             case 17: return "optionsJson";
             case 18: return "planEnd";
             case 19: return "queueWaitEnd";
+            case 20: return "totalCost";
+            case 21: return "queueName";
             default: return null;
         }
     }
@@ -572,6 +615,8 @@ public final class QueryProfile implements Externalizable, 
Message<QueryProfile>
         __fieldMap.put("optionsJson", 17);
         __fieldMap.put("planEnd", 18);
         __fieldMap.put("queueWaitEnd", 19);
+        __fieldMap.put("totalCost", 20);
+        __fieldMap.put("queueName", 21);
     }
     
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/bbc42240/protocol/src/main/protobuf/UserBitShared.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/UserBitShared.proto 
b/protocol/src/main/protobuf/UserBitShared.proto
index 65f9698..52b3c63 100644
--- a/protocol/src/main/protobuf/UserBitShared.proto
+++ b/protocol/src/main/protobuf/UserBitShared.proto
@@ -190,9 +190,10 @@ message QueryInfo {
   optional string user = 4 [default = "-"];
   optional DrillbitEndpoint foreman = 5;
   optional string options_json = 6;
+  optional double total_cost = 7;
+  optional string queue_name = 8 [default = "-"];
 }
 
-
 message QueryProfile {
   optional QueryId id = 1;
   optional QueryType type = 2;
@@ -213,6 +214,8 @@ message QueryProfile {
   optional string options_json = 17;
   optional int64 planEnd = 18;
   optional int64 queueWaitEnd = 19;
+  optional double total_cost = 20;
+  optional string queue_name = 21 [default = "-"];
 }
 
 message MajorFragmentProfile {
@@ -305,6 +308,7 @@ enum CoreOperatorType {
   WINDOW = 34;
   NESTED_LOOP_JOIN = 35;
   AVRO_SUB_SCAN = 36;
+  PCAP_SUB_SCAN = 37;
 }
 
 /* Registry that contains list of jars, each jar contains its name and list of 
function signatures.

Reply via email to