|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.client.admin.TableOperations
public class TableOperations
Provides a class for administering tables
Constructor Summary | |
---|---|
protected |
TableOperations()
|
Method Summary | |
---|---|
void |
addAggregators(java.lang.String tableName,
java.util.List<AggregatorConfiguration> aggregators)
|
void |
addSplits(java.lang.String tableName,
java.util.SortedSet<org.apache.hadoop.io.Text> partitionKeys)
|
void |
clearLocatorCache(java.lang.String tableName)
Clears the tablet locator cache for a specified table |
void |
create(java.lang.String tableName)
Create a table with no special configuration |
void |
create(java.lang.String tableName,
TimeType timeType)
|
void |
delete(java.lang.String tableName)
Delete a table |
boolean |
exists(java.lang.String tableName)
A method to check if a table exists in Accumulo. |
void |
flush(java.lang.String tableName)
Flush a table |
java.util.Map<java.lang.String,java.util.Set<org.apache.hadoop.io.Text>> |
getLocalityGroups(java.lang.String tableName)
Gets the locality groups currently set for a table. |
java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> |
getProperties(java.lang.String tableName)
Gets properties of a table |
java.util.Collection<org.apache.hadoop.io.Text> |
getSplits(java.lang.String tableName)
|
java.util.Collection<org.apache.hadoop.io.Text> |
getSplits(java.lang.String tableName,
int maxSplits)
|
BulkImportHelper.AssignmentStats |
importDirectory(java.lang.String tableName,
java.lang.String dir,
java.lang.String failureDir,
int numThreads,
int numAssignThreads,
boolean disableGC)
|
java.util.SortedSet<java.lang.String> |
list()
Retrieve a list of tables in Accumulo. |
void |
offline(java.lang.String tableName)
|
void |
online(java.lang.String tableName)
|
void |
removeProperty(java.lang.String tableName,
java.lang.String property)
Removes a property from a table |
void |
rename(java.lang.String oldTableName,
java.lang.String newTableName)
Rename a table |
void |
setLocalityGroups(java.lang.String tableName,
java.util.Map<java.lang.String,java.util.Set<org.apache.hadoop.io.Text>> groups)
Sets a tables locality groups. |
void |
setProperty(java.lang.String tableName,
java.lang.String property,
java.lang.String value)
Sets a property on a table |
java.util.Set<Range> |
splitRangeByTablets(java.lang.String tableName,
Range range,
int maxSplits)
|
java.util.Map<java.lang.String,java.lang.String> |
tableIdMap()
Get a mapping of table name to internal table id. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected TableOperations()
Method Detail |
---|
public java.util.SortedSet<java.lang.String> list()
public boolean exists(java.lang.String tableName)
tableName
- the name of the table
public void create(java.lang.String tableName) throws AccumuloException, AccumuloSecurityException, TableExistsException
tableName
- the name of the table
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableExistsException
- if the table already existspublic void create(java.lang.String tableName, TimeType timeType) throws AccumuloException, AccumuloSecurityException, TableExistsException
tableName
- the name of the tablepartitionKeys
- a sorted set of row key values to pre-split the table onaggregators
- a list of configured aggregators to apply to the table immediatelytimeType
- specifies logical or real-time based time recording for entries in the table
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableExistsException
- if the table already existspublic void addAggregators(java.lang.String tableName, java.util.List<AggregatorConfiguration> aggregators) throws AccumuloSecurityException, TableNotFoundException, AccumuloException
tableName
- the name of the tableaggregators
- List of aggregators to add
AccumuloSecurityException
- if insufficient permissions to do action
TableNotFoundException
- if table does not exist
AccumuloException
- if a general error occurspublic void addSplits(java.lang.String tableName, java.util.SortedSet<org.apache.hadoop.io.Text> partitionKeys) throws TableNotFoundException, AccumuloException, AccumuloSecurityException
tableName
- the name of the tablepartitionKeys
- a sorted set of row key values to pre-split the table on
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableNotFoundException
- if the table does not existpublic java.util.Collection<org.apache.hadoop.io.Text> getSplits(java.lang.String tableName) throws TableNotFoundException
tableName
- the name of the table
TableNotFoundException
- if the table does not existpublic java.util.Collection<org.apache.hadoop.io.Text> getSplits(java.lang.String tableName, int maxSplits) throws TableNotFoundException
tableName
- the name of the tablemaxSplits
- specifies the maximum number of splits to return
TableNotFoundException
public void delete(java.lang.String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
tableName
- the name of the table
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableNotFoundException
- if the table does not existpublic void rename(java.lang.String oldTableName, java.lang.String newTableName) throws AccumuloSecurityException, TableNotFoundException, AccumuloException, TableExistsException
oldTableName
- the old table namenewTableName
- the new table name
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableNotFoundException
- if the old table name does not exist
TableExistsException
- if the new table name already existspublic void flush(java.lang.String tableName) throws AccumuloException, AccumuloSecurityException
tableName
- the name of the table
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permissionpublic void setProperty(java.lang.String tableName, java.lang.String property, java.lang.String value) throws AccumuloException, AccumuloSecurityException
tableName
- the name of the tableproperty
- the name of a per-table propertyvalue
- the value to set a per-table property to
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permissionpublic void removeProperty(java.lang.String tableName, java.lang.String property) throws AccumuloException, AccumuloSecurityException
tableName
- the name of the tableproperty
- the name of a per-table property
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permissionpublic java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>> getProperties(java.lang.String tableName) throws TableNotFoundException
tableName
- the name of the table
TableNotFoundException
- if the table does not existpublic void setLocalityGroups(java.lang.String tableName, java.util.Map<java.lang.String,java.util.Set<org.apache.hadoop.io.Text>> groups) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
tableName
- the name of the tablegroups
- mapping of locality group names to column families in the locality group
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableNotFoundException
- if the table does not existpublic java.util.Map<java.lang.String,java.util.Set<org.apache.hadoop.io.Text>> getLocalityGroups(java.lang.String tableName) throws AccumuloException, TableNotFoundException
tableName
- the name of the table
AccumuloException
- if a general error occurs
TableNotFoundException
- if the table does not existpublic java.util.Set<Range> splitRangeByTablets(java.lang.String tableName, Range range, int maxSplits) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
tableName
- the name of the tablerange
- a range to splitmaxSplits
- the maximum number of splits
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableNotFoundException
- if the table does not existpublic BulkImportHelper.AssignmentStats importDirectory(java.lang.String tableName, java.lang.String dir, java.lang.String failureDir, int numThreads, int numAssignThreads, boolean disableGC) throws java.io.IOException, AccumuloException, AccumuloSecurityException
tableName
- the name of the tabledir
- the HDFS directory to find files for importingfailureDir
- the HDFS directory to place files that failed to be importednumThreads
- the number of threads to use to process the filesnumAssignThreads
- the number of threads to use when assigning the filesdisableGC
- prevents the garbage collector from cleaning up files that were bulk imported
java.io.IOException
- when there is an error reading/writing to HDFS
AccumuloException
- when there is a general accumulo error
AccumuloSecurityException
- when the user does not have the proper permissionspublic void offline(java.lang.String tableName) throws AccumuloSecurityException, AccumuloException
tableName
- the table to take offline
AccumuloException
- when there is a general accumulo error
AccumuloSecurityException
- when the user does not have the proper permissionspublic void online(java.lang.String tableName) throws AccumuloSecurityException, AccumuloException
tableName
- the table to take online
AccumuloException
- when there is a general accumulo error
AccumuloSecurityException
- when the user does not have the proper permissionspublic void clearLocatorCache(java.lang.String tableName) throws TableNotFoundException
tableName
- the name of the table
TableNotFoundException
- if table does not existpublic java.util.Map<java.lang.String,java.lang.String> tableIdMap()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |