Class HRegionInfo

java.lang.Object
org.apache.hadoop.hbase.HRegionInfo
All Implemented Interfaces:
Comparable<RegionInfo>, RegionInfo
Direct Known Subclasses:
HbckRegionInfo.MetaEntry, ImmutableHRegionInfo, UnmodifyableHRegionInfo

@Deprecated @Public public class HRegionInfo extends Object implements RegionInfo
Deprecated.
As of release 2.0.0, this will be removed in HBase 3.0.0. use RegionInfoBuilder to build RegionInfo.
Information about a region. A region is a range of keys in the whole keyspace of a table, an identifier (a timestamp) for differentiating between subset ranges (after region split) and a replicaId for differentiating the instance for the same range and some status information about the region. The region has a unique name which consists of the following fields:
  • tableName : The name of the table
  • startKey : The startKey for the region.
  • regionId : A timestamp when the region is created.
  • replicaId : An id starting from 0 to differentiate replicas of the same region range but hosted in separated servers. The same region range can be hosted in multiple locations.
  • encodedName : An MD5 encoded string for the region name.

Other than the fields in the region name, region info contains:
  • endKey : the endKey for the region (exclusive)
  • split : Whether the region is split
  • offline : Whether the region is offline
In 0.98 or before, a list of table's regions would fully cover the total keyspace, and at any point in time, a row key always belongs to a single region, which is hosted in a single server. In 0.99+, a region can have multiple instances (called replicas), and thus a range (or row) can correspond to multiple HRegionInfo's. These HRI's share the same fields however except the replicaId field. If the replicaId is not set, it defaults to 0, which is compatible with the previous behavior of a range corresponding to 1 region.
  • Field Details

  • Constructor Details

    • HRegionInfo

      private HRegionInfo(long regionId, TableName tableName)
      Deprecated.
      Private constructor used constructing HRegionInfo for the first meta regions
    • HRegionInfo

      public HRegionInfo(long regionId, TableName tableName, int replicaId)
      Deprecated.
    • HRegionInfo

      public HRegionInfo(TableName tableName)
      Deprecated.
    • HRegionInfo

      public HRegionInfo(TableName tableName, byte[] startKey, byte[] endKey) throws IllegalArgumentException
      Deprecated.
      Construct HRegionInfo with explicit parameters
      Parameters:
      tableName - the table name
      startKey - first key in region
      endKey - end of key range
      Throws:
      IllegalArgumentException
    • HRegionInfo

      public HRegionInfo(TableName tableName, byte[] startKey, byte[] endKey, boolean split) throws IllegalArgumentException
      Deprecated.
      Construct HRegionInfo with explicit parameters
      Parameters:
      tableName - the table name
      startKey - first key in region
      endKey - end of key range
      split - true if this region has split and we have daughter regions regions that may or may not hold references to this region.
      Throws:
      IllegalArgumentException
    • HRegionInfo

      public HRegionInfo(TableName tableName, byte[] startKey, byte[] endKey, boolean split, long regionId) throws IllegalArgumentException
      Deprecated.
      Construct HRegionInfo with explicit parameters
      Parameters:
      tableName - the table name
      startKey - first key in region
      endKey - end of key range
      split - true if this region has split and we have daughter regions regions that may or may not hold references to this region.
      regionId - Region id to use.
      Throws:
      IllegalArgumentException
    • HRegionInfo

      public HRegionInfo(TableName tableName, byte[] startKey, byte[] endKey, boolean split, long regionId, int replicaId) throws IllegalArgumentException
      Deprecated.
      Construct HRegionInfo with explicit parameters
      Parameters:
      tableName - the table name
      startKey - first key in region
      endKey - end of key range
      split - true if this region has split and we have daughter regions regions that may or may not hold references to this region.
      regionId - Region id to use.
      replicaId - the replicaId to use
      Throws:
      IllegalArgumentException
    • HRegionInfo

      public HRegionInfo(RegionInfo other)
      Deprecated.
      Construct a copy of another HRegionInfo
    • HRegionInfo

      public HRegionInfo(HRegionInfo other, int replicaId)
      Deprecated.
  • Method Details