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

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

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

DataStore.addType介绍

[英]Add this type to the data store. This only needs to be called one time ever per type.
[中]将此类型添加到数据存储中。每种类型只需要调用一次。

代码示例

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

@Override
public synchronized Writer<?> create(final TypeNameKeyWithIndices adapterWithIndices)
  throws Exception {
 dataStore.addType(
   adapterStore.getAdapter(adapterWithIndices.typeName),
   adapterWithIndices.indices);
 return dataStore.createWriter(adapterWithIndices.typeName);
}

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

private static void ingestCannedData() throws IOException {
 final List<SimpleFeature> points = new ArrayList<>();
 System.out.println("Building SimpleFeatures from canned data set...");
 for (final Entry<String, Coordinate> entry : cannedData.entrySet()) {
  System.out.println("Added point: " + entry.getKey());
  points.add(buildSimpleFeature(entry.getKey(), entry.getValue()));
 }
 System.out.println("Ingesting canned data...");
 dataStore.addType(ADAPTER, index);
 try (Writer<SimpleFeature> indexWriter = dataStore.createWriter(ADAPTER.getTypeName())) {
  for (final SimpleFeature sf : points) {
   //
   indexWriter.write(sf);
  }
 }
 System.out.println("Ingest complete.");
}

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

public synchronized Writer getIndexWriter(
  final DataTypeAdapter<?> adapter,
  final Index... requiredIndices) throws MismatchedIndexToAdapterMapping {
 Writer indexWriter = adapterIdToWriterCache.get(adapter.getTypeName());
 if (indexWriter == null) {
  dataStore.addType(adapter, requiredIndices);
  indexWriter = dataStore.createWriter(adapter.getTypeName());
  adapterIdToWriterCache.put(adapter.getTypeName(), indexWriter);
 }
 return indexWriter;
}

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

private void ingest(
  final FeatureDataAdapter adapter,
  final Index index,
  final List<SimpleFeature> features) {
 dataStore.addType(adapter, index);
 try (Writer<SimpleFeature> indexWriter = dataStore.createWriter(adapter.getTypeName())) {
  for (final SimpleFeature sf : features) {
   indexWriter.write(sf);
  }
 }
}

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

protected void setup(
  final Job job,
  final String namespace,
  final DataTypeAdapter<?> adapter,
  final Index index) throws IOException, MismatchedIndexToAdapterMapping {
 GeoWaveOutputFormat.setStoreOptions(job.getConfiguration(), outputDataStoreOptions);
 GeoWaveOutputFormat.addDataAdapter(job.getConfiguration(), adapter);
 GeoWaveOutputFormat.addIndex(job.getConfiguration(), index);
 final DataStore dataStore = outputDataStoreOptions.createDataStore();
 dataStore.addType(adapter, index);
 final Writer writer = dataStore.createWriter(adapter.getTypeName());
 writer.close();
}

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

private synchronized Writer<?> getIndexWriter(
  final DataTypeAdapter<?> adapter,
  final String[] indexNames) throws MismatchedIndexToAdapterMapping {
 Writer<?> writer = adapterTypeNameToIndexWriterCache.get(adapter.getTypeName());
 if (writer == null) {
  final Index[] indices = new Index[indexNames.length];
  int i = 0;
  for (final String indexName : indexNames) {
   final Index index = indexStore.getIndex(indexName);
   if (index != null) {
    indices[i++] = index;
   } else {
    LOGGER.warn("Index '" + indexName + "' does not exist");
   }
  }
  dataStore.addType(adapter, indices);
  writer = dataStore.createWriter(adapter.getTypeName());
  adapterTypeNameToIndexWriterCache.put(adapter.getTypeName(), writer);
 }
 return writer;
}

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

@SuppressWarnings("unchecked")
public void write(
  final Iterator<SimpleFeature> featureIt,
  final Set<String> fidList,
  final GeoWaveTransaction transaction) throws IOException {
 final VisibilityWriter<SimpleFeature> visibilityWriter =
   new UniformVisibilityWriter<>(
     new GlobalVisibilityHandler<>(transaction.composeVisibility()));
 dataStore.addType(adapter, adapterIndices);
 try (Writer<SimpleFeature> indexWriter = dataStore.createWriter(adapter.getTypeName())) {
  while (featureIt.hasNext()) {
   final SimpleFeature feature = featureIt.next();
   fidList.add(feature.getID());
   indexWriter.write(feature, visibilityWriter);
  }
 }
}

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

public void writeCommit(final SimpleFeature feature, final GeoWaveTransaction transaction)
  throws IOException {
 final VisibilityWriter<SimpleFeature> visibilityWriter =
   new UniformVisibilityWriter<>(
     new GlobalVisibilityHandler<>(transaction.composeVisibility()));
 dataStore.addType(adapter, adapterIndices);
 try (Writer<SimpleFeature> indexWriter = dataStore.createWriter(adapter.getTypeName())) {
  indexWriter.write(feature, visibilityWriter);
 }
}

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

new double[][] {new double[] {nodataValue}},
    new NoDataMergeStrategy());
store.addType(adapter, indices);
writer = store.createWriter(adapter.getTypeName());
writerCache.put(coverageName, writer);

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

new double[][] {new double[] {nodataValue}},
    new NoDataMergeStrategy());
store.addType(adapter, indices);
writer = store.createWriter(adapter.getTypeName());
writerCache.put(coverageName, writer);

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

dataStore.addType(adapter, index);
try (Writer<SimpleFeature> indexWriter = dataStore.createWriter(adapter.getTypeName())) {
 for (final SimpleFeature sf : points) {

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

store.addType(sceneAdapter, indices);
sceneWriter = store.createWriter(sceneAdapter.getTypeName());
final SimpleFeatureType bandType = BandFeatureIterator.createFeatureType(sceneType);
final FeatureDataAdapter bandAdapter = new FeatureDataAdapter(bandType);
store.addType(bandAdapter, indices);
bandWriter = store.createWriter(bandAdapter.getTypeName());
super.runInternal(params);

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

final Index featureIndex =
  new SpatialDimensionalityTypeProvider().createIndex(new SpatialOptions());
featureStore.addType(featureAdapter, featureIndex);
try (Writer writer = featureStore.createWriter(featureAdapter.getTypeName())) {

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

vectorStore.addType(sceneAdapter, vectorIndices);
sceneWriter = vectorStore.createWriter(sceneAdapter.getTypeName());
final SimpleFeatureType bandType = BandFeatureIterator.createFeatureType(sceneType);
final FeatureDataAdapter bandAdapter = new FeatureDataAdapter(bandType);
vectorStore.addType(bandAdapter, vectorIndices);
bandWriter = vectorStore.createWriter(bandAdapter.getTypeName());

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

store.addType(sceneAdapter, indices);
sceneWriter = store.createWriter(sceneAdapter.getTypeName());
store.addType(bandAdapter, indices);
bandWriter = store.createWriter(bandAdapter.getTypeName());

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

vectorStore.addType(sceneAdapter, vectorIndices);
sceneWriter = vectorStore.createWriter(sceneAdapter.getTypeName());
final FeatureDataAdapter bandAdapter = new FeatureDataAdapter(bandType);
vectorStore.addType(bandAdapter, vectorIndices);
bandWriter = vectorStore.createWriter(bandAdapter.getTypeName());

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

/** * Here we will change the ingest mechanism to use a producer/consumer pattern */
protected void writeExampleData(final DataStore geowaveDataStore) {
 // In order to store data we need to determine the type of data store
 final SimpleFeatureType point = createPointFeatureType();
 // This a factory class that builds simple feature objects based on the
 // type passed
 final SimpleFeatureBuilder pointBuilder = new SimpleFeatureBuilder(point);
 // This is an adapter, that is needed to describe how to persist the
 // data type passed
 final GeotoolsFeatureDataAdapter dataTypeAdapter = createDataAdapter(point);
 // This describes how to index the data
 final Index index = createSpatialIndex();
 geowaveDataStore.addType(dataTypeAdapter, index);
 // make sure to close the index writer (a try-with-resources block such
 // as this automatically closes the resource when exiting the block)
 try (Writer<SimpleFeature> indexWriter =
   geowaveDataStore.createWriter(dataTypeAdapter.getTypeName())) {
  // build a grid of points across the globe at each whole
  // lattitude/longitude intersection
  for (final SimpleFeature sft : getGriddedFeatures(pointBuilder, 1000)) {
   indexWriter.write(sft);
  }
 }
}

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

featureStore.addType(featureAdapter, featureIndex);
try (Writer writer = featureStore.createWriter(featureAdapter.getTypeName())) {

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

final Index featureIndex =
  new SpatialDimensionalityTypeProvider().createIndex(new SpatialOptions());
featureStore.addType(featureAdapter, featureIndex);
try (Writer writer = featureStore.createWriter(featureAdapter.getTypeName())) {
 for (final Vector center : clusterModel.clusterCenters()) {

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

other.addType(sourceTypes[i]);

相关文章