public class CheckedDistributedStorageAdmin extends java.lang.Object implements DistributedStorageAdmin
| Constructor and Description |
|---|
CheckedDistributedStorageAdmin(DistributedStorageAdmin admin) |
CheckedDistributedStorageAdmin(DistributedStorageAdmin admin,
boolean checkNamespace) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNewColumnToTable(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName,
DataType columnType)
Adds a new column to an existing table.
|
void |
addRawColumnToTable(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName,
DataType columnType)
Add a column in the table without updating the metadata table in ScalarDB.
|
void |
close()
Closes connections to the storage.
|
void |
createIndex(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName,
java.util.Map<java.lang.String,java.lang.String> options)
Creates a secondary index for the specified column of the specified table.
|
void |
createNamespace(java.lang.String namespace,
java.util.Map<java.lang.String,java.lang.String> options)
Creates a namespace.
|
void |
createTable(java.lang.String namespace,
java.lang.String table,
TableMetadata metadata,
java.util.Map<java.lang.String,java.lang.String> options)
Creates a new table.
|
void |
dropIndex(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName)
Drops a secondary index for the specified column of the specified table.
|
void |
dropNamespace(java.lang.String namespace)
Drops the specified namespace.
|
void |
dropTable(java.lang.String namespace,
java.lang.String table)
Drops the specified table.
|
TableMetadata |
getImportTableMetadata(java.lang.String namespace,
java.lang.String table)
Get import table metadata in the ScalarDB format.
|
java.util.Set<java.lang.String> |
getNamespaceNames()
Returns the names of the existing namespaces.
|
java.util.Set<java.lang.String> |
getNamespaceTableNames(java.lang.String namespace)
Returns the names of the table belonging to the given namespace.
|
TableMetadata |
getTableMetadata(java.lang.String namespace,
java.lang.String table)
Retrieves the table metadata of the specified table.
|
void |
importTable(java.lang.String namespace,
java.lang.String table,
java.util.Map<java.lang.String,java.lang.String> options)
Imports an existing table that is not managed by ScalarDB.
|
boolean |
indexExists(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName)
Returns true if the secondary index exists.
|
boolean |
namespaceExists(java.lang.String namespace)
Returns true if the namespace exists.
|
void |
repairTable(java.lang.String namespace,
java.lang.String table,
TableMetadata metadata,
java.util.Map<java.lang.String,java.lang.String> options)
Repairs a table which may be in an unknown state.
|
boolean |
tableExists(java.lang.String namespace,
java.lang.String table)
Returns true if the table exists.
|
void |
truncateTable(java.lang.String namespace,
java.lang.String table)
Truncates the specified table.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNewColumnToTable, createIndex, createIndex, createIndex, createNamespace, createNamespace, createNamespace, createTable, createTable, createTable, dropIndex, dropNamespace, dropTablepublic CheckedDistributedStorageAdmin(DistributedStorageAdmin admin)
public CheckedDistributedStorageAdmin(DistributedStorageAdmin admin, boolean checkNamespace)
public void createNamespace(java.lang.String namespace,
java.util.Map<java.lang.String,java.lang.String> options)
throws ExecutionException
AdmincreateNamespace in interface Adminnamespace - the namespace to createoptions - namespace creation optionsExecutionException - if the operation failspublic void createTable(java.lang.String namespace,
java.lang.String table,
TableMetadata metadata,
java.util.Map<java.lang.String,java.lang.String> options)
throws ExecutionException
AdmincreateTable in interface Adminnamespace - a namespace already createdtable - a table to createmetadata - a metadata to createoptions - options to createExecutionException - if the operation failspublic void dropTable(java.lang.String namespace,
java.lang.String table)
throws ExecutionException
AdmindropTable in interface Adminnamespace - a namespace to droptable - a table to dropExecutionException - if the operation failspublic void dropNamespace(java.lang.String namespace)
throws ExecutionException
AdmindropNamespace in interface Adminnamespace - a namespace to dropExecutionException - if the operation failspublic void truncateTable(java.lang.String namespace,
java.lang.String table)
throws ExecutionException
AdmintruncateTable in interface Adminnamespace - a namespace to truncatetable - a table to truncateExecutionException - if the operation failspublic void createIndex(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName,
java.util.Map<java.lang.String,java.lang.String> options)
throws ExecutionException
AdmincreateIndex in interface Adminnamespace - a namespace to create a secondary indextable - a table to create a secondary indexcolumnName - a name of the target columnoptions - options to create a secondary indexExecutionException - if the operation failspublic void dropIndex(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName)
throws ExecutionException
AdmindropIndex in interface Adminnamespace - a namespace to drop a secondary indextable - a table to drop a secondary indexcolumnName - a name of the target columnExecutionException - if the operation fails@Nullable public TableMetadata getTableMetadata(java.lang.String namespace, java.lang.String table) throws ExecutionException
AdmingetTableMetadata in interface Adminnamespace - a namespace to retrievetable - a table to retrieveExecutionException - if the operation failspublic java.util.Set<java.lang.String> getNamespaceTableNames(java.lang.String namespace)
throws ExecutionException
AdmingetNamespaceTableNames in interface Adminnamespace - a namespaceExecutionException - if the operation failspublic boolean namespaceExists(java.lang.String namespace)
throws ExecutionException
AdminnamespaceExists in interface Adminnamespace - a namespaceExecutionException - if the operation failspublic boolean tableExists(java.lang.String namespace,
java.lang.String table)
throws ExecutionException
AdmintableExists in interface Adminnamespace - a namespacetable - a tableExecutionException - if the operation failspublic boolean indexExists(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName)
throws ExecutionException
AdminindexExists in interface Adminnamespace - a namespacetable - a tablecolumnName - a name of the target columnExecutionException - if the operation failspublic void repairTable(java.lang.String namespace,
java.lang.String table,
TableMetadata metadata,
java.util.Map<java.lang.String,java.lang.String> options)
throws ExecutionException
AdminrepairTable in interface Adminnamespace - an existing namespacetable - an existing tablemetadata - the metadata associated to the table to repairoptions - options to repairExecutionException - if the operation failspublic void addNewColumnToTable(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName,
DataType columnType)
throws ExecutionException
AdminaddNewColumnToTable in interface Adminnamespace - the table namespacetable - the table namecolumnName - the name of the new columncolumnType - the type of the new columnExecutionException - if the operation failspublic TableMetadata getImportTableMetadata(java.lang.String namespace, java.lang.String table) throws ExecutionException
DistributedStorageAdmingetImportTableMetadata in interface DistributedStorageAdminnamespace - namespace name of import tabletable - import table nameExecutionException - if the operation failspublic void importTable(java.lang.String namespace,
java.lang.String table,
java.util.Map<java.lang.String,java.lang.String> options)
throws ExecutionException
AdminimportTable in interface Adminnamespace - an existing namespacetable - an existing tableoptions - options to importExecutionException - if the operation failspublic void addRawColumnToTable(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName,
DataType columnType)
throws ExecutionException
DistributedStorageAdminaddRawColumnToTable in interface DistributedStorageAdminnamespace - namespace name of import tabletable - import table namecolumnName - name of the column to be addedcolumnType - type of the column to be addedExecutionException - if the operation failspublic java.util.Set<java.lang.String> getNamespaceNames()
throws ExecutionException
AdmingetNamespaceNames in interface AdminExecutionException - if the operation failspublic void close()
DistributedStorageAdminclose in interface DistributedStorageAdminclose in interface java.lang.AutoCloseable