Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Drill >> mail # dev >> [10/10] git commit: DRILL-266:Build tools to interpret the output dumped by the diagnostic operator.


Copy link to this message
-
[10/10] git commit: DRILL-266:Build tools to interpret the output dumped by the diagnostic operator.
DRILL-266:Build tools to interpret the output dumped by the diagnostic operator.
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/c287fa60
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/c287fa60
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/c287fa60

Branch: refs/heads/master
Commit: c287fa604f6206752200d72359d3293c87078010
Parents: c591665
Author: Jinfeng Ni <[EMAIL PROTECTED]>
Authored: Fri Nov 8 16:50:45 2013 -0800
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Fri Nov 8 16:50:45 2013 -0800

----------------------------------------------------------------------
 distribution/src/assemble/bin.xml               |   4 +
 distribution/src/resources/drill_dumpcat        |  56 ++++
 .../cache/VectorAccessibleSerializable.java     |   3 +-
 .../org/apache/drill/exec/client/DumpCat.java   | 292 +++++++++++++++++++
 .../drill/exec/client/QuerySubmitter.java       |  33 +--
 .../org/apache/drill/exec/util/VectorUtil.java  |  68 +++++
 .../apache/drill/exec/client/DumpCatTest.java   | 133 +++++++++
 7 files changed, 561 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/c287fa60/distribution/src/assemble/bin.xml
----------------------------------------------------------------------
diff --git a/distribution/src/assemble/bin.xml b/distribution/src/assemble/bin.xml
index 26de847..fdd6c70 100644
--- a/distribution/src/assemble/bin.xml
+++ b/distribution/src/assemble/bin.xml
@@ -110,6 +110,10 @@
       <outputDirectory>bin</outputDirectory>
     </file>
     <file>
+      <source>src/resources/drill_dumpcat</source>
+      <outputDirectory>bin</outputDirectory>
+    </file>
+    <file>
       <source>src/resources/drill-override.conf</source>
       <outputDirectory>conf</outputDirectory>
     </file>

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/c287fa60/distribution/src/resources/drill_dumpcat
----------------------------------------------------------------------
diff --git a/distribution/src/resources/drill_dumpcat b/distribution/src/resources/drill_dumpcat
new file mode 100755
index 0000000..1747c9a
--- /dev/null
+++ b/distribution/src/resources/drill_dumpcat
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# 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.
+
+bin=`dirname "${BASH_SOURCE-$0}"`
+bin=`cd "$bin">/dev/null; pwd`
+
+. "$bin"/drill-config.sh
+
+if [ -z $JAVA_HOME ]
+then
+  JAVA=`which java`
+else
+  JAVA=`find -L $JAVA_HOME -name java | head -n 1`
+fi
+
+if [ -e $JAVA ]; then
+  echo ""
+else
+  echo "Java not found."
+  exit 1
+fi
+
+$JAVA -version 2>&1 | grep "version" | egrep -e "1.7" > /dev/null
+if [ $? -ne 0 ]; then
+  echo "Java 1.7 is required to run Apache Drill."
+  exit 1
+fi
+
+# get log directory
+if [ "$DRILL_LOG_DIR" = "" ]; then
+  export DRILL_LOG_DIR=/var/log/drill
+fi
+
+CP=$DRILL_HOME/jars/*:$CP
+CP=$DRILL_HOME/lib/*:$CP
+
+CP=$DRILL_CONF_DIR:$CP
+CP=$HADOOP_CLASSPATH:$CP
+
+DRILL_SHELL_JAVA_OPTS="$DRILL_SHELL_JAVA_OPTS -Dlog.path=$DRILL_LOG_DIR/drill_dumpcat.log"
+
+exec $JAVA $DRILL_SHELL_JAVA_OPTS $DRILL_JAVA_OPTS -cp $CP org.apache.drill.exec.client.DumpCat $@

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/c287fa60/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java b/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java
index e5bb94b..7b4bc23 100644
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java
@@ -98,6 +98,7 @@ public class VectorAccessibleSerializable implements DrillSerializable {
     UserBitShared.RecordBatchDef batchDef = UserBitShared.RecordBatchDef.parseDelimitedFrom(input);
     recordCount = batchDef.getRecordCount();
     if (batchDef.hasIsSelectionVector2() && batchDef.getIsSelectionVector2()) {
+
       if (sv2 == null) {
         sv2 = new SelectionVector2(allocator);
       }
@@ -197,7 +198,7 @@ public class VectorAccessibleSerializable implements DrillSerializable {
   public VectorAccessible get() {
     return va;
   }
-
+  
   public SelectionVector2 getSv2() {
     return sv2;
   }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/c287fa60/exec/java-exec/src/main/java/org/apache/drill/exec/client/DumpCat.java
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DumpCat.java b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DumpCat.java
new file mode 100644
index 0000000..ef0b1e1
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DumpCat.java
@@ -0,0 +1,292 @@
+/**
+ * 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 t