org.apache.accumulo.core.client.Connector.createBatchDeleter()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.apache.accumulo.core.client.Connector.createBatchDeleter()方法的一些代码示例,展示了Connector.createBatchDeleter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connector.createBatchDeleter()方法的具体详情如下:
包路径:org.apache.accumulo.core.client.Connector
类名称:Connector
方法名:createBatchDeleter

Connector.createBatchDeleter介绍

[英]Factory method to create a BatchDeleter connected to Accumulo.
[中]用于创建连接到Accumulo的BatchDeleter的工厂方法。

代码示例

代码示例来源:origin: org.calrissian.mango/mango-accumulo

@Override
public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads, long maxMemory, long maxLatency, int maxWriteThreads) throws TableNotFoundException {
  return wrapped.createBatchDeleter(tableName, authorizations, numQueryThreads, maxMemory, maxLatency, maxWriteThreads);
}

代码示例来源:origin: org.apache.rya/accumulo.rya

private BatchDeleter createBatchDeleter(final String tableName, final Authorizations authorizations) throws TableNotFoundException {
  return connector.createBatchDeleter(tableName, authorizations, NUM_THREADS, MAX_MEMORY, MAX_TIME, NUM_THREADS);
}

代码示例来源:origin: apache/incubator-rya

private BatchDeleter createBatchDeleter(final String tableName, final Authorizations authorizations) throws TableNotFoundException {
  return connector.createBatchDeleter(tableName, authorizations, NUM_THREADS, MAX_MEMORY, MAX_TIME, NUM_THREADS);
}

代码示例来源:origin: NationalSecurityAgency/datawave

@Override
public void clear() {
  log.trace("Clearing Accumulo cache for table {}.", tableName);
  try {
    BatchWriterConfig bwCfg = new BatchWriterConfig();
    BatchDeleter deleter = connector.createBatchDeleter(tableName, authorizations, 10, bwCfg);
    try {
      deleter.setRanges(Collections.singletonList(new Range()));
      deleter.delete();
    } finally {
      deleter.close();
    }
  } catch (MutationsRejectedException | TableNotFoundException e) {
    throw new PersistenceException("Unable to clear Accumulo cache for " + tableName, e);
  }
}

代码示例来源:origin: org.apache.accumulo/accumulo-test

BatchDeleter ibd = env.getConnector().createBatchDeleter(indexTableName, Authorizations.EMPTY,
  8, bwc);
ibd.setRanges(Collections.singletonList(new Range()));
BatchDeleter dbd = env.getConnector().createBatchDeleter(dataTableName, Authorizations.EMPTY, 8,
  bwc);
dbd.setRanges(Collections.singletonList(new Range()));

代码示例来源:origin: apache/incubator-rya

@Override
public void deletePeriodicQueryResults(final String queryId, final long binId) throws PeriodicQueryStorageException {
  final String tableName = tableNameFactory.makeTableName(ryaInstance, queryId);
  BatchDeleter deleter = null;
  try {
    final Text prefix = getRowPrefix(binId);
    deleter = accumuloConn.createBatchDeleter(tableName, auths, 1, new BatchWriterConfig());
    deleter.setRanges(Collections.singleton(Range.prefix(prefix)));
    deleter.delete();
  } catch (final Exception e) {
    throw new PeriodicQueryStorageException(e.getMessage());
  } finally {
    try {
      if(deleter != null) {
        deleter.close();
      }
    } catch (final Exception e) {
      throw new PeriodicQueryStorageException(e.getMessage());
    }
  }
}

代码示例来源:origin: org.apache.accumulo/accumulo-test

private void removeLocation(String table, String tableNameToModify)
  throws TableNotFoundException, MutationsRejectedException {
 String tableIdToModify = getConnector().tableOperations().tableIdMap().get(tableNameToModify);
 BatchDeleter deleter = getConnector().createBatchDeleter(table, Authorizations.EMPTY, 1,
   new BatchWriterConfig());
 deleter.setRanges(
   Collections.singleton(new KeyExtent(tableIdToModify, null, null).toMetadataRange()));
 deleter.fetchColumnFamily(MetadataSchema.TabletsSection.CurrentLocationColumnFamily.NAME);
 deleter.delete();
 deleter.close();
}

代码示例来源:origin: edu.jhuapl.tinkerpop/blueprints-accumulo-graph

protected BatchDeleter getDeleter() {
 try {
  return globals.getConfig().getConnector().createBatchDeleter(tableName,
    globals.getConfig().getAuthorizations(), globals.getConfig().getMaxWriteThreads(),
    globals.getConfig().getBatchWriterConfig());
 } catch (Exception e) {
  throw new AccumuloGraphException(e);
 }
}

代码示例来源:origin: JHUAPL/AccumuloGraph

protected BatchDeleter getDeleter() {
 try {
  return globals.getConfig().getConnector().createBatchDeleter(tableName,
    globals.getConfig().getAuthorizations(), globals.getConfig().getMaxWriteThreads(),
    globals.getConfig().getBatchWriterConfig());
 } catch (Exception e) {
  throw new AccumuloGraphException(e);
 }
}

代码示例来源:origin: org.apache.accumulo/accumulo-test

BatchDeleter deleter = connector.createBatchDeleter(MetadataTable.NAME, Authorizations.EMPTY,
  1000, new BatchWriterConfig());
deleter.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);

代码示例来源:origin: edu.jhuapl.tinkerpop/blueprints-accumulo-graph

@Override
public <T extends Element> void dropKeyIndex(String key, Class<T> elementClass) {
 // TODO Move below to somewhere appropriate.
 if (elementClass == null) {
  throw ExceptionFactory.classForElementCannotBeNull();
 }
 globals.getIndexMetadataWrapper().clearKeyMetadataEntry(key, elementClass);
 String table = null;
 if (elementClass.equals(Vertex.class)) {
  table = globals.getConfig().getVertexKeyIndexTableName();
 } else {
  table = globals.getConfig().getEdgeKeyIndexTableName();
 }
 BatchDeleter bd = null;
 try {
  bd = globals.getConfig().getConnector().createBatchDeleter(table, globals.getConfig().getAuthorizations(), globals.getConfig().getMaxWriteThreads(), globals.getConfig().getBatchWriterConfig());
  bd.setRanges(Collections.singleton(new Range()));
  bd.fetchColumnFamily(new Text(key));
  bd.delete();
 } catch (Exception e) {
  throw new AccumuloGraphException(e);
 } finally {
  if (bd != null)
   bd.close();
 }
 globals.checkedFlush();
}

代码示例来源:origin: JHUAPL/AccumuloGraph

@Override
public <T extends Element> void dropKeyIndex(String key, Class<T> elementClass) {
 // TODO Move below to somewhere appropriate.
 if (elementClass == null) {
  throw ExceptionFactory.classForElementCannotBeNull();
 }
 globals.getIndexMetadataWrapper().clearKeyMetadataEntry(key, elementClass);
 String table = null;
 if (elementClass.equals(Vertex.class)) {
  table = globals.getConfig().getVertexKeyIndexTableName();
 } else {
  table = globals.getConfig().getEdgeKeyIndexTableName();
 }
 BatchDeleter bd = null;
 try {
  bd = globals.getConfig().getConnector().createBatchDeleter(table, globals.getConfig().getAuthorizations(), globals.getConfig().getMaxWriteThreads(), globals.getConfig().getBatchWriterConfig());
  bd.setRanges(Collections.singleton(new Range()));
  bd.fetchColumnFamily(new Text(key));
  bd.delete();
 } catch (Exception e) {
  throw new AccumuloGraphException(e);
 } finally {
  if (bd != null)
   bd.close();
 }
 globals.checkedFlush();
}

相关文章