Class HBaseAdminImpl

java.lang.Object
org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
com.mapr.fs.hbase.HBaseAdminImpl
All Implemented Interfaces:
MapRDBConstants, com.mapr.fs.jni.MapRConstants, Closeable, AutoCloseable

public class HBaseAdminImpl extends org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin implements MapRDBConstants
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.mapr.fs.jni.MapRConstants

    com.mapr.fs.jni.MapRConstants.ErrorValue, com.mapr.fs.jni.MapRConstants.JniUsername, com.mapr.fs.jni.MapRConstants.PutConstants, com.mapr.fs.jni.MapRConstants.RowConstants
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
     
    static int
     

    Fields inherited from interface com.mapr.fs.jni.MapRConstants

    AtimeBit, AuditBit, ChunkSizeBit, ClusterConfDefault, CompressBit, CompressorTypeBit, DEFAULT_USER_IDENTIFIER, DEFAULT_USER_IDENTIFIER_ESCAPED, DefaultChunkSize, DefaultCLDBIp, DefaultCLDBPort, DiskFlushBit, EMPTY_BYTE_ARRAY, EMPTY_END_ROW, EMPTY_START_ROW, FidNameBit, GlobalClusterConfDefault, GroupBit, HADOOP_MAX_BLOCKSIZE, HADOOP_SECURITY_SPOOFED_GID, HADOOP_SECURITY_SPOOFED_GROUP, HADOOP_SECURITY_SPOOFED_UID, HADOOP_SECURITY_SPOOFED_USER, HOSTNAME_IP_SEPARATOR, IP_PORT_SEPARATOR, IPV6_ADDR_ENDER, IPV6_ADDR_STARTER, IPv6DefaultCLDBIp, LAST_ROW, LATEST_TIMESTAMP, MAPR_ENV_VAR, MAPR_PROPERTY_HOME, MapRClusterDir, MapRClusterDirPattern, MapRClusterDirSlash, MAPRFS_PREFIX, MAPRFS_SCHEME, MapRHomeDefault, MAX_CLUSTERS_CROSSED, MAX_PATH_LENGTH, MAX_PORT_NUMBER, MAX_RA_THREADS, MIN_RA_THREADS, MinChunkSize, ModeBit, MtimeBit, MULTI_ADDR_SEPARATOR, NUM_CONTAINERS_PER_RPC, OLDEST_TIMESTAMP, RA_THREADS_PER_STREAM, ReplBit, SSL_TRUSTSTORE, UserBit, UTF8_ENCODING, WireSecureBit
  • Constructor Summary

    Constructors
    Constructor
    Description
    HBaseAdminImpl(org.apache.hadoop.conf.Configuration c, org.apache.hadoop.hbase.client.mapr.BaseTableMappingRules tableMappingRule)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addColumn(String tableName, org.apache.hadoop.hbase.HColumnDescriptor cf)
     
    void
    addColumn(org.apache.hadoop.fs.Path tablePath, org.apache.hadoop.hbase.HColumnDescriptor cf)
     
    protected com.mapr.fs.tables.MapRAdmin
     
    protected void
    checkTable(org.apache.hadoop.fs.Path path)
     
    void
    Closes MapRFileSystem object
    void
    createTable(org.apache.hadoop.hbase.HTableDescriptor desc, byte[][] splitKeys)
    Creates a new table.
    void
    deleteColumn(String tableName, String columnName)
     
    void
    deleteColumnPermission(String tablePath, String column, String permission)
    Deletes a permission from a column family or qualifier.
    void
    deleteTable(String tablePath)
     
    void
    deleteTable(org.apache.hadoop.fs.Path tablePath)
     
    void
    deleteTablePermission(String tablePath, String permission)
    Removes a permission from the MapR table
    org.apache.hadoop.hbase.HTableDescriptor[]
    deleteTables(String lookupPath)
     
    void
    disableTable(String tableName)
     
    org.apache.hadoop.hbase.HTableDescriptor[]
     
    protected org.apache.hadoop.fs.FileStatus[]
    doListTables(String lookupPath)
    Returns the list of Goose tables
    void
    enableTable(String tableName)
     
    org.apache.hadoop.hbase.HTableDescriptor[]
     
    List<com.mapr.fs.tables.CFPermissions>
    Returns the list of column family permission including those set on the qualifiers.
    long
     
    org.apache.hadoop.hbase.HTableDescriptor
    Method for getting the tableDescriptor
    protected org.apache.hadoop.hbase.HTableDescriptor
    getTableDescriptor(org.apache.hadoop.fs.Path tablePath)
     
    protected org.apache.hadoop.fs.Path
    getTablePath(byte[] tableName)
     
    protected org.apache.hadoop.fs.Path
    getTablePath(String tableName)
     
    Returns all ACEs set on the table as a Map.
    List<org.apache.hadoop.hbase.HRegionInfo>
    getTableRegions(byte[] tableName)
     
    boolean
     
    boolean
    isTableAvailable(String tableName, byte[][] splitKeys)
     
    boolean
     
    boolean
     
    org.apache.hadoop.hbase.TableName[]
    List all the tables in users current directory.
    org.apache.hadoop.hbase.TableName[]
    listTableNames(String lookupPattern)
    List all the tables matching the pattern.
    org.apache.hadoop.hbase.HTableDescriptor[]
    List all the tables in users current directory.
    org.apache.hadoop.hbase.HTableDescriptor[]
    listTables(String lookupPattern)
    List all the tables matching the pattern.
    protected com.mapr.fs.MapRFileSystem
    Delayed instantiation of MapRFileSystem so that a pure HBase application would not need to initialize FileSystem class
    void
    modifyColumn(String tableName, org.apache.hadoop.hbase.HColumnDescriptor cf)
     
    void
    modifyColumn(org.apache.hadoop.fs.Path tablePath, org.apache.hadoop.hbase.HColumnDescriptor cf)
     
    void
    modifyTable(String tableName, org.apache.hadoop.hbase.HTableDescriptor htd)
     
    void
    setFamilyPermissions(String tablePath, String family, com.mapr.fs.tables.CFPermissions cfPermissions)
    Sets permissions on a column family.
    protected org.apache.hadoop.hbase.HTableDescriptor[]
     
    void
    setTablePermissions(String tablePath, Map<String,String> permissions)
    Sets the permissions ACEs on the MapR table.
    void
    setUser(org.apache.hadoop.hbase.security.User user)
    Sets the User for the Admin instance.
    void
    split(byte[] tableNameOrRegionName, byte[] splitPoint)
    Split a tablet or all the tablets of a table.
    boolean
    tableExists(String tablePath)
    Returns true if the path exists and is a table
    void
    truncateTable(org.apache.hadoop.hbase.TableName tableName, boolean preserveSplits)
     
    protected void
     

    Methods inherited from class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin

    abortProcedure, abortProcedureAsync, assign, cloneSnapshot, closeRegion, closeRegion, closeRegionWithEncodedRegionName, compact, compact, coprocessorService, coprocessorService, createNamespace, deleteNamespace, deleteSnapshot, deleteSnapshots, enableCatalogJanitor, execProcedure, execProcedureWithRet, flush, getAlterStatus, getClusterStatus, getCompactionState, getCompactionStateForRegion, getLastMajorCompactionTimestamp, getLastMajorCompactionTimestampForRegion, getMasterCoprocessors, getMasterInfoPort, getNamespaceDescriptor, getOnlineRegions, getQuotaRetriever, getTableNames, getTableNames, getTableNames, isCatalogJanitorEnabled, isMasterRunning, isProcedureFinished, isSnapshotFinished, listNamespaceDescriptors, listProcedures, listSnapshots, listSnapshots, listTableDescriptorsByNamespace, listTableNamesByNamespace, mergeRegions, modifyNamespace, move, offline, rollHLogWriter, rollWALWriter, runCatalogScan, setQuota, shutdown, snapshot, snapshot, stopMaster, stopRegionServer, takeSnapshotAsync, unassign, updateConfiguration, updateConfiguration

    Methods inherited from class java.lang.Object

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

    • MaxTableCreateRetryCount

      public static int MaxTableCreateRetryCount
    • FIRST_JSON_COL_FAMILY

      public static String FIRST_JSON_COL_FAMILY
  • Constructor Details

    • HBaseAdminImpl

      public HBaseAdminImpl(org.apache.hadoop.conf.Configuration c, org.apache.hadoop.hbase.client.mapr.BaseTableMappingRules tableMappingRule)
      Parameters:
      c -
      tableMappingRule -
  • Method Details

    • close

      public void close() throws IOException
      Closes MapRFileSystem object
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • setUser

      public void setUser(org.apache.hadoop.hbase.security.User user)
      Sets the User for the Admin instance.
      Overrides:
      setUser in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
    • tableExists

      public boolean tableExists(String tablePath) throws IOException
      Returns true if the path exists and is a table
      Specified by:
      tableExists in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • listTables

      public org.apache.hadoop.hbase.HTableDescriptor[] listTables() throws IOException
      List all the tables in users current directory.
      Specified by:
      listTables in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Returns:
      - returns an array of HTableDescriptors
      Throws:
      IOException - if a remote or network exception occurs
    • listTables

      public org.apache.hadoop.hbase.HTableDescriptor[] listTables(String lookupPattern) throws IOException
      List all the tables matching the pattern. The parameter pattern can contain path and the last segment of path can optionally be a regular expression e.g. '/user/root/payroll.*'
      Specified by:
      listTables in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Returns:
      - returns an array of HTableDescriptors
      Throws:
      IOException - if a remote or network exception occurs
    • listTableNames

      public org.apache.hadoop.hbase.TableName[] listTableNames() throws IOException
      List all the tables in users current directory.
      Specified by:
      listTableNames in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Returns:
      - returns an array of TableName
      Throws:
      IOException - if a remote or network exception occurs
    • listTableNames

      public org.apache.hadoop.hbase.TableName[] listTableNames(String lookupPattern) throws IOException
      List all the tables matching the pattern. The parameter pattern can contain path and the last segment of path can optionally be a regular expression e.g. '/user/root/payroll.*'
      Specified by:
      listTableNames in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Returns:
      - returns an array of TableName
      Throws:
      IOException - if a remote or network exception occurs
    • doListTables

      protected org.apache.hadoop.fs.FileStatus[] doListTables(String lookupPath) throws IOException
      Returns the list of Goose tables
      Parameters:
      lookupPath - The path with optional regular expression as the last segment of the path. If the pathString is a folder, returns all tables under that path.
      Returns:
      The array of HTableDescriptor constructed from the tables matching pathString.
      Throws:
      IOException
    • getTableDescriptor

      public org.apache.hadoop.hbase.HTableDescriptor getTableDescriptor(String tableName) throws org.apache.hadoop.hbase.TableNotFoundException, IOException
      Method for getting the tableDescriptor
      Specified by:
      getTableDescriptor in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Parameters:
      tableName - as a String
      Returns:
      the tableDescriptor
      Throws:
      org.apache.hadoop.hbase.TableNotFoundException
      IOException - if a remote or network exception occurs
    • getTableDescriptor

      protected org.apache.hadoop.hbase.HTableDescriptor getTableDescriptor(org.apache.hadoop.fs.Path tablePath) throws org.apache.hadoop.hbase.TableNotFoundException, IOException
      Throws:
      org.apache.hadoop.hbase.TableNotFoundException
      IOException
    • createTable

      public void createTable(org.apache.hadoop.hbase.HTableDescriptor desc, byte[][] splitKeys) throws IOException
      Creates a new table. Synchronous operation.
      Specified by:
      createTable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Parameters:
      desc - table descriptor for table
      Throws:
      org.apache.hadoop.hbase.TableExistsException - if table already exists (If concurrent threads, the table may have been created between test-for-existence and attempt-at-creation).
      IOException - if a remote or network exception occurs
    • deleteTable

      public void deleteTable(String tablePath) throws IOException
      Specified by:
      deleteTable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • deleteTable

      public void deleteTable(org.apache.hadoop.fs.Path tablePath) throws IOException
      Throws:
      IOException
    • deleteTables

      public org.apache.hadoop.hbase.HTableDescriptor[] deleteTables(String lookupPath) throws IOException
      Specified by:
      deleteTables in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • addColumn

      public void addColumn(String tableName, org.apache.hadoop.hbase.HColumnDescriptor cf) throws IOException
      Specified by:
      addColumn in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • addColumn

      public void addColumn(org.apache.hadoop.fs.Path tablePath, org.apache.hadoop.hbase.HColumnDescriptor cf) throws IOException
      Throws:
      IOException
    • modifyColumn

      public void modifyColumn(String tableName, org.apache.hadoop.hbase.HColumnDescriptor cf) throws IOException
      Specified by:
      modifyColumn in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • modifyColumn

      public void modifyColumn(org.apache.hadoop.fs.Path tablePath, org.apache.hadoop.hbase.HColumnDescriptor cf) throws IOException
      Throws:
      IOException
    • deleteColumn

      public void deleteColumn(String tableName, String columnName) throws IOException
      Specified by:
      deleteColumn in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • modifyTable

      public void modifyTable(String tableName, org.apache.hadoop.hbase.HTableDescriptor htd) throws IOException
      Specified by:
      modifyTable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • enableTable

      public void enableTable(String tableName) throws IOException
      Specified by:
      enableTable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • enableTables

      public org.apache.hadoop.hbase.HTableDescriptor[] enableTables(String regex) throws IOException
      Specified by:
      enableTables in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • disableTable

      public void disableTable(String tableName) throws IOException
      Specified by:
      disableTable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • disableTables

      public org.apache.hadoop.hbase.HTableDescriptor[] disableTables(String regex) throws IOException
      Specified by:
      disableTables in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • isTableEnabled

      public boolean isTableEnabled(String tableName) throws IOException
      Specified by:
      isTableEnabled in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • isTableDisabled

      public boolean isTableDisabled(String tableName) throws IOException
      Specified by:
      isTableDisabled in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • isTableAvailable

      public boolean isTableAvailable(String tableName) throws IOException
      Specified by:
      isTableAvailable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • isTableAvailable

      public boolean isTableAvailable(String tableName, byte[][] splitKeys) throws IOException
      Specified by:
      isTableAvailable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • getTableRegions

      public List<org.apache.hadoop.hbase.HRegionInfo> getTableRegions(byte[] tableName) throws IOException
      Specified by:
      getTableRegions in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException
    • split

      public void split(byte[] tableNameOrRegionName, byte[] splitPoint) throws IOException
      Split a tablet or all the tablets of a table.
      Overrides:
      split in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Parameters:
      tableNameOrRegionName - String specifying either a table path with optional tablet FID separated by ",". If a tablet FID is not specified, all tablets of the table are split.
      Throws:
      IOException
    • setTablePermissions

      public void setTablePermissions(String tablePath, Map<String,String> permissions) throws IOException
      Sets the permissions ACEs on the MapR table.
      Parameters:
      tablePath -
      permissions -
      Throws:
      IOException
    • getTablePermissions

      public Map<String,String> getTablePermissions(String tablePath) throws IOException
      Returns all ACEs set on the table as a Map. Key of this map is the permission name while the value is the ACE for that permission.
      Parameters:
      tablePath -
      Returns:
      Throws:
      IOException
    • deleteTablePermission

      public void deleteTablePermission(String tablePath, String permission) throws IOException
      Removes a permission from the MapR table
      Parameters:
      tablePath -
      permission -
      Throws:
      IOException
    • setFamilyPermissions

      public void setFamilyPermissions(String tablePath, String family, com.mapr.fs.tables.CFPermissions cfPermissions) throws IOException
      Sets permissions on a column family. See CFPermissions for details.
      Parameters:
      tablePath -
      family -
      cfPermissions -
      Throws:
      IOException
    • getFamilyPermissions

      public List<com.mapr.fs.tables.CFPermissions> getFamilyPermissions(String tablePath) throws IOException
      Returns the list of column family permission including those set on the qualifiers. See also CFPermissions.
      Parameters:
      tablePath -
      Returns:
      Throws:
      IOException
    • deleteColumnPermission

      public void deleteColumnPermission(String tablePath, String column, String permission) throws IOException
      Deletes a permission from a column family or qualifier.
      Parameters:
      tablePath -
      column -
      permission -
      Throws:
      IOException
    • maprfs

      protected com.mapr.fs.MapRFileSystem maprfs() throws IOException
      Delayed instantiation of MapRFileSystem so that a pure HBase application would not need to initialize FileSystem class
      Returns:
      Throws:
      IOException
    • admin

      protected com.mapr.fs.tables.MapRAdmin admin() throws IOException
      Throws:
      IOException
    • setTableDisabledStatus

      protected org.apache.hadoop.hbase.HTableDescriptor[] setTableDisabledStatus(String regex, Boolean disabled) throws IOException
      Throws:
      IOException
    • getTablePath

      protected org.apache.hadoop.fs.Path getTablePath(String tableName) throws IOException
      Throws:
      IOException
    • getTablePath

      protected org.apache.hadoop.fs.Path getTablePath(byte[] tableName) throws IOException
      Throws:
      IOException
    • unSupportedOperation

      protected void unSupportedOperation(String operation)
    • checkTable

      protected void checkTable(org.apache.hadoop.fs.Path path) throws IOException, org.apache.hadoop.hbase.TableNotFoundException
      Throws:
      IOException
      org.apache.hadoop.hbase.TableNotFoundException
    • getNumRows

      public long getNumRows(String path) throws IOException
      Throws:
      IOException
    • truncateTable

      public void truncateTable(org.apache.hadoop.hbase.TableName tableName, boolean preserveSplits) throws IOException
      Overrides:
      truncateTable in class org.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
      Throws:
      IOException