HBASE-25439 Add BYTE unit in PrettyPrinter.Unit (addendum) (#2841)

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Baiqiang Zhao 2021-01-15 13:45:08 +08:00 committed by GitHub
parent 3cc2468300
commit 3d34623163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -251,6 +251,7 @@ public class TableDescriptorBuilder {
public static PrettyPrinter.Unit getUnit(String key) {
switch (key) {
case MAX_FILESIZE:
case MEMSTORE_FLUSHSIZE:
return PrettyPrinter.Unit.BYTE;
default:
return PrettyPrinter.Unit.NONE;

View File

@ -348,11 +348,15 @@ public class TestTableDescriptorBuilder {
"{TABLE_ATTRIBUTES => {DURABILITY => 'ASYNC_WAL'}}, {NAME => 'cf', BLOCKSIZE => '1000'}",
htd.toStringCustomizedValues());
htd = TableDescriptorBuilder.newBuilder(htd).setMaxFileSize("10737942528").build();
htd = TableDescriptorBuilder.newBuilder(htd)
.setMaxFileSize("10737942528")
.setMemStoreFlushSize("256MB")
.build();
assertEquals(
"'testStringCustomizedValues', " +
"{TABLE_ATTRIBUTES => {DURABILITY => 'ASYNC_WAL', "
+ "MAX_FILESIZE => '10737942528 B (10GB 512KB)'}}, {NAME => 'cf', BLOCKSIZE => '1000'}",
+ "MAX_FILESIZE => '10737942528 B (10GB 512KB)', "
+ "MEMSTORE_FLUSHSIZE => '268435456 B (256MB)'}}, {NAME => 'cf', BLOCKSIZE => '1000'}",
htd.toStringCustomizedValues());
}