DRILL-1425: Handle unknown operators in web ui
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/2eb04e7b Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/2eb04e7b Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/2eb04e7b Branch: refs/heads/master Commit: 2eb04e7b8f103a57312aa5d88a170a6edf398ed6 Parents: 2ca9c90 Author: Steven Phillips <sphill...@maprtech.com> Authored: Tue Sep 16 17:23:12 2014 -0700 Committer: Steven Phillips <sphill...@maprtech.com> Committed: Sun Sep 28 00:10:44 2014 -0700 ---------------------------------------------------------------------- .../drill/exec/server/rest/ProfileWrapper.java | 6 +++-- .../apache/drill/exec/proto/UserBitShared.java | 26 ++++++++++++++------ .../exec/proto/beans/CoreOperatorType.java | 6 +++-- protocol/src/main/protobuf/UserBitShared.proto | 3 ++- 4 files changed, 28 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2eb04e7b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileWrapper.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileWrapper.java b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileWrapper.java index d158ccc..80c08d3 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileWrapper.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/ProfileWrapper.java @@ -326,7 +326,8 @@ public class ProfileWrapper { public String getDisplayName() { OperatorProfile op = ops.get(0).getLeft(); String path = new OperatorPathBuilder().setMajor(major).setOperator(op).build(); - return String.format("%s - %s", path, CoreOperatorType.valueOf(op.getOperatorType()).toString()); + CoreOperatorType operatorType = CoreOperatorType.valueOf(op.getOperatorType()); + return String.format("%s - %s", path, operatorType == null ? "UKNOWN_OPERATOR" : operatorType.toString()); } public String getId() { @@ -364,7 +365,8 @@ public class ProfileWrapper { OperatorProfile op = ops.get(0).getLeft(); String path = new OperatorPathBuilder().setMajor(major).setOperator(op).build(); tb.appendCell(path, null); - tb.appendCell(CoreOperatorType.valueOf(ops.get(0).getLeft().getOperatorType() ).toString(), null); + CoreOperatorType operatorType = CoreOperatorType.valueOf(ops.get(0).getLeft().getOperatorType()); + tb.appendCell(operatorType == null ? "UNKNOWN_OPERATOR" : operatorType.toString(), null); int li = ops.size() - 1; String fmt = " (%s)"; http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2eb04e7b/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 ed4ae95..4f01053 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 @@ -463,9 +463,13 @@ public final class UserBitShared { */ PRODUCER_CONSUMER(32, 32), /** - * <code>WINDOW = 33;</code> + * <code>HBASE_SUB_SCAN = 33;</code> */ - WINDOW(33, 33), + HBASE_SUB_SCAN(33, 33), + /** + * <code>WINDOW = 34;</code> + */ + WINDOW(34, 34), ; /** @@ -601,9 +605,13 @@ public final class UserBitShared { */ public static final int PRODUCER_CONSUMER_VALUE = 32; /** - * <code>WINDOW = 33;</code> + * <code>HBASE_SUB_SCAN = 33;</code> + */ + public static final int HBASE_SUB_SCAN_VALUE = 33; + /** + * <code>WINDOW = 34;</code> */ - public static final int WINDOW_VALUE = 33; + public static final int WINDOW_VALUE = 34; public final int getNumber() { return value; } @@ -643,7 +651,8 @@ public final class UserBitShared { case 30: return INFO_SCHEMA_SUB_SCAN; case 31: return COMPLEX_TO_JSON; case 32: return PRODUCER_CONSUMER; - case 33: return WINDOW; + case 33: return HBASE_SUB_SCAN; + case 34: return WINDOW; default: return null; } } @@ -16548,7 +16557,7 @@ public final class UserBitShared { "\020\001\022\013\n\007LOGICAL\020\002\022\014\n\010PHYSICAL\020\003*k\n\rFragmen" + "tState\022\013\n\007SENDING\020\000\022\027\n\023AWAITING_ALLOCATI", "ON\020\001\022\013\n\007RUNNING\020\002\022\014\n\010FINISHED\020\003\022\r\n\tCANCE" + - "LLED\020\004\022\n\n\006FAILED\020\005*\240\005\n\020CoreOperatorType\022" + + "LLED\020\004\022\n\n\006FAILED\020\005*\264\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_PARTITIO" + @@ -16565,8 +16574,9 @@ public final class UserBitShared { "TEXT_WRITER\020\033\022\021\n\rTEXT_SUB_SCAN\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\021PRODUCER_CONSUMER\020" + - " \022\n\n\006WINDOW\020!B.\n\033org.apache.drill.exec.p" + - "rotoB\rUserBitSharedH\001" + " \022\022\n\016HBASE_SUB_SCAN\020!\022\n\n\006WINDOW\020\"B.\n\033org" + + ".apache.drill.exec.protoB\rUserBitSharedH", + "\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2eb04e7b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CoreOperatorType.java ---------------------------------------------------------------------- diff --git a/protocol/src/main/java/org/apache/drill/exec/proto/beans/CoreOperatorType.java b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CoreOperatorType.java index 6e547c1..7475cdc 100644 --- a/protocol/src/main/java/org/apache/drill/exec/proto/beans/CoreOperatorType.java +++ b/protocol/src/main/java/org/apache/drill/exec/proto/beans/CoreOperatorType.java @@ -55,7 +55,8 @@ public enum CoreOperatorType implements com.dyuproject.protostuff.EnumLite<CoreO INFO_SCHEMA_SUB_SCAN(30), COMPLEX_TO_JSON(31), PRODUCER_CONSUMER(32), - WINDOW(33); + HBASE_SUB_SCAN(33), + WINDOW(34); public final int number; @@ -106,7 +107,8 @@ public enum CoreOperatorType implements com.dyuproject.protostuff.EnumLite<CoreO case 30: return INFO_SCHEMA_SUB_SCAN; case 31: return COMPLEX_TO_JSON; case 32: return PRODUCER_CONSUMER; - case 33: return WINDOW; + case 33: return HBASE_SUB_SCAN; + case 34: return WINDOW; default: return null; } } http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/2eb04e7b/protocol/src/main/protobuf/UserBitShared.proto ---------------------------------------------------------------------- diff --git a/protocol/src/main/protobuf/UserBitShared.proto b/protocol/src/main/protobuf/UserBitShared.proto index fb1cb77..3ad9a09 100644 --- a/protocol/src/main/protobuf/UserBitShared.proto +++ b/protocol/src/main/protobuf/UserBitShared.proto @@ -200,5 +200,6 @@ enum CoreOperatorType { INFO_SCHEMA_SUB_SCAN = 30; COMPLEX_TO_JSON = 31; PRODUCER_CONSUMER = 32; - WINDOW = 33; + HBASE_SUB_SCAN = 33; + WINDOW = 34; }