Package com.mapr.fs.hbase
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
FieldsFields 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, WireSecureBitFields inherited from interface com.mapr.fs.hbase.MapRDBConstants
COMMITTED_COL, DB_META_TABLE, DB_META_TABLE_BYTES, DEFAULT_BLOCKSIZE, DEFAULT_CF, FALSE, FALSE_VALUE, FID_COL, MAPR_UUID, TRUE, TRUE_VALUE -
Constructor Summary
ConstructorsConstructorDescriptionHBaseAdminImpl(org.apache.hadoop.conf.Configuration c, org.apache.hadoop.hbase.client.mapr.BaseTableMappingRules tableMappingRule) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddColumn(org.apache.hadoop.fs.Path tablePath, org.apache.hadoop.hbase.HColumnDescriptor cf) protected com.mapr.fs.tables.MapRAdminadmin()protected voidcheckTable(org.apache.hadoop.fs.Path path) voidclose()ClosesMapRFileSystemobjectvoidcreateTable(org.apache.hadoop.hbase.HTableDescriptor desc, byte[][] splitKeys) Creates a new table.voiddeleteColumn(String tableName, String columnName) voiddeleteColumnPermission(String tablePath, String column, String permission) Deletes a permission from a column family or qualifier.voiddeleteTable(String tablePath) voiddeleteTable(org.apache.hadoop.fs.Path tablePath) voiddeleteTablePermission(String tablePath, String permission) Removes a permission from the MapR tableorg.apache.hadoop.hbase.HTableDescriptor[]deleteTables(String lookupPath) voiddisableTable(String tableName) org.apache.hadoop.hbase.HTableDescriptor[]disableTables(String regex) protected org.apache.hadoop.fs.FileStatus[]doListTables(String lookupPath) Returns the list of Goose tablesvoidenableTable(String tableName) org.apache.hadoop.hbase.HTableDescriptor[]enableTables(String regex) List<com.mapr.fs.tables.CFPermissions>getFamilyPermissions(String tablePath) Returns the list of column family permission including those set on the qualifiers.longgetNumRows(String path) org.apache.hadoop.hbase.HTableDescriptorgetTableDescriptor(String tableName) Method for getting the tableDescriptorprotected org.apache.hadoop.hbase.HTableDescriptorgetTableDescriptor(org.apache.hadoop.fs.Path tablePath) protected org.apache.hadoop.fs.PathgetTablePath(byte[] tableName) protected org.apache.hadoop.fs.PathgetTablePath(String tableName) getTablePermissions(String tablePath) Returns all ACEs set on the table as aMap.List<org.apache.hadoop.hbase.HRegionInfo>getTableRegions(byte[] tableName) booleanisTableAvailable(String tableName) booleanisTableAvailable(String tableName, byte[][] splitKeys) booleanisTableDisabled(String tableName) booleanisTableEnabled(String tableName) 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.MapRFileSystemmaprfs()Delayed instantiation of MapRFileSystem so that a pure HBase application would not need to initialize FileSystem classvoidmodifyColumn(String tableName, org.apache.hadoop.hbase.HColumnDescriptor cf) voidmodifyColumn(org.apache.hadoop.fs.Path tablePath, org.apache.hadoop.hbase.HColumnDescriptor cf) voidmodifyTable(String tableName, org.apache.hadoop.hbase.HTableDescriptor htd) voidsetFamilyPermissions(String tablePath, String family, com.mapr.fs.tables.CFPermissions cfPermissions) Sets permissions on a column family.protected org.apache.hadoop.hbase.HTableDescriptor[]setTableDisabledStatus(String regex, Boolean disabled) voidsetTablePermissions(String tablePath, Map<String, String> permissions) Sets the permissions ACEs on the MapR table.voidsetUser(org.apache.hadoop.hbase.security.User user) Sets the User for the Admin instance.voidsplit(byte[] tableNameOrRegionName, byte[] splitPoint) Split a tablet or all the tablets of a table.booleantableExists(String tablePath) Returns true if the path exists and is a tablevoidtruncateTable(org.apache.hadoop.hbase.TableName tableName, boolean preserveSplits) protected voidunSupportedOperation(String operation) 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
-
Field Details
-
MaxTableCreateRetryCount
public static int MaxTableCreateRetryCount -
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
ClosesMapRFileSystemobject- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.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:
setUserin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin
-
tableExists
Returns true if the path exists and is a table- Specified by:
tableExistsin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
listTables
List all the tables in users current directory.- Specified by:
listTablesin classorg.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:
listTablesin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Returns:
- - returns an array of HTableDescriptors
- Throws:
IOException- if a remote or network exception occurs
-
listTableNames
List all the tables in users current directory.- Specified by:
listTableNamesin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Returns:
- - returns an array of TableName
- Throws:
IOException- if a remote or network exception occurs
-
listTableNames
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:
listTableNamesin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Returns:
- - returns an array of TableName
- Throws:
IOException- if a remote or network exception occurs
-
doListTables
Returns the list of Goose tables- Parameters:
lookupPath- The path with optional regular expression as the last segment of the path. If thepathStringis a folder, returns all tables under that path.- Returns:
- The array of
HTableDescriptorconstructed from the tables matchingpathString. - 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:
getTableDescriptorin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Parameters:
tableName- as a String- Returns:
- the tableDescriptor
- Throws:
org.apache.hadoop.hbase.TableNotFoundExceptionIOException- 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.TableNotFoundExceptionIOException
-
createTable
public void createTable(org.apache.hadoop.hbase.HTableDescriptor desc, byte[][] splitKeys) throws IOException Creates a new table. Synchronous operation.- Specified by:
createTablein classorg.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
- Specified by:
deleteTablein classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
deleteTable
- Throws:
IOException
-
deleteTables
public org.apache.hadoop.hbase.HTableDescriptor[] deleteTables(String lookupPath) throws IOException - Specified by:
deleteTablesin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
addColumn
public void addColumn(String tableName, org.apache.hadoop.hbase.HColumnDescriptor cf) throws IOException - Specified by:
addColumnin classorg.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:
modifyColumnin classorg.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
- Specified by:
deleteColumnin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
modifyTable
public void modifyTable(String tableName, org.apache.hadoop.hbase.HTableDescriptor htd) throws IOException - Specified by:
modifyTablein classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
enableTable
- Specified by:
enableTablein classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
enableTables
- Specified by:
enableTablesin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
disableTable
- Specified by:
disableTablein classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
disableTables
- Specified by:
disableTablesin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
isTableEnabled
- Specified by:
isTableEnabledin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
isTableDisabled
- Specified by:
isTableDisabledin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
isTableAvailable
- Specified by:
isTableAvailablein classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
isTableAvailable
- Specified by:
isTableAvailablein classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
getTableRegions
public List<org.apache.hadoop.hbase.HRegionInfo> getTableRegions(byte[] tableName) throws IOException - Specified by:
getTableRegionsin classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-
split
Split a tablet or all the tablets of a table.- Overrides:
splitin classorg.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 IOExceptionSets the permissions ACEs on the MapR table.- Parameters:
tablePath-permissions-- Throws:
IOException
-
getTablePermissions
Returns all ACEs set on the table as aMap. Key of this map is the permission name while the value is the ACE for that permission.- Parameters:
tablePath-- Returns:
- Throws:
IOException
-
deleteTablePermission
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. SeeCFPermissionsfor 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 alsoCFPermissions.- 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
Delayed instantiation of MapRFileSystem so that a pure HBase application would not need to initialize FileSystem class- Returns:
- Throws:
IOException
-
admin
- Throws:
IOException
-
setTableDisabledStatus
protected org.apache.hadoop.hbase.HTableDescriptor[] setTableDisabledStatus(String regex, Boolean disabled) throws IOException - Throws:
IOException
-
getTablePath
- Throws:
IOException
-
getTablePath
- Throws:
IOException
-
unSupportedOperation
-
checkTable
protected void checkTable(org.apache.hadoop.fs.Path path) throws IOException, org.apache.hadoop.hbase.TableNotFoundException - Throws:
IOExceptionorg.apache.hadoop.hbase.TableNotFoundException
-
getNumRows
- Throws:
IOException
-
truncateTable
public void truncateTable(org.apache.hadoop.hbase.TableName tableName, boolean preserveSplits) throws IOException - Overrides:
truncateTablein classorg.apache.hadoop.hbase.client.mapr.AbstractHBaseAdmin- Throws:
IOException
-