Github user karanmehta93 commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/359#discussion_r222447782
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/schema/PTable.java 
---
    @@ -192,7 +192,39 @@ public static LinkType fromSerializedValue(byte 
serializedValue) {
                 return LinkType.values()[serializedValue-1];
             }
         }
    -    
    +
    +    public enum TaskType {
    +        DROP_CHILD_VIEWS((byte)1);
    +
    +        private final byte[] byteValue;
    +        private final byte serializedValue;
    +
    +        TaskType(byte serializedValue) {
    +            this.serializedValue = serializedValue;
    +            this.byteValue = Bytes.toBytes(this.name());
    +        }
    +
    +        public byte[] getBytes() {
    +                return byteValue;
    +        }
    +
    +        public byte getSerializedValue() {
    +            return this.serializedValue;
    +        }
    +        public static TaskType getDefault() {
    +            return DROP_CHILD_VIEWS;
    +        }
    +        public static TaskType fromToken(String token) {
    +            return TaskType.valueOf(token.trim().toUpperCase());
    +        }
    +        public static TaskType fromSerializedValue(byte serializedValue) {
    --- End diff --
    
    Why do we need this serialization logic? @twdsilva @kadirozde 
    I see that it has been copied from `LinkType` and other Enum's defined 
above.


---

Reply via email to