|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TableOperations
Provides a class for administering tables
Method Summary | |
---|---|
void |
addAggregators(String tableName,
List<? extends PerColumnIteratorConfig> aggregators)
Deprecated. since 1.4 attachIterator(String, IteratorSetting) |
void |
addSplits(String tableName,
SortedSet<org.apache.hadoop.io.Text> partitionKeys)
|
void |
attachIterator(String tableName,
IteratorSetting setting)
Add an iterator to a table on all scopes. |
void |
attachIterator(String tableName,
IteratorSetting setting,
EnumSet<IteratorUtil.IteratorScope> scopes)
Add an iterator to a table on the given scopes. |
void |
checkIteratorConflicts(String tableName,
IteratorSetting setting,
EnumSet<IteratorUtil.IteratorScope> scopes)
Check whether a given iterator configuration conflicts with existing configuration; in particular, determine if the name or priority are already in use for the specified scopes. |
void |
clearLocatorCache(String tableName)
Clears the tablet locator cache for a specified table |
void |
clone(String srcTableName,
String newTableName,
boolean flush,
Map<String,String> propertiesToSet,
Set<String> propertiesToExclude)
Clone a table from an existing table. |
void |
compact(String tableName,
org.apache.hadoop.io.Text start,
org.apache.hadoop.io.Text end,
boolean flush,
boolean wait)
Starts a full major compaction of the tablets in the range (start, end]. |
void |
create(String tableName)
Create a table with no special configuration |
void |
create(String tableName,
boolean limitVersion)
|
void |
create(String tableName,
boolean versioningIter,
TimeType timeType)
|
void |
delete(String tableName)
Delete a table |
void |
deleteRows(String tableName,
org.apache.hadoop.io.Text start,
org.apache.hadoop.io.Text end)
Delete rows between (start, end] |
boolean |
exists(String tableName)
A method to check if a table exists in Accumulo. |
void |
flush(String tableName)
Deprecated. As of release 1.4, replaced by flush(String, Text, Text, boolean) |
void |
flush(String tableName,
org.apache.hadoop.io.Text start,
org.apache.hadoop.io.Text end,
boolean wait)
Flush a tables data that is currently in memory. |
IteratorSetting |
getIteratorSetting(String tableName,
String name,
IteratorUtil.IteratorScope scope)
Get the settings for an iterator. |
Map<String,Set<org.apache.hadoop.io.Text>> |
getLocalityGroups(String tableName)
Gets the locality groups currently set for a table. |
org.apache.hadoop.io.Text |
getMaxRow(String tableName,
Authorizations auths,
org.apache.hadoop.io.Text startRow,
boolean startInclusive,
org.apache.hadoop.io.Text endRow,
boolean endInclusive)
Finds the max row within a given range. |
Iterable<Map.Entry<String,String>> |
getProperties(String tableName)
Gets properties of a table |
Collection<org.apache.hadoop.io.Text> |
getSplits(String tableName)
|
Collection<org.apache.hadoop.io.Text> |
getSplits(String tableName,
int maxSplits)
|
void |
importDirectory(String tableName,
String dir,
String failureDir,
boolean setTime)
Bulk import all the files in a directory into a table. |
BulkImportHelper.AssignmentStats |
importDirectory(String tableName,
String dir,
String failureDir,
int numThreads,
int numAssignThreads,
boolean disableGC)
Deprecated. Since 1.4 use importDirectory(String, String, String, boolean) |
SortedSet<String> |
list()
|
Map<String,EnumSet<IteratorUtil.IteratorScope>> |
listIterators(String tableName)
Get a list of iterators for this table. |
void |
merge(String tableName,
org.apache.hadoop.io.Text start,
org.apache.hadoop.io.Text end)
Merge tablets between (start, end] |
void |
offline(String tableName)
|
void |
online(String tableName)
|
void |
removeIterator(String tableName,
String name,
EnumSet<IteratorUtil.IteratorScope> scopes)
Remove an iterator from a table by name. |
void |
removeProperty(String tableName,
String property)
Removes a property from a table |
void |
rename(String oldTableName,
String newTableName)
Rename a table |
void |
setLocalityGroups(String tableName,
Map<String,Set<org.apache.hadoop.io.Text>> groups)
Sets a tables locality groups. |
void |
setProperty(String tableName,
String property,
String value)
Sets a property on a table |
Set<Range> |
splitRangeByTablets(String tableName,
Range range,
int maxSplits)
|
Map<String,String> |
tableIdMap()
Get a mapping of table name to internal table id. |
Method Detail |
---|
SortedSet<String> list()
boolean exists(String tableName)
tableName
- the name of the table
void create(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 existsvoid create(String tableName, boolean limitVersion) throws AccumuloException, AccumuloSecurityException, TableExistsException
tableName
- the name of the tablelimitVersion
- Enables/disables the versioning iterator, which will limit the number of Key versions kept.
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableExistsException
- if the table already existsvoid create(String tableName, boolean versioningIter, TimeType timeType) throws AccumuloException, AccumuloSecurityException, TableExistsException
tableName
- the name of the tableversioningIter
- Enables/disables the versioning iterator, which will limit the number of Key versions kept.timeType
- 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 existsvoid addAggregators(String tableName, List<? extends PerColumnIteratorConfig> aggregators) throws AccumuloSecurityException, TableNotFoundException, AccumuloException
attachIterator(String, IteratorSetting)
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 occursvoid addSplits(String tableName, 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 existCollection<org.apache.hadoop.io.Text> getSplits(String tableName) throws TableNotFoundException
tableName
- the name of the table
TableNotFoundException
- if the table does not existCollection<org.apache.hadoop.io.Text> getSplits(String tableName, int maxSplits) throws TableNotFoundException
tableName
- the name of the tablemaxSplits
- specifies the maximum number of splits to return
TableNotFoundException
org.apache.hadoop.io.Text getMaxRow(String tableName, Authorizations auths, org.apache.hadoop.io.Text startRow, boolean startInclusive, org.apache.hadoop.io.Text endRow, boolean endInclusive) throws TableNotFoundException, AccumuloException, AccumuloSecurityException
tableName
- auths
- find the max row that can seen with these authsstartRow
- row to start looking at, null means -InfinitystartInclusive
- determines if the start row is includedendRow
- row to stop looking at, null means InfinityendInclusive
- determines if the end row is included
AccumuloSecurityException
AccumuloException
TableNotFoundException
void merge(String tableName, org.apache.hadoop.io.Text start, org.apache.hadoop.io.Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
tableName
- the table to mergestart
- first tablet to be merged contains the row after this row, null means the first tabletend
- last tablet to be merged contains this row, null means the last tablet
AccumuloException
AccumuloSecurityException
TableNotFoundException
void deleteRows(String tableName, org.apache.hadoop.io.Text start, org.apache.hadoop.io.Text end) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
tableName
- the table to mergestart
- delete rows after this, null means the first row of the tableend
- last row to be deleted, inclusive, null means the last row of the table
AccumuloException
AccumuloSecurityException
TableNotFoundException
void compact(String tableName, org.apache.hadoop.io.Text start, org.apache.hadoop.io.Text end, boolean flush, boolean wait) throws AccumuloSecurityException, TableNotFoundException, AccumuloException
tableName
- the table to compactstart
- first tablet to be compacted contains the row after this row, null means the first tablet in tableend
- last tablet to be merged contains this row, null means the last tablet in tableflush
- when true, table memory is flushed before compaction startswait
- when true, the call will not return until compactions are finished
AccumuloSecurityException
TableNotFoundException
AccumuloException
void delete(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 existvoid clone(String srcTableName, String newTableName, boolean flush, Map<String,String> propertiesToSet, Set<String> propertiesToExclude) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException
srcTableName
- the table to clonenewTableName
- the name of the cloneflush
- determines if memory is flushed in the source table before cloning.propertiesToSet
- the sources tables properties are copied, this allows overriding of those propertiespropertiesToExclude
- do not copy these properties from the source table, just revert to system defaults
AccumuloException
AccumuloSecurityException
TableNotFoundException
TableExistsException
void rename(String oldTableName, 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 existsvoid flush(String tableName) throws AccumuloException, AccumuloSecurityException
flush(String, Text, Text, boolean)
tableName
- the name of the table
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permissionvoid flush(String tableName, org.apache.hadoop.io.Text start, org.apache.hadoop.io.Text end, boolean wait) throws AccumuloException, AccumuloSecurityException, TableNotFoundException
tableName
- the name of the tablewait
- if true the call will not return until all data present in memory when the call was is flushed if false will initiate a flush of data in memory,
but will not wait for it to complete
AccumuloException
- if a general error occurs
AccumuloSecurityException
- if the user does not have permission
TableNotFoundException
void setProperty(String tableName, String property, 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 permissionvoid removeProperty(String tableName, 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 permissionIterable<Map.Entry<String,String>> getProperties(String tableName) throws AccumuloException, TableNotFoundException
tableName
- the name of the table
TableNotFoundException
- if the table does not exist
AccumuloException
void setLocalityGroups(String tableName, Map<String,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 existMap<String,Set<org.apache.hadoop.io.Text>> getLocalityGroups(String tableName) throws AccumuloException, TableNotFoundException
tableName
- the name of the table
AccumuloException
- if a general error occurs
TableNotFoundException
- if the table does not existSet<Range> splitRangeByTablets(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 existvoid importDirectory(String tableName, String dir, String failureDir, boolean setTime) throws TableNotFoundException, 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 imported, must exist and be emptysetTime
- override the time values in the input files, and use the current time for all mutations
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 permissions
TableNotFoundException
- when the table no longer existsBulkImportHelper.AssignmentStats importDirectory(String tableName, String dir, String failureDir, int numThreads, int numAssignThreads, boolean disableGC) throws IOException, AccumuloException, AccumuloSecurityException
importDirectory(String, String, String, boolean)
IOException
AccumuloException
AccumuloSecurityException
void offline(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException
tableName
- the table to take offline
AccumuloException
- when there is a general accumulo error
AccumuloSecurityException
- when the user does not have the proper permissions
TableNotFoundException
void online(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException
tableName
- the table to take online
AccumuloException
- when there is a general accumulo error
AccumuloSecurityException
- when the user does not have the proper permissions
TableNotFoundException
void clearLocatorCache(String tableName) throws TableNotFoundException
tableName
- the name of the table
TableNotFoundException
- if table does not existMap<String,String> tableIdMap()
void attachIterator(String tableName, IteratorSetting setting) throws AccumuloSecurityException, AccumuloException, TableNotFoundException
tableName
- the name of the tablesetting
- object specifying the properties of the iterator
AccumuloSecurityException
- thrown if the user does not have the ability to set properties on the table
AccumuloException
TableNotFoundException
- throw if the table no longer exists
IllegalArgumentException
- if the setting conflicts with any existing iteratorsvoid attachIterator(String tableName, IteratorSetting setting, EnumSet<IteratorUtil.IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException, TableNotFoundException
tableName
- the name of the tablesetting
- object specifying the properties of the iterator
AccumuloSecurityException
- thrown if the user does not have the ability to set properties on the table
AccumuloException
TableNotFoundException
- throw if the table no longer exists
IllegalArgumentException
- if the setting conflicts with any existing iteratorsvoid removeIterator(String tableName, String name, EnumSet<IteratorUtil.IteratorScope> scopes) throws AccumuloSecurityException, AccumuloException, TableNotFoundException
tableName
- the name of the tablename
- the name of the iteratorscopes
- the scopes of the iterator
AccumuloSecurityException
- thrown if the user does not have the ability to set properties on the table
AccumuloException
TableNotFoundException
- throw if the table no longer existsIteratorSetting getIteratorSetting(String tableName, String name, IteratorUtil.IteratorScope scope) throws AccumuloSecurityException, AccumuloException, TableNotFoundException
tableName
- the name of the tablename
- the name of the iteratorscope
- the scope of the iterator
AccumuloSecurityException
- thrown if the user does not have the ability to set properties on the table
AccumuloException
TableNotFoundException
- throw if the table no longer existsMap<String,EnumSet<IteratorUtil.IteratorScope>> listIterators(String tableName) throws AccumuloSecurityException, AccumuloException, TableNotFoundException
tableName
- the name of the table
AccumuloSecurityException
AccumuloException
TableNotFoundException
void checkIteratorConflicts(String tableName, IteratorSetting setting, EnumSet<IteratorUtil.IteratorScope> scopes) throws AccumuloException, TableNotFoundException
tableName
- the name of the tablesetting
- object specifying the properties of the iterator
AccumuloException
TableNotFoundException
IllegalStateException
- if the setting conflicts with any existing iterators
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |