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

Switch to Threaded View
Drill, mail # dev - [03/10] git commit: DRILL-312: Modularize org.apache.drill.exec.physical.impl.ImplCreator using operator creator registry


Copy link to this message
-
[03/10] git commit: DRILL-312: Modularize org.apache.drill.exec.physical.impl.ImplCreator using operator creator registry
jacques@... 2013-12-02, 04:23
DRILL-312: Modularize org.apache.drill.exec.physical.impl.ImplCreator using operator creator registry
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/b91f2e8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/b91f2e8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/b91f2e8a

Branch: refs/heads/master
Commit: b91f2e8a837d7079c305442b41a3f3ef20b9846f
Parents: ba5e652
Author: Aditya Kishore <[EMAIL PROTECTED]>
Authored: Sun Dec 1 19:37:40 2013 -0800
Committer: Jacques Nadeau <[EMAIL PROTECTED]>
Committed: Sun Dec 1 19:37:40 2013 -0800

----------------------------------------------------------------------
 .../exceptions/ExecutionSetupException.java     |  10 ++
 .../drill/exec/physical/impl/ImplCreator.java   | 175 ++-----------------
 .../physical/impl/OperatorCreatorRegistry.java  | 100 +++++++++++
 .../drill/exec/server/DrillbitContext.java      |  17 +-
 .../apache/drill/exec/client/DumpCatTest.java   |   6 +-
 .../exec/fn/impl/TestRepeatedFunction.java      |   2 +
 .../physical/impl/TestComparisonFunctions.java  |   1 +
 .../exec/physical/impl/TestSimpleFunctions.java |   5 +
 .../drill/exec/physical/impl/agg/TestAgg.java   |   2 +
 .../physical/impl/filter/TestSimpleFilter.java  |   3 +
 .../exec/physical/impl/join/TestMergeJoin.java  |   5 +
 .../physical/impl/limit/TestSimpleLimit.java    |   6 +
 .../impl/project/TestSimpleProjection.java      |   2 +
 .../exec/physical/impl/sort/TestSimpleSort.java |   3 +
 .../physical/impl/svremover/TestSVRemover.java  |   2 +
 .../impl/trace/TestTraceMultiRecordBatch.java   |   4 +-
 .../impl/trace/TestTraceOutputDump.java         |   4 +-
 .../physical/impl/union/TestSimpleUnion.java    |   4 +
 18 files changed, 177 insertions(+), 174 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/b91f2e8a/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java b/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java
index 2e50ae5..ae647f1 100644
--- a/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java
+++ b/common/src/main/java/org/apache/drill/common/exceptions/ExecutionSetupException.java
@@ -17,9 +17,19 @@
  */
 package org.apache.drill.common.exceptions;
 
+import java.lang.reflect.InvocationTargetException;
+
 
 public class ExecutionSetupException extends DrillException{
+  private static final long serialVersionUID = -6943409010231014085L;
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ExecutionSetupException.class);
+
+  public static ExecutionSetupException fromThrowable(String message, Throwable cause) {
+    Throwable t = cause instanceof InvocationTargetException
+        ? ((InvocationTargetException)cause).getTargetException() : cause;
+    if(t instanceof ExecutionSetupException) return ((ExecutionSetupException) t);
+    return new ExecutionSetupException(message, t);
+  }
  
   public ExecutionSetupException() {
     super();

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/b91f2e8a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
index 3e4c1eb..2dc5f16 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
@@ -17,7 +17,6 @@
  */
 package org.apache.drill.exec.physical.impl;
 
-import java.util.Collections;
 import java.util.List;
 
 import org.apache.drill.common.exceptions.ExecutionSetupException;
@@ -25,43 +24,8 @@ import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.physical.base.AbstractPhysicalVisitor;
 import org.apache.drill.exec.physical.base.FragmentRoot;
 import org.apache.drill.exec.physical.base.PhysicalOperator;
-import org.apache.drill.exec.physical.base.SubScan;
-import org.apache.drill.exec.physical.config.Filter;
-import org.apache.drill.exec.physical.config.HashPartitionSender;
-import org.apache.drill.exec.physical.config.IteratorValidator;
-import org.apache.drill.exec.physical.config.Limit;
-import org.apache.drill.exec.physical.config.MergeJoinPOP;
-import org.apache.drill.exec.physical.config.MergingReceiverPOP;
-import org.apache.drill.exec.physical.config.OrderedPartitionSender;
-import org.apache.drill.exec.physical.config.Project;
-import org.apache.drill.exec.physical.config.RandomReceiver;
-import org.apache.drill.exec.physical.config.Screen;
-import org.apache.drill.exec.physical.config.SelectionVectorRemover;
-import org.apache.drill.exec.physical.config.SingleSender;
-import org.apache.drill.exec.physical.config.Sort;
-import org.apache.drill.exec.physical.config.StreamingAggregate;
-import org.apache.drill.exec.physical.config.Trace;
-import org.apache.drill.exec.physical.config.Union;
-import org.apache.drill.exec.physical.impl.aggregate.AggBatchCreator;
-import org.apache.drill.exec.physical.impl.filter.FilterBatchCreator;
-import org.apache.drill.exec.physical.impl.join.MergeJoinCreator;
-import org.apache.drill.exec.physical.impl.limit.LimitBatchCreator;
-import org.apache.drill.exec.physical.impl.orderedpartitioner.OrderedPartitionSenderCreator;
-import org.apache.drill.exec.physical.impl.partitionsender.PartitionSenderCreator;
-import org.apache.drill.exec.physical.impl.project.ProjectBatchCreator;
-import org.apache.drill.exec.physical.impl.sort.