Package org.apache.hadoop.hbase.util
Class ServerRegionReplicaUtil
java.lang.Object
org.apache.hadoop.hbase.client.RegionReplicaUtil
org.apache.hadoop.hbase.util.ServerRegionReplicaUtil
Similar to
RegionReplicaUtil
but for the server side-
Field Summary
Modifier and TypeFieldDescriptionprivate static final boolean
private static final boolean
private static final boolean
private static final double
static final String
Same as forREGION_REPLICA_REPLICATION_CONF_KEY
but for catalog replication.static final String
Whether asynchronous WAL replication to the secondary region replicas is enabled or not.static final String
Deprecated.Since 3.0.0, leave here only for implementing compatibility code.static final String
Enables or disables refreshing store files of secondary region replicas when the memory is above the global memstore lower limit.static final String
The multiplier to use when we want to refresh a secondary region instead of flushing a primary region.Fields inherited from class org.apache.hadoop.hbase.client.RegionReplicaUtil
DEFAULT_REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH, REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RegionInfo
getRegionInfoForFs
(RegionInfo regionInfo) Returns the regionInfo object to use for interacting with the file system.static double
getRegionReplicaStoreFileRefreshMultiplier
(org.apache.hadoop.conf.Configuration conf) static StoreFileInfo
getStoreFileInfo
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, RegionInfo regionInfo, RegionInfo regionInfoForFs, String familyName, org.apache.hadoop.fs.Path path, StoreFileTracker tracker) Returns a StoreFileInfo from the given FileStatus.static boolean
isMetaRegionReplicaReplicationEnabled
(org.apache.hadoop.conf.Configuration conf, TableName tn) Returns True if hbase:meta Region Read Replica is enabled.static boolean
isReadOnly
(HRegion region) Returns whether this region replica can accept writes.private static boolean
isRegionReplicaReplicationEnabled
(org.apache.hadoop.conf.Configuration conf) Returns True if Region Read Replica is enabled for user-space tables.static boolean
isRegionReplicaReplicationEnabled
(org.apache.hadoop.conf.Configuration conf, TableName tn) static boolean
isRegionReplicaStoreFileRefreshEnabled
(org.apache.hadoop.conf.Configuration conf) Returns True if we are to refresh user-space hfiles in Region Read Replicas.static boolean
isRegionReplicaWaitForPrimaryFlushEnabled
(org.apache.hadoop.conf.Configuration conf) Returns True if wait for primary to flush is enabled for user-space tables.static boolean
shouldReplayRecoveredEdits
(HRegion region) Returns whether to replay the recovered edits to flush the results.Methods inherited from class org.apache.hadoop.hbase.client.RegionReplicaUtil
addReplicas, getRegionInfoForDefaultReplica, getRegionInfoForReplica, isDefaultReplica, isDefaultReplica, isReplicasForSameRegion, removeNonDefaultRegions
-
Field Details
-
REGION_REPLICA_REPLICATION_CONF_KEY
Whether asynchronous WAL replication to the secondary region replicas is enabled or not. If this is enabled, a replication peer named "region_replica_replication" will be created which will tail the logs and replicate the mutatations to region replicas for tables that have region replication > 1. If this is enabled once, disabling this replication also requires disabling the replication peer using shell orAdmin
java class. Replication to secondary region replicas works over standard inter-cluster replication.ยท- See Also:
-
DEFAULT_REGION_REPLICA_REPLICATION
- See Also:
-
REGION_REPLICA_REPLICATION_PEER
Deprecated.Since 3.0.0, leave here only for implementing compatibility code.- See Also:
-
REGION_REPLICA_REPLICATION_CATALOG_CONF_KEY
Same as forREGION_REPLICA_REPLICATION_CONF_KEY
but for catalog replication.- See Also:
-
DEFAULT_REGION_REPLICA_REPLICATION_CATALOG
- See Also:
-
REGION_REPLICA_STORE_FILE_REFRESH
Enables or disables refreshing store files of secondary region replicas when the memory is above the global memstore lower limit. Refreshing the store files means that we will do a file list of the primary regions store files, and pick up new files. Also depending on the store files, we can drop some memstore contents which will free up memory.- See Also:
-
DEFAULT_REGION_REPLICA_STORE_FILE_REFRESH
- See Also:
-
REGION_REPLICA_STORE_FILE_REFRESH_MEMSTORE_MULTIPLIER
The multiplier to use when we want to refresh a secondary region instead of flushing a primary region. Default value assumes that for doing the file refresh, the biggest secondary should be 4 times bigger than the biggest primary.- See Also:
-
DEFAULT_REGION_REPLICA_STORE_FILE_REFRESH_MEMSTORE_MULTIPLIER
- See Also:
-
-
Constructor Details
-
ServerRegionReplicaUtil
public ServerRegionReplicaUtil()
-
-
Method Details
-
getRegionInfoForFs
Returns the regionInfo object to use for interacting with the file system.- Returns:
- An RegionInfo object to interact with the filesystem
-
isReadOnly
Returns whether this region replica can accept writes.- Parameters:
region
- the HRegion object- Returns:
- whether the replica is read only
-
shouldReplayRecoveredEdits
Returns whether to replay the recovered edits to flush the results. Currently secondary region replicas do not replay the edits, since it would cause flushes which might affect the primary region. Primary regions even opened in read only mode should replay the edits.- Parameters:
region
- the HRegion object- Returns:
- whether recovered edits should be replayed.
-
getStoreFileInfo
public static StoreFileInfo getStoreFileInfo(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, RegionInfo regionInfo, RegionInfo regionInfoForFs, String familyName, org.apache.hadoop.fs.Path path, StoreFileTracker tracker) throws IOException Returns a StoreFileInfo from the given FileStatus. Secondary replicas refer to the files of the primary region, so an HFileLink is used to construct the StoreFileInfo. This way ensures that the secondary will be able to continue reading the store files even if they are moved to archive after compaction- Throws:
IOException
-
isRegionReplicaReplicationEnabled
public static boolean isRegionReplicaReplicationEnabled(org.apache.hadoop.conf.Configuration conf, TableName tn) - Returns:
- True if Region Read Replica is enabled for
tn
(whether hbase:meta or user-space tables).
-
isRegionReplicaReplicationEnabled
Returns True if Region Read Replica is enabled for user-space tables. -
isMetaRegionReplicaReplicationEnabled
public static boolean isMetaRegionReplicaReplicationEnabled(org.apache.hadoop.conf.Configuration conf, TableName tn) Returns True if hbase:meta Region Read Replica is enabled. -
isRegionReplicaWaitForPrimaryFlushEnabled
public static boolean isRegionReplicaWaitForPrimaryFlushEnabled(org.apache.hadoop.conf.Configuration conf) Returns True if wait for primary to flush is enabled for user-space tables. -
isRegionReplicaStoreFileRefreshEnabled
public static boolean isRegionReplicaStoreFileRefreshEnabled(org.apache.hadoop.conf.Configuration conf) Returns True if we are to refresh user-space hfiles in Region Read Replicas. -
getRegionReplicaStoreFileRefreshMultiplier
public static double getRegionReplicaStoreFileRefreshMultiplier(org.apache.hadoop.conf.Configuration conf)
-