You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ja...@apache.org on 2019/12/16 10:17:13 UTC

[hbase] branch branch-2.2 updated: HBASE-23582 Unbalanced braces in string representation of table descriptor

This is an automated email from the ASF dual-hosted git repository.

janh pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.2 by this push:
     new f091d29  HBASE-23582 Unbalanced braces in string representation of table descriptor
f091d29 is described below

commit f091d295b4bf13a1627963c12b1a781c92acf343
Author: Junegunn Choi <ju...@gmail.com>
AuthorDate: Mon Dec 16 18:35:15 2019 +0900

    HBASE-23582 Unbalanced braces in string representation of table descriptor
    
    Signed-off-by: Lijin Bin <bi...@apache.org>
    Signed-off-by: Jan Hentschel <ja...@apache.org>
---
 .../hadoop/hbase/client/TableDescriptorBuilder.java     |  2 ++
 .../hadoop/hbase/client/TestTableDescriptorBuilder.java | 17 +++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
index 7fcb6a7..6784c1f 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableDescriptorBuilder.java
@@ -1212,6 +1212,8 @@ public class TableDescriptorBuilder {
           }
           s.append("}");
         }
+
+        s.append("}");
       }
 
       s.append("}"); // end METHOD
diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestTableDescriptorBuilder.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestTableDescriptorBuilder.java
index ef64fc7..19f8721 100644
--- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestTableDescriptorBuilder.java
+++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestTableDescriptorBuilder.java
@@ -310,4 +310,21 @@ public class TestTableDescriptorBuilder {
             .build();
     assertEquals(42, htd.getPriority());
   }
+
+  @Test
+  public void testStringCustomizedValues() {
+    byte[] familyName = Bytes.toBytes("cf");
+    ColumnFamilyDescriptor hcd = ColumnFamilyDescriptorBuilder.newBuilder(familyName)
+            .setBlocksize(1000)
+            .build();
+    TableDescriptor htd = TableDescriptorBuilder.newBuilder(TableName.valueOf(name.getMethodName()))
+            .setColumnFamily(hcd)
+            .setDurability(Durability.ASYNC_WAL)
+            .build();
+
+    assertEquals(
+      "'testStringCustomizedValues', " +
+        "{TABLE_ATTRIBUTES => {DURABILITY => 'ASYNC_WAL'}}, {NAME => 'cf', BLOCKSIZE => '1000'}",
+      htd.toStringCustomizedValues());
+  }
 }