HorizonNet commented on a change in pull request #1222: HBASE-23868 : Replace
usages of HColumnDescriptor(byte [] familyName)…
URL: https://github.com/apache/hbase/pull/1222#discussion_r385963635
##########
File path:
hbase-client/src/test/java/org/apache/hadoop/hbase/TestHTableDescriptor.java
##########
@@ -309,41 +312,52 @@ public void testClassMethodsAreBuilderStyle() {
@Test
public void testModifyFamily() {
- HTableDescriptor htd = new
HTableDescriptor(TableName.valueOf(name.getMethodName()));
+ TableDescriptorBuilder.ModifyableTableDescriptor tableDescriptor =
+ new TableDescriptorBuilder.ModifyableTableDescriptor(
+ TableName.valueOf(name.getMethodName()));
byte[] familyName = Bytes.toBytes("cf");
- HColumnDescriptor hcd = new HColumnDescriptor(familyName);
- hcd.setBlocksize(1000);
- hcd.setDFSReplication((short) 3);
- htd.addFamily(hcd);
- assertEquals(1000, htd.getFamily(familyName).getBlocksize());
- assertEquals(3, htd.getFamily(familyName).getDFSReplication());
- hcd = new HColumnDescriptor(familyName);
- hcd.setBlocksize(2000);
- hcd.setDFSReplication((short) 1);
- htd.modifyFamily(hcd);
- assertEquals(2000, htd.getFamily(familyName).getBlocksize());
- assertEquals(1, htd.getFamily(familyName).getDFSReplication());
+ ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor
familyDescriptor =
+ new
ColumnFamilyDescriptorBuilder.ModifyableColumnFamilyDescriptor(familyName);
+ familyDescriptor.setBlocksize(1000);
Review comment:
Better would be to use the fluent API, also for other occurrences in this
test class.
----------------------------------------------------------------
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]
With regards,
Apache Git Services