org.apache.hadoop.hbase.master.balancer
Class FavoredNodeAssignmentHelper
java.lang.Object
org.apache.hadoop.hbase.master.balancer.FavoredNodeAssignmentHelper
@InterfaceAudience.Private
public class FavoredNodeAssignmentHelper
- extends Object
Helper class for FavoredNodeLoadBalancer
that has all the intelligence
for racks, meta scans, etc. Instantiated by the FavoredNodeLoadBalancer
when needed (from within calls like
FavoredNodeLoadBalancer.randomAssignment(HRegionInfo, List)
).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FAVOREDNODES_QUALIFIER
public static final byte[] FAVOREDNODES_QUALIFIER
FAVORED_NODES_NUM
public static final short FAVORED_NODES_NUM
- See Also:
- Constant Field Values
FavoredNodeAssignmentHelper
public FavoredNodeAssignmentHelper(List<ServerName> servers,
org.apache.hadoop.conf.Configuration conf)
FavoredNodeAssignmentHelper
public FavoredNodeAssignmentHelper(List<ServerName> servers,
RackManager rackManager)
updateMetaWithFavoredNodesInfo
public static void updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes,
CatalogTracker catalogTracker)
throws IOException
- Update meta table with favored nodes info
- Parameters:
regionToFavoredNodes
- catalogTracker
-
- Throws:
IOException
updateMetaWithFavoredNodesInfo
public static void updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes,
org.apache.hadoop.conf.Configuration conf)
throws IOException
- Update meta table with favored nodes info
- Parameters:
regionToFavoredNodes
- conf
-
- Throws:
IOException
getFavoredNodesList
public static ServerName[] getFavoredNodesList(byte[] favoredNodes)
throws com.google.protobuf.InvalidProtocolBufferException
- Parameters:
favoredNodes
- The PB'ed bytes of favored nodes
- Returns:
- the array of
ServerName
for the byte array of favored nodes.
- Throws:
com.google.protobuf.InvalidProtocolBufferException
getFavoredNodes
public static byte[] getFavoredNodes(List<ServerName> serverAddrList)
- Parameters:
serverAddrList
-
- Returns:
- PB'ed bytes of
HBaseProtos.FavoredNodes
generated by the server list.
placeSecondaryAndTertiaryWithRestrictions
public Map<HRegionInfo,ServerName[]> placeSecondaryAndTertiaryWithRestrictions(Map<HRegionInfo,ServerName> primaryRSMap)
- For regions that share the primary, avoid placing the secondary and tertiary
on a same RS. Used for generating new assignments for the
primary/secondary/tertiary RegionServers
- Parameters:
primaryRSMap
-
- Returns:
- the map of regions to the servers the region-files should be hosted on
- Throws:
IOException
initialize
public void initialize()
getFavoredNodesAsString
public static String getFavoredNodesAsString(List<ServerName> nodes)
Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.