Class ThriftHBaseServiceHandler

java.lang.Object
org.apache.hadoop.hbase.thrift.HBaseServiceHandler
org.apache.hadoop.hbase.thrift2.ThriftHBaseServiceHandler
All Implemented Interfaces:
org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface

@Private public class ThriftHBaseServiceHandler extends HBaseServiceHandler implements org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
This class is a glue object that connects Thrift RPC calls to the HBase client API primarily defined in the Table interface.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final IOException
     
    private boolean
     
    private static final org.slf4j.Logger
     
    private final AtomicInteger
     
    private final org.apache.hbase.thirdparty.com.google.common.cache.Cache<Integer,ResultScanner>
     

    Fields inherited from class org.apache.hadoop.hbase.thrift.HBaseServiceHandler

    CLEANUP_INTERVAL, conf, connectionCache, MAX_IDLETIME, metrics
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThriftHBaseServiceHandler(org.apache.hadoop.conf.Configuration conf, UserProvider userProvider)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addColumnFamily(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor column)
    Add a column family to an existing table.
    private int
    Assigns a unique ID to the scanner and adds the mapping to an internal HashMap.
    org.apache.hadoop.hbase.thrift2.generated.TResult
    append(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TAppend append)
     
    boolean
    checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, org.apache.hadoop.hbase.thrift2.generated.TDelete deleteSingle)
    Atomically checks if a row/family/qualifier value matches the expected value.
    boolean
    checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, org.apache.hadoop.hbase.thrift2.generated.TCompareOp compareOp, ByteBuffer value, org.apache.hadoop.hbase.thrift2.generated.TRowMutations rowMutations)
    Atomically checks if a row/family/qualifier value matches the expected value.
    boolean
    checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, org.apache.hadoop.hbase.thrift2.generated.TPut put)
    Atomically checks if a row/family/qualifier value matches the expected value.
    private void
     
    clearSlowLogResponses(Set<org.apache.hadoop.hbase.thrift2.generated.TServerName> tServerNames)
    Clears online slow/large RPC logs from the provided list of RegionServers
    void
    closeScanner(int scannerId)
    Closes the scanner.
    private void
     
    void
    createNamespace(org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor namespaceDesc)
    Create a new namespace.
    void
    createTable(org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor desc, List<ByteBuffer> splitKeys)
    Creates a new table with an initial set of empty regions defined by the specified split keys.
    void
    deleteColumnFamily(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, ByteBuffer column)
    Delete a column family from a table.
    List<org.apache.hadoop.hbase.thrift2.generated.TDelete>
    deleteMultiple(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TDelete> deletes)
    Bulk commit a List of TDeletes to the table.
    void
    Delete an existing namespace.
    void
    deleteSingle(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TDelete deleteSingle)
    Deletes as specified by the TDelete.
    void
    deleteTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName)
    Deletes a table.
    void
    disableTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName)
    Disable a table
    void
    enableTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName)
    Enalbe a table
    boolean
    exists(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TGet get)
    Test for the existence of columns in the table, as specified in the TGet.
    existsAll(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TGet> gets)
    Test for the existence of columns in the table, as specified by the TGets.
    org.apache.hadoop.hbase.thrift2.generated.TResult
    get(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TGet get)
    Method for getting data from a row.
    List<org.apache.hadoop.hbase.thrift2.generated.THRegionLocation>
    Get all of the region locations for a given table.
    Returns the cluster ID for this cluster.
     
    List<org.apache.hadoop.hbase.thrift2.generated.TResult>
    getMultiple(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TGet> gets)
    Method for getting multiple rows.
    org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor
    Get a namespace descriptor by name.
    org.apache.hadoop.hbase.thrift2.generated.THRegionLocation
    getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload)
    Given a table and a row get the location of the region that would contain the given row key.
    getScanner(int id)
    Returns the Scanner associated with the specified Id.
    List<org.apache.hadoop.hbase.thrift2.generated.TResult>
    getScannerResults(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TScan scan, int numRows)
    Get results for the provided TScan object.
    List<org.apache.hadoop.hbase.thrift2.generated.TResult>
    getScannerRows(int scannerId, int numRows)
    Grabs multiple rows from a Scanner.
    List<org.apache.hadoop.hbase.thrift2.generated.TOnlineLogRecord>
    getSlowLogResponses(Set<org.apache.hadoop.hbase.thrift2.generated.TServerName> tServerNames, org.apache.hadoop.hbase.thrift2.generated.TLogQueryFilter tLogQueryFilter)
    Retrieves online slow RPC logs from the provided list of RegionServers
    protected Table
    getTable(ByteBuffer tableName)
     
    org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor
    getTableDescriptor(org.apache.hadoop.hbase.thrift2.generated.TTableName table)
    Get a table descriptor.
    List<org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor>
    getTableDescriptors(List<org.apache.hadoop.hbase.thrift2.generated.TTableName> tables)
    Get table descriptors of tables.
    List<org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor>
    Get table descriptors of tables in the given namespace
    List<org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor>
    getTableDescriptorsByPattern(String regex, boolean includeSysTables)
    Get table descriptors of tables that match the given pattern
    List<org.apache.hadoop.hbase.thrift2.generated.TTableName>
    Get table names of tables in the given namespace
    List<org.apache.hadoop.hbase.thrift2.generated.TTableName>
    getTableNamesByPattern(String regex, boolean includeSysTables)
    Get table names of tables that match the given pattern
    org.apache.hadoop.hbase.thrift2.generated.TThriftServerType
    Get the type of this thrift server.
    private org.apache.hadoop.hbase.thrift2.generated.TIOError
     
    org.apache.hadoop.hbase.thrift2.generated.TResult
    increment(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TIncrement increment)
     
    private boolean
     
    boolean
    isTableAvailable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName)
     
    boolean
    isTableAvailableWithSplit(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, List<ByteBuffer> splitKeys)
    * Use this api to check if the table has been created with the specified number of splitkeys * which was used while creating the given table.
    boolean
    isTableDisabled(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName)
     
    boolean
    isTableEnabled(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName)
     
    List<org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor>
     
     
    void
    modifyColumnFamily(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor column)
    Modify an existing column family on a table.
    void
    modifyNamespace(org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor namespaceDesc)
    Modify an existing namespace.
    void
    modifyTable(org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor desc)
    Modify an existing table
    void
    mutateRow(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TRowMutations rowMutations)
    mutateRow performs multiple mutations atomically on a single row.
    int
    openScanner(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TScan scan)
    Get a Scanner for the provided TScan object.
    void
    put(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TPut put)
    Commit a TPut to a table.
    void
    putMultiple(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TPut> puts)
    Commit a List of Puts to the table.
    protected void
    removeScanner(int id)
    Removes the scanner associated with the specified ID from the internal HashMap.
    boolean
    tableExists(org.apache.hadoop.hbase.thrift2.generated.TTableName tTableName)
     
    void
    truncateTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, boolean preserveSplits)
    Truncate a table.

    Methods inherited from class org.apache.hadoop.hbase.thrift.HBaseServiceHandler

    getAdmin, getTable, initMetrics, setEffectiveUser

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getTable

      protected Table getTable(ByteBuffer tableName)
      Overrides:
      getTable in class HBaseServiceHandler
    • getLocator

      private RegionLocator getLocator(ByteBuffer tableName)
    • closeTable

      private void closeTable(Table table) throws org.apache.hadoop.hbase.thrift2.generated.TIOError
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
    • getTIOError

      private org.apache.hadoop.hbase.thrift2.generated.TIOError getTIOError(IOException e)
    • addScanner

      private int addScanner(ResultScanner scanner)
      Assigns a unique ID to the scanner and adds the mapping to an internal HashMap.
      Parameters:
      scanner - to add
      Returns:
      Id for this Scanner
    • getScanner

      private ResultScanner getScanner(int id)
      Returns the Scanner associated with the specified Id.
      Parameters:
      id - of the Scanner to get
      Returns:
      a Scanner, or null if the Id is invalid
    • removeScanner

      protected void removeScanner(int id)
      Removes the scanner associated with the specified ID from the internal HashMap.
      Parameters:
      id - of the Scanner to remove
    • exists

      public boolean exists(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TGet get) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Test for the existence of columns in the table, as specified in the TGet.
      Specified by:
      exists in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to check on
      get - the TGet to check for
      Returns:
      true if the specified TGet matches one or more keys, false if not
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • existsAll

      public List<Boolean> existsAll(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TGet> gets) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Test for the existence of columns in the table, as specified by the TGets. This will return an array of booleans. Each value will be true if the related Get matches one or more keys, false if not.
      Specified by:
      existsAll in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to check on
      gets - a list of TGets to check for
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • get

      public org.apache.hadoop.hbase.thrift2.generated.TResult get(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TGet get) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Method for getting data from a row. If the row cannot be found an empty Result is returned. This can be checked by the empty field of the TResult
      Specified by:
      get in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to get from
      get - the TGet to fetch
      Returns:
      the result
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getMultiple

      public List<org.apache.hadoop.hbase.thrift2.generated.TResult> getMultiple(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TGet> gets) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Method for getting multiple rows. If a row cannot be found there will be a null value in the result list for that TGet at the same position. So the Results are in the same order as the TGets.
      Specified by:
      getMultiple in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to get from
      gets - a list of TGets to fetch, the Result list will have the Results at corresponding positions or null if there was an error
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • put

      public void put(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TPut put) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Commit a TPut to a table.
      Specified by:
      put in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to put data in
      put - the TPut to put
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • checkAndPut

      public boolean checkAndPut(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, org.apache.hadoop.hbase.thrift2.generated.TPut put) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the TPut.
      Specified by:
      checkAndPut in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - to check in and put to
      row - row to check
      family - column family to check
      qualifier - column qualifier to check
      value - the expected value, if not provided the check is for the non-existence of the column in question
      put - the TPut to put if the check succeeds
      Returns:
      true if the new put was executed, false otherwise
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • putMultiple

      public void putMultiple(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TPut> puts) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Commit a List of Puts to the table.
      Specified by:
      putMultiple in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to put data in
      puts - a list of TPuts to commit
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • deleteSingle

      public void deleteSingle(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TDelete deleteSingle) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Deletes as specified by the TDelete. Note: "delete" is a reserved keyword and cannot be used in Thrift thus the inconsistent naming scheme from the other functions.
      Specified by:
      deleteSingle in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to delete from
      deleteSingle - the TDelete to delete
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • deleteMultiple

      public List<org.apache.hadoop.hbase.thrift2.generated.TDelete> deleteMultiple(ByteBuffer table, List<org.apache.hadoop.hbase.thrift2.generated.TDelete> deletes) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Bulk commit a List of TDeletes to the table. Throws a TIOError if any of the deletes fail. Always returns an empty list for backwards compatibility.
      Specified by:
      deleteMultiple in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to delete from
      deletes - list of TDeletes to delete
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • checkAndMutate

      public boolean checkAndMutate(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, org.apache.hadoop.hbase.thrift2.generated.TCompareOp compareOp, ByteBuffer value, org.apache.hadoop.hbase.thrift2.generated.TRowMutations rowMutations) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Atomically checks if a row/family/qualifier value matches the expected value. If it does, it mutates the row.
      Specified by:
      checkAndMutate in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - to check in and delete from
      row - row to check
      family - column family to check
      qualifier - column qualifier to check
      compareOp - comparison to make on the value
      value - the expected value to be compared against, if not provided the check is for the non-existence of the column in question
      rowMutations - row mutations to execute if the value matches
      Returns:
      true if the row was mutated, false otherwise
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • checkAndDelete

      public boolean checkAndDelete(ByteBuffer table, ByteBuffer row, ByteBuffer family, ByteBuffer qualifier, ByteBuffer value, org.apache.hadoop.hbase.thrift2.generated.TDelete deleteSingle) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Atomically checks if a row/family/qualifier value matches the expected value. If it does, it adds the delete.
      Specified by:
      checkAndDelete in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - to check in and delete from
      row - row to check
      family - column family to check
      qualifier - column qualifier to check
      value - the expected value, if not provided the check is for the non-existence of the column in question
      deleteSingle - the TDelete to execute if the check succeeds
      Returns:
      true if the new delete was executed, false otherwise
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • increment

      public org.apache.hadoop.hbase.thrift2.generated.TResult increment(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TIncrement increment) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      increment in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • append

      public org.apache.hadoop.hbase.thrift2.generated.TResult append(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TAppend append) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      append in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • openScanner

      public int openScanner(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TScan scan) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get a Scanner for the provided TScan object.
      Specified by:
      openScanner in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to get the Scanner for
      scan - the scan object to get a Scanner for
      Returns:
      Scanner Id to be used with other scanner procedures
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getScannerRows

      public List<org.apache.hadoop.hbase.thrift2.generated.TResult> getScannerRows(int scannerId, int numRows) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.hadoop.hbase.thrift2.generated.TIllegalArgument, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Grabs multiple rows from a Scanner.
      Specified by:
      getScannerRows in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      scannerId - the Id of the Scanner to return rows from. This is an Id returned from the openScanner function.
      numRows - number of rows to return
      Returns:
      Between zero and numRows TResults
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.hadoop.hbase.thrift2.generated.TIllegalArgument
      org.apache.thrift.TException
    • getScannerResults

      public List<org.apache.hadoop.hbase.thrift2.generated.TResult> getScannerResults(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TScan scan, int numRows) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get results for the provided TScan object. This helper function opens a scanner, get the results and close the scanner.
      Specified by:
      getScannerResults in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the table to get the Scanner for
      scan - the scan object to get a Scanner for
      numRows - number of rows to return
      Returns:
      between zero and numRows TResults
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • closeScanner

      public void closeScanner(int scannerId) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.hadoop.hbase.thrift2.generated.TIllegalArgument, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Closes the scanner. Should be called to free server side resources timely. Typically close once the scanner is not needed anymore, i.e. after looping over it to get all the required rows.
      Specified by:
      closeScanner in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      scannerId - the Id of the Scanner to close *
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.hadoop.hbase.thrift2.generated.TIllegalArgument
      org.apache.thrift.TException
    • mutateRow

      public void mutateRow(ByteBuffer table, org.apache.hadoop.hbase.thrift2.generated.TRowMutations rowMutations) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      mutateRow performs multiple mutations atomically on a single row.
      Specified by:
      mutateRow in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - table to apply the mutations
      rowMutations - mutations to apply
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getAllRegionLocations

      public List<org.apache.hadoop.hbase.thrift2.generated.THRegionLocation> getAllRegionLocations(ByteBuffer table) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get all of the region locations for a given table.
      Specified by:
      getAllRegionLocations in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getRegionLocation

      public org.apache.hadoop.hbase.thrift2.generated.THRegionLocation getRegionLocation(ByteBuffer table, ByteBuffer row, boolean reload) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Given a table and a row get the location of the region that would contain the given row key. reload = true means the cache will be cleared and the location will be fetched from meta.
      Specified by:
      getRegionLocation in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • checkReadOnlyMode

      private void checkReadOnlyMode() throws org.apache.hadoop.hbase.thrift2.generated.TIOError
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
    • isReadOnly

      private boolean isReadOnly()
    • getTableDescriptor

      public org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor getTableDescriptor(org.apache.hadoop.hbase.thrift2.generated.TTableName table) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get a table descriptor.
      Specified by:
      getTableDescriptor in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      table - the tablename of the table to get tableDescriptor
      Returns:
      the TableDescriptor of the giving tablename
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getTableDescriptors

      public List<org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor> getTableDescriptors(List<org.apache.hadoop.hbase.thrift2.generated.TTableName> tables) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get table descriptors of tables.
      Specified by:
      getTableDescriptors in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tables - the tablename list of the tables to get tableDescriptor
      Returns:
      the TableDescriptor of the giving tablename
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • tableExists

      public boolean tableExists(org.apache.hadoop.hbase.thrift2.generated.TTableName tTableName) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      tableExists in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tTableName - the tablename of the tables to check
      Returns:
      true if table exists already, false if not
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getTableDescriptorsByPattern

      public List<org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor> getTableDescriptorsByPattern(String regex, boolean includeSysTables) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get table descriptors of tables that match the given pattern
      Specified by:
      getTableDescriptorsByPattern in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      regex - The regular expression to match against
      includeSysTables - set to false if match only against userspace tables
      Returns:
      the tableDescriptors of the matching table
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getTableDescriptorsByNamespace

      public List<org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor> getTableDescriptorsByNamespace(String name) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get table descriptors of tables in the given namespace
      Specified by:
      getTableDescriptorsByNamespace in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      name - The namesapce's name
      Returns:
      the tableDescriptors in the namespce
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getTableNamesByPattern

      public List<org.apache.hadoop.hbase.thrift2.generated.TTableName> getTableNamesByPattern(String regex, boolean includeSysTables) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get table names of tables that match the given pattern
      Specified by:
      getTableNamesByPattern in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      regex - The regular expression to match against
      includeSysTables - set to false if match only against userspace tables
      Returns:
      the table names of the matching table
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getTableNamesByNamespace

      public List<org.apache.hadoop.hbase.thrift2.generated.TTableName> getTableNamesByNamespace(String name) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get table names of tables in the given namespace
      Specified by:
      getTableNamesByNamespace in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      name - The namesapce's name
      Returns:
      the table names of the matching table
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • createTable

      public void createTable(org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor desc, List<ByteBuffer> splitKeys) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Creates a new table with an initial set of empty regions defined by the specified split keys. The total number of regions created will be the number of split keys plus one. Synchronous operation.
      Specified by:
      createTable in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      desc - table descriptor for table
      splitKeys - rray of split keys for the initial regions of the table
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • deleteTable

      public void deleteTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Deletes a table. Synchronous operation.
      Specified by:
      deleteTable in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to delete
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • truncateTable

      public void truncateTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, boolean preserveSplits) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Truncate a table. Synchronous operation.
      Specified by:
      truncateTable in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to truncate
      preserveSplits - whether to preserve previous splits
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • enableTable

      public void enableTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Enalbe a table
      Specified by:
      enableTable in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to enable
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • disableTable

      public void disableTable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Disable a table
      Specified by:
      disableTable in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to disable
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • isTableEnabled

      public boolean isTableEnabled(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      isTableEnabled in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to check
      Returns:
      true if table is enabled, false if not
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • isTableDisabled

      public boolean isTableDisabled(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      isTableDisabled in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to check
      Returns:
      true if table is disabled, false if not
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • isTableAvailable

      public boolean isTableAvailable(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      isTableAvailable in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to check
      Returns:
      true if table is available, false if not
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • isTableAvailableWithSplit

      public boolean isTableAvailableWithSplit(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, List<ByteBuffer> splitKeys) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      * Use this api to check if the table has been created with the specified number of splitkeys * which was used while creating the given table. Note : If this api is used after a table's * region gets splitted, the api may return false. * * @return true if table is available, false if not * * @deprecated Since 2.2.0. Because the same method in Table interface has been deprecated * since 2.0.0, we will remove it in 3.0.0 release. * Use THBaseService.Iface.isTableAvailable(TTableName tableName) instead *
      Specified by:
      isTableAvailableWithSplit in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to check
      splitKeys - keys to check if the table has been created with all split keys
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • addColumnFamily

      public void addColumnFamily(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor column) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Add a column family to an existing table. Synchronous operation.
      Specified by:
      addColumnFamily in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to add column family to
      column - column family descriptor of column family to be added
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • deleteColumnFamily

      public void deleteColumnFamily(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, ByteBuffer column) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Delete a column family from a table. Synchronous operation.
      Specified by:
      deleteColumnFamily in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to delete column family from
      column - name of column family to be deleted
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • modifyColumnFamily

      public void modifyColumnFamily(org.apache.hadoop.hbase.thrift2.generated.TTableName tableName, org.apache.hadoop.hbase.thrift2.generated.TColumnFamilyDescriptor column) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Modify an existing column family on a table. Synchronous operation.
      Specified by:
      modifyColumnFamily in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      tableName - the tablename to modify column family
      column - column family descriptor of column family to be modified
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • modifyTable

      public void modifyTable(org.apache.hadoop.hbase.thrift2.generated.TTableDescriptor desc) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Modify an existing table
      Specified by:
      modifyTable in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      desc - the descriptor of the table to modify
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • createNamespace

      public void createNamespace(org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor namespaceDesc) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Create a new namespace. Blocks until namespace has been successfully created or an exception is thrown
      Specified by:
      createNamespace in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      namespaceDesc - descriptor which describes the new namespace
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • modifyNamespace

      public void modifyNamespace(org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor namespaceDesc) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Modify an existing namespace. Blocks until namespace has been successfully modified or an exception is thrown
      Specified by:
      modifyNamespace in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      namespaceDesc - descriptor which describes the new namespace
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • deleteNamespace

      public void deleteNamespace(String name) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Delete an existing namespace. Only empty namespaces (no tables) can be removed. Blocks until namespace has been successfully deleted or an exception is thrown.
      Specified by:
      deleteNamespace in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      name - namespace name
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getNamespaceDescriptor

      public org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor getNamespaceDescriptor(String name) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get a namespace descriptor by name.
      Specified by:
      getNamespaceDescriptor in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Parameters:
      name - name of namespace descriptor
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • listNamespaces

      public List<String> listNamespaces() throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      listNamespaces in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Returns:
      all namespace names
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException
    • getThriftServerType

      public org.apache.hadoop.hbase.thrift2.generated.TThriftServerType getThriftServerType()
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Get the type of this thrift server.
      Specified by:
      getThriftServerType in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Returns:
      the type of this thrift server
    • getClusterId

      public String getClusterId() throws org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Returns the cluster ID for this cluster.
      Specified by:
      getClusterId in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Throws:
      org.apache.thrift.TException
    • getSlowLogResponses

      public List<org.apache.hadoop.hbase.thrift2.generated.TOnlineLogRecord> getSlowLogResponses(Set<org.apache.hadoop.hbase.thrift2.generated.TServerName> tServerNames, org.apache.hadoop.hbase.thrift2.generated.TLogQueryFilter tLogQueryFilter) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Retrieves online slow RPC logs from the provided list of RegionServers
      Specified by:
      getSlowLogResponses in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Returns:
      online slowlog response list
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError - if a remote or network exception occurs
      org.apache.thrift.TException
    • clearSlowLogResponses

      public List<Boolean> clearSlowLogResponses(Set<org.apache.hadoop.hbase.thrift2.generated.TServerName> tServerNames) throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Description copied from interface: org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Clears online slow/large RPC logs from the provided list of RegionServers
      Specified by:
      clearSlowLogResponses in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Returns:
      List of booleans representing if online slowlog response buffer is cleaned from each RegionServer
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError - if a remote or network exception occurs
      org.apache.thrift.TException
    • listNamespaceDescriptors

      public List<org.apache.hadoop.hbase.thrift2.generated.TNamespaceDescriptor> listNamespaceDescriptors() throws org.apache.hadoop.hbase.thrift2.generated.TIOError, org.apache.thrift.TException
      Specified by:
      listNamespaceDescriptors in interface org.apache.hadoop.hbase.thrift2.generated.THBaseService.Iface
      Returns:
      all namespaces
      Throws:
      org.apache.hadoop.hbase.thrift2.generated.TIOError
      org.apache.thrift.TException