From ec317a6629dd7d9b8b19f29d9efbf45ac3292bc7 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 16 Dec 2019 18:35:15 +0900 Subject: [PATCH] HBASE-23582 Unbalanced braces in string representation of table descriptor Signed-off-by: Lijin Bin Signed-off-by: Jan Hentschel --- .../hbase/client/TableDescriptorBuilder.java | 2 ++ .../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 037a7f860cb..b97e85aab3b 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 @@ -1183,6 +1183,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 ef64fc7e747..19f872193b8 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()); + } }