Class KeyExtent

    • Constructor Detail

      • KeyExtent

        public KeyExtent​(TableId table,
                         org.apache.hadoop.io.Text endRow,
                         org.apache.hadoop.io.Text prevEndRow)
        Create a new KeyExtent from its components.
        Parameters:
        table - the ID for the table
        endRow - the last row in this tablet, or null if this is the last tablet in this table
        prevEndRow - the last row in the immediately preceding tablet for the table, or null if this represents the first tablet in this table
    • Method Detail

      • copyOf

        public static KeyExtent copyOf​(KeyExtent original)
        Create a copy of a provided KeyExtent.
        Parameters:
        original - the KeyExtent to copy
      • fromThrift

        public static KeyExtent fromThrift​(TKeyExtent tke)
        Create a KeyExtent from its Thrift form.
        Parameters:
        tke - the KeyExtent in its Thrift object form
      • toThrift

        public TKeyExtent toThrift()
        Convert to Thrift form.
      • fromMetaRow

        public static KeyExtent fromMetaRow​(org.apache.hadoop.io.Text encodedMetadataRow)
        Create a KeyExtent from the table ID and the end row encoded in the row field of a tablet's metadata entry, with no previous end row.
        Parameters:
        encodedMetadataRow - the encoded tableId and endRow from a metadata entry, as in entry.getKey().getRow() or from MetadataSchema.TabletsSection.encodeRow(TableId, Text)
      • fromMetaRow

        public static KeyExtent fromMetaRow​(org.apache.hadoop.io.Text encodedMetadataRow,
                                            org.apache.hadoop.io.Text prevEndRow)
        Create a KeyExtent from the table ID and the end row encoded in the row field of a tablet's metadata entry, along with a previous end row.
        Parameters:
        encodedMetadataRow - the encoded tableId and endRow from a metadata entry, as in entry.getKey().getRow() or from MetadataSchema.TabletsSection.encodeRow(TableId, Text)
        prevEndRow - the unencoded previous end row (a copy will be made)
      • fromTabletId

        public static KeyExtent fromTabletId​(TabletId tabletId)
        Create a KeyExtent from a TabletId.
        Parameters:
        tabletId - the TabletId to convert to a KeyExtent
      • toMetaRow

        public org.apache.hadoop.io.Text toMetaRow()
        Return a serialized form of the table ID and end row for this extent, in a form suitable for use in the row portion of metadata entries for the tablet this extent represents.
      • tableId

        public TableId tableId()
        Return the extent's table ID.
      • endRow

        public org.apache.hadoop.io.Text endRow()
        Returns this extent's end row
      • prevEndRow

        public org.apache.hadoop.io.Text prevEndRow()
        Return the previous extent's end row
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getUUID

        public UUID getUUID()
        Retrieve a unique identifier for this tablet that is useful for logging, without revealing the contents of the end row and previous end row.
      • contains

        public boolean contains​(KeyExtent oke)
        Determine if another KeyExtent is wholly contained within the range of this one. * @param oke
        Returns:
        true if and only if the provided KeyExtent is contained within the range of this one
      • contains

        public boolean contains​(org.apache.hadoop.io.BinaryComparable row)
        Determine if the provided row is contained within the range of this KeyExtent.
        Returns:
        true if and only if the provided row is contained within the range of this one
      • toDataRange

        public Range toDataRange()
        Compute a representation of this extent as a Range suitable for scanning this extent's table and retrieving all data between this extent's previous end row (exclusive) and its end row (inclusive) in that table (or another table in the same range, since the returned range does not specify the table to scan).

        For example, if this extent represented a range of data from A to Z for table T, the resulting Range could be used to scan table T's data in the exclusive-inclusive range (A,Z], or the same range in another table, T2.

      • toMetaRange

        public Range toMetaRange()
        Compute a representation of this extent as a Range suitable for scanning the corresponding metadata table for this extent's table, and retrieving all the metadata for the table's tablets between this extent's previous end row (exclusive) and its end row (inclusive) in that table.

        For example, if this extent represented a range of data from A to Z for a user table, T, this would compute the range to scan accumulo.metadata that would include all the the metadata for T's tablets that contain data in the range (A,Z].

      • overlaps

        public boolean overlaps​(KeyExtent other)
      • isPreviousExtent

        public boolean isPreviousExtent​(KeyExtent prevExtent)
      • isMeta

        public boolean isMeta()
      • isRootTablet

        public boolean isRootTablet()
      • obscured

        public String obscured()