LOG.debug("No user table region plans present for index table " + tableName + '.');
}
return null;
}
for (Entry<HRegionInfo, ServerName> e : regionMap.entrySet()) {
regionPlanList.add(new RegionPlan(e.getKey(), null, e.getValue()));
}
// for preparing the index plan
List<RegionPlan> indexPlanList = new ArrayList<RegionPlan>(1);
// copy of region plan to iterate.
List<RegionPlan> regionPlanListCopy = new ArrayList<RegionPlan>(regionPlanList);
if (LOG.isDebugEnabled()) {
LOG.debug("Preparing index region plans from user region plans for table " + tableName
+ ".");
}
return prepareIndexPlan(clusterState, indexPlanList, regionPlanListCopy);
} else {
regionPlanList = this.delegator.balanceCluster(userClusterState);
if (null == regionPlanList) {
if (LOG.isDebugEnabled()) {
LOG.debug("User region plan is null.");
}
regionPlanList = new ArrayList<RegionPlan>(1);
} else {
saveRegionPlanList(regionPlanList);
}
List<RegionPlan> userRegionPlans = new ArrayList<RegionPlan>(1);
for (Entry<String, Map<HRegionInfo, ServerName>> tableVsRegions : this.regionLocation
.entrySet()) {
Map<HRegionInfo, ServerName> regionMap = regionLocation.get(tableVsRegions.getKey());
// no previous region plan for user table.
if (null == regionMap) {
if (LOG.isDebugEnabled()) {
LOG.debug("No user table region plans present for index table " + tableName + '.');
}
} else {
for (Entry<HRegionInfo, ServerName> e : regionMap.entrySet()) {
userRegionPlans.add(new RegionPlan(e.getKey(), null, e.getValue()));
}
}
}
List<RegionPlan> regionPlanListCopy = new ArrayList<RegionPlan>(userRegionPlans);
if (LOG.isDebugEnabled()) {