public interface DistributedStorageAdmin extends Admin, java.lang.AutoCloseable
StorageFactory factory = StorageFactory.create(configFilePath);
DistributedStorageAdmin admin = factory.getAdmin();
// Create a namespace
// Assumes that the namespace name is NAMESPACE
admin.createNamespace(NAMESPACE);
// Create a table
// Assumes that the namespace name and the table name are NAMESPACE and TABLE respectively
TableMetadata tableMetadata = TableMetadata.newBuilder()
...
.build();
admin.createTable(NAMESPACE, TABLE, tableMetadata);
// Get a table metadata
tableMetadata = admin.getTableMetadata(NAMESPACE, TABLE);
// Truncate a table
admin.truncateTable(NAMESPACE, TABLE);
// Drop a table
admin.dropTable(NAMESPACE, TABLE);
// Drop a namespace
admin.dropNamespace(NAMESPACE);
| Modifier and Type | Method and Description |
|---|---|
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.
|
TableMetadata |
getImportTableMetadata(java.lang.String namespace,
java.lang.String table)
Get import table metadata in the ScalarDB format.
|
addNewColumnToTable, addNewColumnToTable, createIndex, createIndex, createIndex, createIndex, createNamespace, createNamespace, createNamespace, createNamespace, createTable, createTable, createTable, createTable, dropIndex, dropIndex, dropNamespace, dropNamespace, dropTable, dropTable, getNamespaceNames, getNamespaceTableNames, getTableMetadata, importTable, indexExists, namespaceExists, repairTable, tableExists, truncateTableTableMetadata getImportTableMetadata(java.lang.String namespace, java.lang.String table) throws ExecutionException
namespace - namespace name of import tabletable - import table namejava.lang.IllegalArgumentException - if the table does not existjava.lang.IllegalStateException - if the table does not meet the requirement of ScalarDB tableExecutionException - if the operation failsvoid addRawColumnToTable(java.lang.String namespace,
java.lang.String table,
java.lang.String columnName,
DataType columnType)
throws ExecutionException
namespace - namespace name of import tabletable - import table namecolumnName - name of the column to be addedcolumnType - type of the column to be addedjava.lang.IllegalArgumentException - if the table does not existExecutionException - if the operation failsvoid close()
close in interface java.lang.AutoCloseable