Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A9D47200BC8 for ; Tue, 8 Nov 2016 15:23:28 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A8549160B12; Tue, 8 Nov 2016 14:23:28 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7900A160AFA for ; Tue, 8 Nov 2016 15:23:25 +0100 (CET) Received: (qmail 45401 invoked by uid 500); 8 Nov 2016 14:23:17 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 44352 invoked by uid 99); 8 Nov 2016 14:23:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 14:23:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id F2CA4E6810; Tue, 8 Nov 2016 14:23:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stack@apache.org To: commits@hbase.apache.org Date: Tue, 08 Nov 2016 14:23:42 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [30/51] [partial] hbase-site git commit: Added 1.1 archived-at: Tue, 08 Nov 2016 14:23:28 -0000 http://git-wip-us.apache.org/repos/asf/hbase-site/blob/8418e382/1.1/apidocs/org/apache/hadoop/hbase/HRegionInfo.html ---------------------------------------------------------------------- diff --git a/1.1/apidocs/org/apache/hadoop/hbase/HRegionInfo.html b/1.1/apidocs/org/apache/hadoop/hbase/HRegionInfo.html new file mode 100644 index 0000000..eae17b7 --- /dev/null +++ b/1.1/apidocs/org/apache/hadoop/hbase/HRegionInfo.html @@ -0,0 +1,1729 @@ + + + + + +HRegionInfo (Apache HBase 1.1.7 API) + + + + + + + + + + +
+
org.apache.hadoop.hbase
+

Class HRegionInfo

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<HRegionInfo>
    +
    +
    +
    +
    @InterfaceAudience.Public
    +@InterfaceStability.Evolving
    +public class HRegionInfo
    +extends Object
    +implements Comparable<HRegionInfo>
    +
    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.
+ + +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HRegionInfo

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

        HRegionInfo

        +
        @Deprecated
        +public HRegionInfo()
        +
        Deprecated. As of release 0.96 + (HBASE-5453). + This will be removed in HBase 2.0.0. + Used by Writables and Writables are going away.
        +
        Default constructor - creates empty object
        +
      • +
      + + + +
        +
      • +

        HRegionInfo

        +
        public HRegionInfo(TableName tableName)
        +
      • +
      + + + +
        +
      • +

        HRegionInfo

        +
        public HRegionInfo(TableName tableName,
        +           byte[] startKey,
        +           byte[] endKey)
        +            throws IllegalArgumentException
        +
        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
        +
        Construct HRegionInfo with explicit parameters
        +
        Parameters:
        tableName - the table descriptor
        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
        +
        Construct HRegionInfo with explicit parameters
        +
        Parameters:
        tableName - the table descriptor
        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
        +
        Construct HRegionInfo with explicit parameters
        +
        Parameters:
        tableName - the table descriptor
        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(HRegionInfo other)
        +
        Costruct a copy of another HRegionInfo
        +
        Parameters:
        other -
        +
      • +
      + + + +
        +
      • +

        HRegionInfo

        +
        public HRegionInfo(HRegionInfo other,
        +           int replicaId)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        encodeRegionName

        +
        public static String encodeRegionName(byte[] regionName)
        +
        Parameters:
        regionName -
        +
        Returns:
        the encodedName
        +
      • +
      + + + +
        +
      • +

        getShortNameToLog

        +
        public String getShortNameToLog()
        +
        Returns:
        Return a short, printable name for this region (usually encoded name) for us logging.
        +
      • +
      + + + +
        +
      • +

        prettyPrint

        +
        public static String prettyPrint(String encodedRegionName)
        +
        Use logging.
        +
        Parameters:
        encodedRegionName - The encoded regionname.
        +
        Returns:
        hbase:meta if passed 1028785192 else returns + encodedRegionName
        +
      • +
      + + + +
        +
      • +

        createRegionName

        +
        public static byte[] createRegionName(TableName tableName,
        +                      byte[] startKey,
        +                      long regionid,
        +                      boolean newFormat)
        +
        Make a region name of passed parameters.
        +
        Parameters:
        tableName -
        startKey - Can be null
        regionid - Region id (Usually timestamp from when region was created).
        newFormat - should we create the region name in the new format + (such that it contains its encoded name?).
        +
        Returns:
        Region name made of passed tableName, startKey and id
        +
      • +
      + + + +
        +
      • +

        createRegionName

        +
        public static byte[] createRegionName(TableName tableName,
        +                      byte[] startKey,
        +                      String id,
        +                      boolean newFormat)
        +
        Make a region name of passed parameters.
        +
        Parameters:
        tableName -
        startKey - Can be null
        id - Region id (Usually timestamp from when region was created).
        newFormat - should we create the region name in the new format + (such that it contains its encoded name?).
        +
        Returns:
        Region name made of passed tableName, startKey and id
        +
      • +
      + + + +
        +
      • +

        createRegionName

        +
        public static byte[] createRegionName(TableName tableName,
        +                      byte[] startKey,
        +                      long regionid,
        +                      int replicaId,
        +                      boolean newFormat)
        +
        Make a region name of passed parameters.
        +
        Parameters:
        tableName -
        startKey - Can be null
        regionid - Region id (Usually timestamp from when region was created).
        replicaId -
        newFormat - should we create the region name in the new format + (such that it contains its encoded name?).
        +
        Returns:
        Region name made of passed tableName, startKey, id and replicaId
        +
      • +
      + + + +
        +
      • +

        createRegionName

        +
        public static byte[] createRegionName(TableName tableName,
        +                      byte[] startKey,
        +                      byte[] id,
        +                      boolean newFormat)
        +
        Make a region name of passed parameters.
        +
        Parameters:
        tableName -
        startKey - Can be null
        id - Region id (Usually timestamp from when region was created).
        newFormat - should we create the region name in the new format + (such that it contains its encoded name?).
        +
        Returns:
        Region name made of passed tableName, startKey and id
        +
      • +
      + + + +
        +
      • +

        createRegionName

        +
        public static byte[] createRegionName(TableName tableName,
        +                      byte[] startKey,
        +                      byte[] id,
        +                      int replicaId,
        +                      boolean newFormat)
        +
        Make a region name of passed parameters.
        +
        Parameters:
        tableName -
        startKey - Can be null
        id - Region id (Usually timestamp from when region was created).
        replicaId -
        newFormat - should we create the region name in the new format
        +
        Returns:
        Region name made of passed tableName, startKey, id and replicaId
        +
      • +
      + + + +
        +
      • +

        getTableName

        +
        @Deprecated
        +public static byte[] getTableName(byte[] regionName)
        +
        Deprecated. As of release 0.96 + (HBASE-9508). + This will be removed in HBase 2.0.0. Use getTable(byte[]).
        +
        Gets the table name from the specified region name.
        +
        Parameters:
        regionName -
        +
        Returns:
        Table name.
        +
      • +
      + + + + + + + +
        +
      • +

        getStartKey

        +
        public static byte[] getStartKey(byte[] regionName)
        +                          throws IOException
        +
        Gets the start key from the specified region name.
        +
        Parameters:
        regionName -
        +
        Returns:
        Start key.
        +
        Throws:
        +
        IOException
        +
      • +
      + + + +
        +
      • +

        parseRegionName

        +
        public static byte[][] parseRegionName(byte[] regionName)
        +                                throws IOException
        +
        Separate elements of a regionName.
        +
        Parameters:
        regionName -
        +
        Returns:
        Array of byte[] containing tableName, startKey and id
        +
        Throws:
        +
        IOException
        +
      • +
      + + + +
        +
      • +

        getRegionId

        +
        public long getRegionId()
        +
        Returns:
        the regionId
        +
      • +
      + + + +
        +
      • +

        getRegionName

        +
        public byte[] getRegionName()
        +
        Returns:
        the regionName as an array of bytes.
        See Also:
        getRegionNameAsString()
        +
      • +
      + + + +
        +
      • +

        getRegionNameAsString

        +
        public String getRegionNameAsString()
        +
        Returns:
        Region name as a String for use in logging, etc.
        +
      • +
      + + + +
        +
      • +

        getEncodedName

        +
        public String getEncodedName()
        +
        Returns:
        the encoded region name
        +
      • +
      + + + +
        +
      • +

        getEncodedNameAsBytes

        +
        public byte[] getEncodedNameAsBytes()
        +
      • +
      + + + +
        +
      • +

        getStartKey

        +
        public byte[] getStartKey()
        +
        Returns:
        the startKey
        +
      • +
      + + + +
        +
      • +

        getEndKey

        +
        public byte[] getEndKey()
        +
        Returns:
        the endKey
        +
      • +
      + + + +
        +
      • +

        getTableName

        +
        @Deprecated
        +public byte[] getTableName()
        +
        Deprecated. As of release 0.96 + (HBASE-9508). + This will be removed in HBase 2.0.0. Use getTable().
        +
        Get current table name of the region
        +
        Returns:
        byte array of table name
        +
      • +
      + + + +
        +
      • +

        getTable

        +
        public TableName getTable()
        +
        Get current table name of the region
        +
        Returns:
        TableName
        See Also:
        getTableName()
        +
      • +
      + + + +
        +
      • +

        containsRange

        +
        public boolean containsRange(byte[] rangeStartKey,
        +                    byte[] rangeEndKey)
        +
        Returns true if the given inclusive range of rows is fully contained + by this region. For example, if the region is foo,a,g and this is + passed ["b","c"] or ["a","c"] it will return true, but if this is passed + ["b","z"] it will return false.
        +
        Throws:
        +
        IllegalArgumentException - if the range passed is invalid (ie end < start)
        +
      • +
      + + + +
        +
      • +

        containsRow

        +
        public boolean containsRow(byte[] row)
        +
        Return true if the given row falls in this region.
        +
      • +
      + + + +
        +
      • +

        isMetaTable

        +
        public boolean isMetaTable()
        +
        Returns:
        true if this region is from hbase:meta
        +
      • +
      + + + +
        +
      • +

        isMetaRegion

        +
        public boolean isMetaRegion()
        +
        Returns:
        true if this region is a meta region
        +
      • +
      + + + +
        +
      • +

        isSystemTable

        +
        public boolean isSystemTable()
        +
        Returns:
        true if this region is from a system table
        +
      • +
      + + + +
        +
      • +

        isSplit

        +
        public boolean isSplit()
        +
        Returns:
        True if has been split and has daughters.
        +
      • +
      + + + +
        +
      • +

        setSplit

        +
        public void setSplit(boolean split)
        +
        Parameters:
        split - set split status
        +
      • +
      + + + +
        +
      • +

        isOffline

        +
        public boolean isOffline()
        +
        Returns:
        True if this region is offline.
        +
      • +
      + + + +
        +
      • +

        setOffline

        +
        public void setOffline(boolean offLine)
        +
        The parent of a region split is offline while split daughters hold + references to the parent. Offlined regions are closed.
        +
        Parameters:
        offLine - Set online/offline status.
        +
      • +
      + + + +
        +
      • +

        isSplitParent

        +
        public boolean isSplitParent()
        +
        Returns:
        True if this is a split parent region.
        +
      • +
      + + + +
        +
      • +

        getReplicaId

        +
        public int getReplicaId()
        +
        Returns the region replica id
        +
        Returns:
        returns region replica id
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        getVersion

        +
        @Deprecated
        +public byte getVersion()
        +
        Deprecated. HRI is no longer a VersionedWritable
        +
        Returns:
        the object version number
        +
      • +
      + + + + + + + + + + + + + + + +
        +
      • +

        getComparator

        +
        public org.apache.hadoop.hbase.KeyValue.KVComparator getComparator()
        +
        Returns:
        Comparator to use comparing KeyValues.
        +
      • +
      + + + +
        +
      • +

        convert

        +
        public static org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionInfo convert(HRegionInfo info)
        +
        Convert a HRegionInfo to a RegionInfo
        +
        Parameters:
        info - the HRegionInfo to convert
        +
        Returns:
        the converted RegionInfo
        +
      • +
      + + + +
        +
      • +

        convert

        +
        public static HRegionInfo convert(org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionInfo proto)
        +
        Convert a RegionInfo to a HRegionInfo
        +
        Parameters:
        proto - the RegionInfo to convert
        +
        Returns:
        the converted HRegionInfho
        +
      • +
      + + + +
        +
      • +

        toByteArray

        +
        public byte[] toByteArray()
        +
        Returns:
        This instance serialized as protobuf w/ a magic pb prefix.
        See Also:
        parseFrom(byte[])
        +
      • +
      + + + +
        +
      • +

        parseFromOrNull

        +
        public static HRegionInfo parseFromOrNull(byte[] bytes)
        +
        Returns:
        A deserialized HRegionInfo + or null if we failed deserialize or passed bytes null
        See Also:
        toByteArray()
        +
      • +
      + + + +
        +
      • +

        parseFromOrNull

        +
        public static HRegionInfo parseFromOrNull(byte[] bytes,
        +                          int offset,
        +                          int len)
        +
        Returns:
        A deserialized HRegionInfo or null + if we failed deserialize or passed bytes null
        See Also:
        toByteArray()
        +
      • +
      + + + +
        +
      • +

        parseFrom

        +
        public static HRegionInfo parseFrom(byte[] bytes)
        +                             throws org.apache.hadoop.hbase.exceptions.DeserializationException
        +
        Parameters:
        bytes - A pb RegionInfo serialized with a pb magic prefix.
        +
        Returns:
        A deserialized HRegionInfo
        +
        Throws:
        +
        org.apache.hadoop.hbase.exceptions.DeserializationException
        See Also:
        toByteArray()
        +
      • +
      + + + +
        +
      • +

        parseFrom

        +
        public static HRegionInfo parseFrom(byte[] bytes,
        +                    int offset,
        +                    int len)
        +                             throws org.apache.hadoop.hbase.exceptions.DeserializationException
        +
        Parameters:
        bytes - A pb RegionInfo serialized with a pb magic prefix.
        offset - starting point in the byte array
        len - length to read on the byte array
        +
        Returns:
        A deserialized HRegionInfo
        +
        Throws:
        +
        org.apache.hadoop.hbase.exceptions.DeserializationException
        See Also:
        toByteArray()
        +
      • +
      + + + +
        +
      • +

        toDelimitedByteArray

        +
        public byte[] toDelimitedByteArray()
        +                            throws IOException
        +
        Use this instead of toByteArray() when writing to a stream and you want to use + the pb mergeDelimitedFrom (w/o the delimiter, pb reads to EOF which may not be what you want).
        +
        Returns:
        This instance serialized as a delimited protobuf w/ a magic pb prefix.
        +
        Throws:
        +
        IOException
        See Also:
        toByteArray()
        +
      • +
      + + + +
        +
      • +

        getHRegionInfoAndServerName

        +
        @Deprecated
        +public static Pair<HRegionInfo,ServerName> getHRegionInfoAndServerName(Result r)
        +
        Deprecated. use MetaTableAccessor methods for interacting with meta layouts
        +
        Extract a HRegionInfo and ServerName from catalog table Result