Class ServerRegionReplicaUtil

java.lang.Object
org.apache.hadoop.hbase.client.RegionReplicaUtil
org.apache.hadoop.hbase.util.ServerRegionReplicaUtil

@Private public class ServerRegionReplicaUtil extends RegionReplicaUtil
Similar to RegionReplicaUtil but for the server side
  • Field Details

  • Constructor Details

  • Method Details

    • getRegionInfoForFs

      public static RegionInfo getRegionInfoForFs(RegionInfo regionInfo)
      Returns the regionInfo object to use for interacting with the file system.
      Returns:
      An RegionInfo object to interact with the filesystem
    • isReadOnly

      public static boolean isReadOnly(HRegion region)
      Returns whether this region replica can accept writes.
      Parameters:
      region - the HRegion object
      Returns:
      whether the replica is read only
    • shouldReplayRecoveredEdits

      public static boolean shouldReplayRecoveredEdits(HRegion region)
      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

      private static boolean isRegionReplicaReplicationEnabled(org.apache.hadoop.conf.Configuration conf)
      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)