org.locationtech.geowave.core.store.api.DataStore.delete()方法的使用及代码示例

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

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

DataStore.delete介绍

[英]Delete all data in this data store that matches the query parameter.

Statistics are updated as required.
[中]删除此数据存储中与查询参数匹配的所有数据。
根据需要更新统计数据。

代码示例

代码示例来源:origin: locationtech/geowave

public static void deleteAll(final DataStorePluginOptions dataStore) {
 dataStore.createDataStore().delete(QueryBuilder.newBuilder().build());
}

代码示例来源:origin: locationtech/geowave

@Override
 public Void computeResults(final OperationParams params) {
  // Ensure we have all the required arguments
  if (parameters.size() != 2) {
   throw new ParameterException("Requires arguments: <store name> <type name>");
  }

  final String inputStoreName = parameters.get(0);
  final String typeName = parameters.get(1);

  // Attempt to load store.
  final File configFile = getGeoWaveConfigFile(params);

  final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName);
  if (!inputStoreLoader.loadFromConfig(configFile)) {
   throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
  }
  inputStoreOptions = inputStoreLoader.getDataStorePlugin();

  LOGGER.info("Deleting everything in store: " + inputStoreName + " with type name: " + typeName);
  inputStoreOptions.createDataStore().delete(
    QueryBuilder.newBuilder().addTypeName(typeName).build());
  return null;
 }
}

代码示例来源:origin: locationtech/geowave

@Override
 public Void computeResults(final OperationParams params) {
  if (parameters.size() < 1) {
   throw new ParameterException("Must specify store name");
  }

  final String inputStoreName = parameters.get(0);

  // Attempt to load store.
  final File configFile = getGeoWaveConfigFile(params);

  // Attempt to load input store.
  final StoreLoader inputStoreLoader = new StoreLoader(inputStoreName);
  if (!inputStoreLoader.loadFromConfig(configFile)) {
   throw new ParameterException("Cannot find store name: " + inputStoreLoader.getStoreName());
  }
  inputStoreOptions = inputStoreLoader.getDataStorePlugin();

  LOGGER.info("Deleting everything in store: " + inputStoreName);

  inputStoreOptions.createDataStore().delete(QueryBuilder.newBuilder().build());
  return null;
 }
}

代码示例来源:origin: locationtech/geowave

public void remove(final String fid, final GeoWaveTransaction transaction) throws IOException {
 final VectorQueryBuilder bldr = VectorQueryBuilder.newBuilder();
 dataStore.delete(
   bldr.setAuthorizations(transaction.composeAuthorizations()).addTypeName(
     adapter.getTypeName()).constraints(
       bldr.constraintsFactory().dataIds(StringUtils.stringToBinary(fid))).build());
}

代码示例来源:origin: locationtech/geowave

public void remove(final SimpleFeature feature, final GeoWaveTransaction transaction)
  throws IOException {
 final VectorQueryBuilder bldr = VectorQueryBuilder.newBuilder();
 dataStore.delete(
   bldr.setAuthorizations(transaction.composeAuthorizations()).addTypeName(
     adapter.getTypeName()).constraints(
       bldr.constraintsFactory().dataIds(adapter.getDataId(feature))).build());
}

代码示例来源:origin: locationtech/geowave

protected long delete(
  final GeotoolsFeatureDataAdapter adapter,
  final String typeName,
  final String indexName,
  final DataStore dataStore,
  final boolean debug) {
 long missed = 0;
 final VectorQueryBuilder bldr = VectorQueryBuilder.newBuilder();
 final Query<SimpleFeature> query =
   bldr.addTypeName(typeName).indexName(indexName).constraints(
     bldr.constraintsFactory().cqlConstraints(cqlStr)).build();
 final boolean success = dataStore.delete(query);
 if (debug) {
  LOGGER.debug("CQL Delete " + (success ? "Success" : "Failure"));
 }
 // Verify delete by running the CQL query
 if (debug) {
  try (final CloseableIterator<SimpleFeature> it = dataStore.query(query)) {
   while (it.hasNext()) {
    it.next();
    missed++;
   }
  }
 }
 return missed;
}

相关文章