本文整理汇总了Java中org.apache.accumulo.core.client.admin.TableOperations.delete方法的典型用法代码示例。如果您正苦于以下问题:Java TableOperations.delete方法的具体用法?Java TableOperations.delete怎么用?Java TableOperations.delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.client.admin.TableOperations
的用法示例。
在下文中一共展示了TableOperations.delete方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCreateExistingTable
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
@Test
public void testCreateExistingTable() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException {
TableOperations tops = connector.tableOperations();
try {
Assert.assertFalse(tops.exists(table));
tops.create(table);
Assert.assertTrue(tops.exists(table));
try {
tops.create(table);
Assert.fail("Expected second table create to fail.");
} catch (TableExistsException tee) {
// expected
Assert.assertTrue(true);
}
} finally {
if (tops.exists(table)) {
tops.delete(table);
}
Assert.assertFalse(tops.exists(table));
}
}
示例2: setup
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
// this is a bit of a hack to clear any existing instances before
// adding the instances we want to exist for testing the list command
final TableOperations tableOps = getConnector().tableOperations();
final SecurityOperations secOps = getConnector().securityOperations();
secOps.grantSystemPermission("root", SystemPermission.DROP_TABLE);
for (final String tableName : getConnector().tableOperations().list()) {
if (!tableName.startsWith("accumulo.")) {
tableOps.delete(tableName);
}
}
}
示例3: tearDown
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
/**
* @throws java.lang.Exception
*/
@After
public void tearDown() throws Exception {
String indexTableName = tIndexer.getTableName();
tIndexer.close();
TableOperations tableOps = ConfigUtils.getConnector(conf).tableOperations();
if (tableOps.exists(indexTableName))
tableOps.delete(indexTableName);
}
示例4: destroyTable
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
private static void destroyTable(Configuration conf, String tablename) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException, TableExistsException {
TableOperations tableOps = ConfigUtils.getConnector(conf).tableOperations();
if (tableOps.exists(tablename)) {
tableOps.delete(tablename);
}
}
示例5: init
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
@Before
public void init() throws AccumuloException, AccumuloSecurityException,
RyaDAOException, RepositoryException, TableNotFoundException,
InferenceEngineException, NumberFormatException, UnknownHostException, SailException {
accumuloConn = ConfigUtils.getConnector(conf);
final TableOperations ops = accumuloConn.tableOperations();
if(ops.exists(prefix+"INDEX_"+ "testPcj")) {
ops.delete(prefix+"INDEX_"+ "testPcj");
}
ryaRepo = new RyaSailRepository(RyaSailFactory.getInstance(conf));
ryaConn = ryaRepo.getConnection();
}
示例6: deleteCoreRyaTables
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
public static void deleteCoreRyaTables(final Connector accCon, final String prefix)
throws AccumuloException, AccumuloSecurityException,
TableNotFoundException {
final TableOperations ops = accCon.tableOperations();
if (ops.exists(prefix + "spo")) {
ops.delete(prefix + "spo");
}
if (ops.exists(prefix + "po")) {
ops.delete(prefix + "po");
}
if (ops.exists(prefix + "osp")) {
ops.delete(prefix + "osp");
}
}
示例7: deleteIndexTables
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
public static void deleteIndexTables(final Connector accCon, final int tableNum,
final String prefix) throws AccumuloException, AccumuloSecurityException,
TableNotFoundException {
final TableOperations ops = accCon.tableOperations();
final String tablename = prefix + "INDEX_";
for (int i = 1; i < tableNum + 1; i++) {
if (ops.exists(tablename + i)) {
ops.delete(tablename + i);
}
}
}
示例8: testTableOps
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
@Test
public void testTableOps() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
TableOperations tops = connector.tableOperations();
Assert.assertFalse(tops.exists(table));
tops.create(table);
Assert.assertTrue(tops.exists(table));
tops.delete(table);
Assert.assertFalse(tops.exists(table));
}
示例9: testDeleteNonExistentTable
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
@Test
public void testDeleteNonExistentTable() throws AccumuloException, AccumuloSecurityException {
TableOperations tops = connector.tableOperations();
Assert.assertFalse(tops.exists(table));
try {
tops.delete(table);
Assert.fail("Expected second table create to fail.");
} catch (TableNotFoundException tnfe) {
// expected
Assert.assertTrue(true);
}
}
示例10: clear
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
/**
* Clear out this graph. This drops and recreates the backing tables.
*/
public void clear() {
shutdown();
try {
TableOperations tableOps = globals.getConfig()
.getConnector().tableOperations();
for (Index<? extends Element> index : getIndices()) {
tableOps.delete(((AccumuloIndex<? extends Element>)
index).getTableName());
}
for (String table : globals.getConfig().getTableNames()) {
if (tableOps.exists(table)) {
tableOps.delete(table);
tableOps.create(table);
SortedSet<Text> splits = globals.getConfig().getSplits();
if (splits != null) {
tableOps.addSplits(table, splits);
}
}
}
} catch (Exception e) {
throw new AccumuloGraphException(e);
}
}
示例11: recreateTable
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
public static void recreateTable(Connector conn, String table)
throws AccumuloException, AccumuloSecurityException, TableNotFoundException, TableExistsException {
TableOperations ops = conn.tableOperations();
if (ops.exists(table)) {
ops.delete(table);
}
createTableIfNotExists(conn, table);
}
示例12: deleteTable
import org.apache.accumulo.core.client.admin.TableOperations; //导入方法依赖的package包/类
/**
* Delete the indicated table.
*
* @param tableName
* Name of the table to delete.
*/
public static synchronized void deleteTable(String tableName) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
Connector connector = getConnector();
TableOperations tableOps = connector.tableOperations();
tableOps.delete(tableName);
}