@InterfaceAudience.Private public class FavoredNodeAssignmentHelper extends Object
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)).| Modifier and Type | Field and Description |
|---|---|
static short |
FAVORED_NODES_NUM |
static byte[] |
FAVOREDNODES_QUALIFIER |
| Constructor and Description |
|---|
FavoredNodeAssignmentHelper(List<ServerName> servers,
org.apache.hadoop.conf.Configuration conf) |
FavoredNodeAssignmentHelper(List<ServerName> servers,
RackManager rackManager) |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getFavoredNodes(List<ServerName> serverAddrList) |
static String |
getFavoredNodesAsString(List<ServerName> nodes) |
static ServerName[] |
getFavoredNodesList(byte[] favoredNodes) |
void |
initialize() |
Map<HRegionInfo,ServerName[]> |
placeSecondaryAndTertiaryWithRestrictions(Map<HRegionInfo,ServerName> primaryRSMap)
For regions that share the primary, avoid placing the secondary and tertiary
on a same RS.
|
static void |
updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes,
CatalogTracker catalogTracker)
Update meta table with favored nodes info
|
static void |
updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes,
org.apache.hadoop.conf.Configuration conf)
Update meta table with favored nodes info
|
public static final byte[] FAVOREDNODES_QUALIFIER
public static final short FAVORED_NODES_NUM
public FavoredNodeAssignmentHelper(List<ServerName> servers, org.apache.hadoop.conf.Configuration conf)
public FavoredNodeAssignmentHelper(List<ServerName> servers, RackManager rackManager)
public static void updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes, CatalogTracker catalogTracker) throws IOException
regionToFavoredNodes - catalogTracker - IOExceptionpublic static void updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes, org.apache.hadoop.conf.Configuration conf) throws IOException
regionToFavoredNodes - conf - IOExceptionpublic static ServerName[] getFavoredNodesList(byte[] favoredNodes) throws com.google.protobuf.InvalidProtocolBufferException
favoredNodes - The PB'ed bytes of favored nodesServerName for the byte array of favored nodes.com.google.protobuf.InvalidProtocolBufferExceptionpublic static byte[] getFavoredNodes(List<ServerName> serverAddrList)
serverAddrList - HBaseProtos.FavoredNodes generated by the server list.public Map<HRegionInfo,ServerName[]> placeSecondaryAndTertiaryWithRestrictions(Map<HRegionInfo,ServerName> primaryRSMap)
primaryRSMap - IOExceptionpublic void initialize()
public static String getFavoredNodesAsString(List<ServerName> nodes)
Copyright © 2014 The Apache Software Foundation. All rights reserved.