Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.hadoop.hbase.master.http;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

Expand Down Expand Up @@ -203,7 +204,7 @@ public void testGetFragmentationInfoTurnedOn() throws IOException {
conf.setBoolean("hbase.master.ui.fragmentation.enabled", true);
Map<String, Integer> fragmentationInfo = MasterStatusUtil.getFragmentationInfo(master, conf);
assertNotNull(fragmentationInfo);
assertEquals(1, fragmentationInfo.size());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this expected or something is broken?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, very good question.

So TestMasterStatusUtil.getFragmentationInfo() was originally part of MasterStatusServlet and I migrated it to the static util class under #6875 and added the unit tests.

Locally I got different results than in the master build but I thought this can be OK because the code invokes FSUtils.getTableFragmentation() which does:

Runs through the HBase rootdir and checks how many stores for each table have more than one file in them. Checks -ROOT- and hbase:meta too. The total percentage across all tables is stored under the special key "-TOTAL-".

As I understand, this can be different in many cases so I just end up checking here that the map is not empty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

assertFalse(fragmentationInfo.isEmpty());
}

@Test
Expand Down