@InterfaceAudience.Private public class RegionReplicaUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEFAULT_REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH |
static String |
REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY
Whether or not the secondary region will wait for observing a flush / region open event
from the primary region via async wal replication before enabling read requests.
|
Constructor and Description |
---|
RegionReplicaUtil() |
Modifier and Type | Method and Description |
---|---|
static HRegionInfo |
getRegionInfoForDefaultReplica(HRegionInfo regionInfo)
Returns the HRegionInfo for the default replicaId (0).
|
static HRegionInfo |
getRegionInfoForReplica(HRegionInfo regionInfo,
int replicaId)
Returns the HRegionInfo for the given replicaId.
|
static boolean |
isDefaultReplica(HRegionInfo hri) |
static boolean |
isDefaultReplica(int replicaId) |
static boolean |
isReplicasForSameRegion(HRegionInfo regionInfoA,
HRegionInfo regionInfoB) |
static void |
removeNonDefaultRegions(Collection<HRegionInfo> regions)
Removes the non-default replicas from the passed regions collection
|
public static final String REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY
protected static final boolean DEFAULT_REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH
public static HRegionInfo getRegionInfoForReplica(HRegionInfo regionInfo, int replicaId)
replicaId
- the replicaId to usepublic static HRegionInfo getRegionInfoForDefaultReplica(HRegionInfo regionInfo)
public static boolean isDefaultReplica(int replicaId)
public static boolean isDefaultReplica(HRegionInfo hri)
public static void removeNonDefaultRegions(Collection<HRegionInfo> regions)
regions
- public static boolean isReplicasForSameRegion(HRegionInfo regionInfoA, HRegionInfo regionInfoB)
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.