当前位置: 首页>>代码示例>>Java>>正文


Java TableOperations.delete方法代码示例

本文整理汇总了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));
  }
}
 
开发者ID:JHUAPL,项目名称:accumulo-proxy-instance,代码行数:23,代码来源:TableOpsTest.java

示例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);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:15,代码来源:AccumuloListInstancesIT.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:13,代码来源:AccumuloTemporalIndexerTest.java

示例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);
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:8,代码来源:AccumuloFreeTextIndexerTest.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:13,代码来源:AccumuloIndexSetTest.java

示例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");
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:15,代码来源:PcjIntegrationTestingUtil.java

示例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);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-rya,代码行数:12,代码来源:PcjIntegrationTestingUtil.java

示例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));
}
 
开发者ID:JHUAPL,项目名称:accumulo-proxy-instance,代码行数:11,代码来源:TableOpsTest.java

示例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);
  }
}
 
开发者ID:JHUAPL,项目名称:accumulo-proxy-instance,代码行数:14,代码来源:TableOpsTest.java

示例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);
  }
}
 
开发者ID:JHUAPL,项目名称:AccumuloGraph,代码行数:30,代码来源:AccumuloGraph.java

示例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);
}
 
开发者ID:mikelieberman,项目名称:blueprints-accumulo-graph,代码行数:11,代码来源:Utils.java

示例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);
}
 
开发者ID:mit-ll,项目名称:PACE,代码行数:12,代码来源:AccumuloInstance.java


注:本文中的org.apache.accumulo.core.client.admin.TableOperations.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。