@InterfaceAudience.Private public class RegionPlacementMaintainer extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
RegionPlacementMaintainer.RandomizedMatrix
Some algorithms for solving the assignment problem may traverse workers or
jobs in linear order which may result in skewing the assignments of the
first jobs in the matrix toward the last workers in the matrix if the
costs are uniform.
|
Constructor and Description |
---|
RegionPlacementMaintainer(org.apache.hadoop.conf.Configuration conf) |
RegionPlacementMaintainer(org.apache.hadoop.conf.Configuration conf,
boolean enforceLocality,
boolean enforceMinAssignmentMove) |
Modifier and Type | Method and Description |
---|---|
void |
checkDifferencesWithOldPlan(Map<TableName,Integer> movesPerTable,
Map<String,Map<String,Float>> regionLocalityMap,
FavoredNodesPlan newPlan)
Compares two plans and check whether the locality dropped or increased
(prints the information as a string) also prints the baseline locality
|
static List<ServerName> |
getFavoredNodeList(String favoredNodesStr) |
FavoredNodesPlan |
getNewAssignmentPlan() |
SnapshotOfRegionAssignmentFromMeta |
getRegionAssignmentSnapshot() |
Map<TableName,Integer> |
getRegionsMovement(FavoredNodesPlan newPlan)
Return how many regions will move per table since their primary RS will
change
|
static void |
main(String[] args) |
static void |
printAssignmentPlan(FavoredNodesPlan plan)
Print the assignment plan to the system output stream
|
void |
printDispersionScores(TableName table,
SnapshotOfRegionAssignmentFromMeta snapshot,
int numRegions,
FavoredNodesPlan newPlan,
boolean simplePrint) |
void |
printLocalityAndDispersionForCurrentPlan(Map<String,Map<String,Float>> regionLocalityMap) |
void |
setTargetTableName(String[] tableNames) |
void |
updateAssignmentPlan(FavoredNodesPlan plan) |
void |
updateAssignmentPlanToMeta(FavoredNodesPlan plan)
Update the assignment plan into hbase:meta
|
List<AssignmentVerificationReport> |
verifyRegionPlacement(boolean isDetailMode)
Verify the region placement is consistent with the assignment plan
|
public RegionPlacementMaintainer(org.apache.hadoop.conf.Configuration conf)
public RegionPlacementMaintainer(org.apache.hadoop.conf.Configuration conf, boolean enforceLocality, boolean enforceMinAssignmentMove)
public void setTargetTableName(String[] tableNames)
public SnapshotOfRegionAssignmentFromMeta getRegionAssignmentSnapshot() throws IOException
IOException
public List<AssignmentVerificationReport> verifyRegionPlacement(boolean isDetailMode) throws IOException
isDetailMode
- IOException
public FavoredNodesPlan getNewAssignmentPlan() throws IOException
IOException
public static void printAssignmentPlan(FavoredNodesPlan plan)
plan
- public void updateAssignmentPlanToMeta(FavoredNodesPlan plan) throws IOException
plan
- the assignments plan to be updated into hbase:metaIOException
- if cannot update assignment plan in hbase:metapublic void updateAssignmentPlan(FavoredNodesPlan plan) throws IOException
IOException
public Map<TableName,Integer> getRegionsMovement(FavoredNodesPlan newPlan) throws IOException
newPlan
- - new AssignmentPlanIOException
public void checkDifferencesWithOldPlan(Map<TableName,Integer> movesPerTable, Map<String,Map<String,Float>> regionLocalityMap, FavoredNodesPlan newPlan) throws IOException
movesPerTable
- - how many primary regions will move per tableregionLocalityMap
- - locality map from FSnewPlan
- - new assignment planIOException
public void printDispersionScores(TableName table, SnapshotOfRegionAssignmentFromMeta snapshot, int numRegions, FavoredNodesPlan newPlan, boolean simplePrint)
public void printLocalityAndDispersionForCurrentPlan(Map<String,Map<String,Float>> regionLocalityMap) throws IOException
IOException
public static List<ServerName> getFavoredNodeList(String favoredNodesStr)
favoredNodesStr
- The String of favored nodespublic static void main(String[] args) throws IOException
IOException
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.