@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,
org.apache.hadoop.conf.Configuration conf)
Update meta table with favored nodes info
|
static void |
updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes,
Connection connection)
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, Connection connection) throws IOException
regionToFavoredNodes
- map of HRegionInfo's to their favored nodesconnection
- connection to be usedIOException
public static void updateMetaWithFavoredNodesInfo(Map<HRegionInfo,List<ServerName>> regionToFavoredNodes, org.apache.hadoop.conf.Configuration conf) throws IOException
regionToFavoredNodes
- conf
- IOException
public 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.InvalidProtocolBufferException
public static byte[] getFavoredNodes(List<ServerName> serverAddrList)
serverAddrList
- HBaseProtos.FavoredNodes
generated by the server list.public Map<HRegionInfo,ServerName[]> placeSecondaryAndTertiaryWithRestrictions(Map<HRegionInfo,ServerName> primaryRSMap)
primaryRSMap
- public void initialize()
public static String getFavoredNodesAsString(List<ServerName> nodes)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.