private PersistentAdapterStore getOrCreateAdapterStore() { if (adapterStore == null) { adapterStore = storeOptions.createAdapterStore(); } return adapterStore; }
public PersistentAdapterStore createAdapterStore() { return dataStorePlugin.createAdapterStore(); }
public PersistentAdapterStore getAdapterStore(final PropertyManagement runTimeProperties) throws Exception { final PersistableStore store = (PersistableStore) StoreParameters.StoreParam.INPUT_STORE.getHelper().getValue( runTimeProperties); return store.getDataStoreOptions().createAdapterStore(); }
public static DataTypeAdapter getDataAdapter( final DataStorePluginOptions dataStore, final String typeName) { final Short adapterId = dataStore.createInternalAdapterStore().getAdapterId(typeName); if (adapterId == null) { return null; } final DataTypeAdapter adapter = dataStore.createAdapterStore().getAdapter(adapterId); if (adapter == null) { return null; } return adapter; }
public static List<String> getFeatureTypeNames(final DataStorePluginOptions dataStore) { final ArrayList<String> featureTypeNames = new ArrayList<>(); try (final CloseableIterator<InternalDataAdapter<?>> adapterIt = dataStore.createAdapterStore().getAdapters()) { while (adapterIt.hasNext()) { final DataTypeAdapter<?> adapter = adapterIt.next().getAdapter(); if (adapter instanceof GeotoolsFeatureDataAdapter) { featureTypeNames.add(adapter.getTypeName()); } } return featureTypeNames; } } }
public static SimpleFeatureType getFeatureType( final DataStorePluginOptions dataStore, String typeName) { // if no id provided, locate a single featureadapter if (typeName == null) { final List<String> typeNameList = FeatureDataUtils.getFeatureTypeNames(dataStore); if (typeNameList.size() >= 1) { typeName = typeNameList.get(0); } else if (typeNameList.isEmpty()) { LOGGER.error("No feature adapters found for use with time param"); return null; } else { LOGGER.error("Multiple feature adapters found. Please specify one."); return null; } } final PersistentAdapterStore adapterStore = dataStore.createAdapterStore(); final InternalAdapterStore internalAdapterStore = dataStore.createInternalAdapterStore(); final DataTypeAdapter<?> adapter = adapterStore.getAdapter(internalAdapterStore.getAdapterId(typeName)).getAdapter(); if ((adapter != null) && (adapter instanceof GeotoolsFeatureDataAdapter)) { final GeotoolsFeatureDataAdapter gtAdapter = (GeotoolsFeatureDataAdapter) adapter; return gtAdapter.getFeatureType(); } return null; }
public static int getFeatureAdapterCount(final DataStorePluginOptions dataStore) { try (final CloseableIterator<InternalDataAdapter<?>> adapterIt = dataStore.createAdapterStore().getAdapters()) { int featureAdapters = 0; while (adapterIt.hasNext()) { final DataTypeAdapter<?> adapter = adapterIt.next().getAdapter(); if (adapter instanceof GeotoolsFeatureDataAdapter) { featureAdapters++; } } return featureAdapters; } }
final PersistentAdapterStore adapterStore = inputStoreOptions.createAdapterStore();
inputStoreOptions.createAdapterIndexMappingStore(); try (CloseableIterator<InternalDataAdapter<?>> adapterIt = inputStoreOptions.createAdapterStore().getAdapters()) { while (adapterIt.hasNext()) { final InternalDataAdapter<?> dataAdapter = adapterIt.next();
conf, dataTypeOptions, dataStoreOptions.createAdapterStore(), dataStoreOptions.createInternalAdapterStore());
@Override protected void lastSceneComplete(final AnalysisInfo analysisInfo) { processPreviousScene(); super.lastSceneComplete(analysisInfo); if (!ingestOptions.isSkipMerge()) { System.out.println("Merging overlapping tiles..."); for (final Index index : indices) { if (dataStorePluginOptions.createDataStoreOperations().mergeData( index, dataStorePluginOptions.createAdapterStore(), dataStorePluginOptions.createInternalAdapterStore(), dataStorePluginOptions.createAdapterIndexMappingStore(), dataStorePluginOptions.getFactoryOptions().getStoreOptions().getMaxRangeDecomposition())) { System.out.println( "Successfully merged overlapping tiles within index '" + index.getName() + "'"); } else { System.err.println( "Unable to merge overlapping landsat8 tiles in index '" + index.getName() + "'"); } } } }
public static String getGeomField(final DataStorePluginOptions dataStore, final String typeName) { final PersistentAdapterStore adapterStore = dataStore.createAdapterStore(); final InternalAdapterStore internalAdapterStore = dataStore.createInternalAdapterStore(); final DataTypeAdapter<?> adapter = adapterStore.getAdapter(internalAdapterStore.getAdapterId(typeName)).getAdapter(); if ((adapter != null) && (adapter instanceof GeotoolsFeatureDataAdapter)) { final GeotoolsFeatureDataAdapter gtAdapter = (GeotoolsFeatureDataAdapter) adapter; final SimpleFeatureType featureType = gtAdapter.getFeatureType(); if (featureType.getGeometryDescriptor() != null) { return featureType.getGeometryDescriptor().getLocalName(); } } return null; }
@Override protected void lastSceneComplete(final AnalysisInfo analysisInfo) { processPreviousScene(); super.lastSceneComplete(analysisInfo); if (!ingestOptions.isSkipMerge()) { System.out.println("Merging overlapping tiles..."); for (final Index index : indices) { if (dataStorePluginOptions.createDataStoreOperations().mergeData( index, dataStorePluginOptions.createAdapterStore(), dataStorePluginOptions.createInternalAdapterStore(), dataStorePluginOptions.createAdapterIndexMappingStore(), dataStorePluginOptions.getFactoryOptions().getStoreOptions().getMaxRangeDecomposition())) { System.out.println( "Successfully merged overlapping tiles within index '" + index.getName() + "'"); } else { System.err.println( "Unable to merge overlapping landsat8 tiles in index '" + index.getName() + "'"); } } } // Clear all scene files? if ((lastScene != null) && !ingestOptions.isRetainImages()) { DownloadRunner.cleanDownloadedFiles(lastScene, sentinel2Options.getWorkspaceDir()); } lastScene = null; }
conf); final String[] typeNames = mrOptions.getTypeNames(); final PersistentAdapterStore adapterStore = storeOptions.createAdapterStore(); final InternalAdapterStore internalAdapterStore = storeOptions.createInternalAdapterStore(); final VectorQueryBuilder bldr = VectorQueryBuilder.newBuilder(); storeOptions.createAdapterStore().getAdapter(internalAdpaterId); if (adapter == null) { JCommander.getConsole().println("Type '" + typeName + "' not found");
if (!it.hasNext()) { if (adapterStore == null) { adapterStore = dataStoreOptions.createAdapterStore(); internalAdapterStore = dataStoreOptions.createInternalAdapterStore(); adapterIndexMappingStore = dataStoreOptions.createAdapterIndexMappingStore();
conf, rddOpts.getQuery(), storeOptions.createAdapterStore(), storeOptions.createInternalAdapterStore(), storeOptions.createIndexStore());
final PersistentAdapterStore adapterStore = inputDataStore.createAdapterStore(); final InternalAdapterStore internalAdapterStore = inputDataStore.createInternalAdapterStore();
final PersistentAdapterStore adapterStore = inputStoreOptions.createAdapterStore(); final InternalAdapterStore internalAdapterStore = inputStoreOptions.createInternalAdapterStore();
public static String getTimeField(final DataStorePluginOptions dataStore, final String typeName) { final PersistentAdapterStore adapterStore = dataStore.createAdapterStore(); final InternalAdapterStore internalAdapterStore = dataStore.createInternalAdapterStore(); final DataTypeAdapter<?> adapter = adapterStore.getAdapter(internalAdapterStore.getAdapterId(typeName)).getAdapter(); if ((adapter != null) && (adapter instanceof GeotoolsFeatureDataAdapter)) { final GeotoolsFeatureDataAdapter gtAdapter = (GeotoolsFeatureDataAdapter) adapter; final SimpleFeatureType featureType = gtAdapter.getFeatureType(); final TimeDescriptors timeDescriptors = gtAdapter.getTimeDescriptors(); // If not indexed, try to find a time field if ((timeDescriptors == null) || !timeDescriptors.hasTime()) { for (final AttributeDescriptor attrDesc : featureType.getAttributeDescriptors()) { final Class<?> bindingClass = attrDesc.getType().getBinding(); if (TimeUtils.isTemporal(bindingClass)) { return attrDesc.getLocalName(); } } } else { if (timeDescriptors.getTime() != null) { return timeDescriptors.getTime().getLocalName(); } else if (timeDescriptors.getStartRange() != null) { // give back start|stop string return timeDescriptors.getStartRange().getLocalName() + "|" + timeDescriptors.getEndRange().getLocalName(); } } } return null; }
configuration, query.getDataTypeQueryOptions(), dataStoreOptions.createAdapterStore(), dataStoreOptions.createInternalAdapterStore());