chrajeshbabu commented on a change in pull request #3124:
URL: https://github.com/apache/hbase/pull/3124#discussion_r608279896



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/client/ColumnFamilyDescriptorBuilder.java
##########
@@ -305,6 +308,30 @@
     RESERVED_KEYWORDS.add(new Bytes(Bytes.toBytes(IS_MOB)));
     RESERVED_KEYWORDS.add(new Bytes(Bytes.toBytes(MOB_THRESHOLD)));
     RESERVED_KEYWORDS.add(new 
Bytes(Bytes.toBytes(MOB_COMPACT_PARTITION_POLICY)));
+    initValidator();
+  }
+
+  private static void initValidator() {
+    ATTRIBUTE_VALIDATOR.put(DATA_BLOCK_ENCODING_BYTES,
+      (d) -> DataBlockEncoding.valueOf(d.toString()));
+    ATTRIBUTE_VALIDATOR.put(COMPRESSION_BYTES,
+      (ca) -> Compression.Algorithm.valueOf(ca.toString()));
+    ATTRIBUTE_VALIDATOR.put(BLOOMFILTER_BYTES, (bl) -> 
BloomType.valueOf(bl.toString()));
+    ATTRIBUTE_VALIDATOR.put(REPLICATION_SCOPE_BYTES, (rs) -> 
Integer.valueOf(rs.toString()));
+    ATTRIBUTE_VALIDATOR.put(MIN_VERSIONS_BYTES, (min) -> 
Integer.valueOf(min.toString()));
+    ATTRIBUTE_VALIDATOR.put(MAX_VERSIONS_BYTES, (max) -> 
Integer.valueOf(max.toString()));
+    ATTRIBUTE_VALIDATOR.put(BLOCKSIZE_BYTES, (bs) -> 
Integer.valueOf(bs.toString()));
+    ATTRIBUTE_VALIDATOR.put(KEEP_DELETED_CELLS_BYTES,
+      (k) -> KeepDeletedCells.valueOf(k.toString()));
+    ATTRIBUTE_VALIDATOR.put(TTL_BYTES, (ttl) -> 
Integer.valueOf(ttl.toString()));
+    ATTRIBUTE_VALIDATOR.put(DFS_REPLICATION_BYTES, (dr) -> 
Integer.valueOf(dr.toString()));
+    ATTRIBUTE_VALIDATOR.put(MOB_THRESHOLD_BYTES, (mt) -> 
Long.valueOf(mt.toString()));
+    ATTRIBUTE_VALIDATOR.put(MOB_COMPACT_PARTITION_POLICY_BYTES,
+      (mc) -> MobCompactPartitionPolicy.valueOf(mc.toString()));
+    ATTRIBUTE_VALIDATOR.put(IN_MEMORY_COMPACTION_BYTES,
+      (im) -> MemoryCompactionPolicy.valueOf(im.toString()));
+    ATTRIBUTE_VALIDATOR.put(COMPRESSION_COMPACT_BYTES,
+      (ca) -> Compression.Algorithm.valueOf(ca.toString()));

Review comment:
       TableDescriptorChecker handling most of the validations but checking for 
valid data block encoding is missed so added that so it should be fine both 
create and modify cases.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to