HBASE-16209 Removed unnecessary method and method calls from AssignmentManager and AssignmentManager UI (addendum)

Signed-off-by: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
This commit is contained in:
Joseph Hwang 2016-07-29 13:21:50 -07:00 committed by Matteo Bertozzi
parent 7c97acf6e3
commit 39153b8824
3 changed files with 3 additions and 7 deletions

View File

@ -108,12 +108,11 @@ int numOfPages = (int) Math.ceil(numOfRITs * 1.0 / ritsPerPage);
</%if>
<%java>
String retryStatus = "0";
String name = rs.getRegion().getEncodedName();
RegionState state = assignmentManager.getState(name);
AtomicInteger numOpenRetries = failedRegionTracker.get(name);
AtomicInteger numOpenRetries = failedRegionTracker.get(
rs.getRegion().getEncodedName());
if (numOpenRetries != null ) {
retryStatus = Integer.toString(numOpenRetries.get());
} else if (state.getState() == RegionState.State.FAILED_OPEN) {
} else if (rs.getState() == RegionState.State.FAILED_OPEN) {
retryStatus = "Failed";
}
</%java>

View File

@ -4275,8 +4275,6 @@ public class AssignmentManager extends ZooKeeperListener {
public Map<String, AtomicInteger> getFailedOpenTracker() {return failedOpenTracker;}
public RegionState getState(String encodedName) {return regionStates.getRegionState(encodedName);}
/**
* A region is offline. The new state should be the specified one,
* if not null. If the specified state is null, the new state is Offline.

View File

@ -173,7 +173,6 @@ public class TestMasterStatusServlet {
Mockito.doReturn(rs).when(am).getRegionStates();
Mockito.doReturn(regionsInTransition).when(rs).getRegionsInTransition();
Mockito.doReturn(regionsInTransition).when(rs).getRegionsInTransitionOrderedByTimestamp();
Mockito.when(am.getState(any(String.class))).thenReturn(new RegionState(null, null));
// Render to a string
StringWriter sw = new StringWriter();