public class BaseDataStore extends Object implements DataStore
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseDataStore.DeletionMode |
Modifier and Type | Field and Description |
---|---|
protected PersistentAdapterStore |
adapterStore |
protected DataStoreOperations |
baseOperations |
protected DataStoreOptions |
baseOptions |
protected AdapterIndexMappingStore |
indexMappingStore |
protected IndexStore |
indexStore |
protected InternalAdapterStore |
internalAdapterStore |
protected PropertyStore |
propertyStore |
protected DataStatisticsStore |
statisticsStore |
Constructor and Description |
---|
BaseDataStore(IndexStore indexStore,
PersistentAdapterStore adapterStore,
DataStatisticsStore statisticsStore,
AdapterIndexMappingStore indexMappingStore,
DataStoreOperations operations,
DataStoreOptions options,
InternalAdapterStore internalAdapterStore,
PropertyStore propertyStore) |
Modifier and Type | Method and Description |
---|---|
void |
addEmptyStatistic(Statistic<?>... statistic)
Add a statistic to the data store.
|
void |
addIndex(Index index)
Add an index to the data store.
|
void |
addIndex(String typeName,
Index... indices)
Add new indices for the given type.
|
void |
addStatistic(Statistic<?>... statistic)
Add a statistic to the data store.
|
<T> void |
addType(DataTypeAdapter<T> dataTypeAdapter,
Index... initialIndices)
Add this type to the data store.
|
<T> void |
addType(DataTypeAdapter<T> dataTypeAdapter,
List<Statistic<?>> statistics,
Index... initialIndices)
Add this type to the data store with the given statistics.
|
<T> void |
addType(DataTypeAdapter<T> dataTypeAdapter,
VisibilityHandler visibilityHandler,
List<Statistic<?>> statistics,
Index... initialIndices)
Add this type to the data store with the given statistics and visibility handler.
|
protected <T> boolean |
addTypeInternal(DataTypeAdapter<T> dataTypeAdapter,
VisibilityHandler visibilityHandler,
Index... initialIndices) |
<P extends Persistable,R,T> |
aggregate(AggregationQuery<P,R,T> query)
Perform an aggregation on the data and just return the aggregated result.
|
<V extends StatisticValue<R>,R> |
aggregateStatistics(StatisticQuery<V,R> query)
Get a single statistical result that matches the given query criteria
|
void |
copyTo(DataStore other)
copy all data from this store into a specified other store
|
void |
copyTo(DataStore other,
Query<?> query)
copy the subset of data matching this query from this store into a specified other store
|
protected <T> Writer<T> |
createDataIndexWriter(InternalDataAdapter<T> adapter,
AdapterToIndexMapping indexMapping,
VisibilityHandler visibilityHandler,
DataStoreOperations baseOperations,
DataStoreOptions baseOptions,
IngestCallback<T> callback,
Closeable closable) |
protected <T> Writer<T> |
createIndexWriter(InternalDataAdapter<T> adapter,
AdapterToIndexMapping indexMapping,
Index index,
VisibilityHandler visibilityHandler,
DataStoreOperations baseOperations,
DataStoreOptions baseOptions,
IngestCallback<T> callback,
Closeable closable) |
<T> Writer<T> |
createWriter(String typeName)
Returns an index writer to perform batched write operations for the given typename
|
<T> Writer<T> |
createWriter(String typeName,
VisibilityHandler visibilityHandler)
Returns an index writer to perform batched write operations for the given typename
|
<T> boolean |
delete(Query<T> query)
Delete all data in this data store that matches the query parameter.
|
<T> boolean |
delete(Query<T> query,
boolean deleteDuplicates) |
<T> boolean |
delete(Query<T> query,
ScanCallback<T,?> scanCallback) |
<T> boolean |
delete(Query<T> query,
ScanCallback<T,?> scanCallback,
boolean deleteDuplicates) |
void |
deleteAll()
Delete ALL data and ALL metadata for this datastore.
|
protected boolean |
deleteEverything() |
protected void |
deleteFromDataIndex(Map<Short,Set<ByteArray>> dataIdsToDelete,
String... authorizations) |
Short |
getAdapterId(String typeName) |
PersistentAdapterStore |
getAdapterStore() |
DataStoreOperations |
getBaseOperations() |
<V extends StatisticValue<R>,R> |
getBinnedStatisticValues(Statistic<V> stat,
BinConstraints binConstraints)
The statistic values of this stat as well as the associated bin.
|
<V extends StatisticValue<R>,R> |
getDataTypeStatistic(StatisticType<V> statisticType,
String typeName,
String tag)
Gets the statistic that is being tracked for the data type, statistic type, and tag specified.
|
DataTypeStatistic<?>[] |
getDataTypeStatistics(String typeName)
Gets all of the statistics that are being tracked on the provided data type adapter.
|
<V extends StatisticValue<R>,R> |
getFieldStatistic(StatisticType<V> statisticType,
String typeName,
String fieldName,
String tag)
Gets the statistic that is being tracked for the data type, field, statistic type, and tag
specified.
|
FieldStatistic<?>[] |
getFieldStatistics(String typeName,
String fieldName)
Gets all of the statistics that are being tracked on the provided type/field pair.
|
Index |
getIndex(String indexName)
Get a particular index by its index name.
|
AdapterIndexMappingStore |
getIndexMappingStore() |
<V extends StatisticValue<R>,R> |
getIndexStatistic(StatisticType<V> statisticType,
String indexName,
String tag)
Gets the statistic that is being tracked for the index, statistic type, and tag specified.
|
IndexStatistic<?>[] |
getIndexStatistics(String indexName)
Gets all of the statistics that are being tracked on the provided index.
|
IndexStore |
getIndexStore() |
Index[] |
getIndices()
Get the indices that have been used within this data store.
|
Index[] |
getIndices(String typeName)
Get the indices that have been used within this data store for a particular type.
|
InternalAdapterStore |
getInternalAdapterStore() |
DataStatisticsStore |
getStatisticsStore() |
<V extends StatisticValue<R>,R> |
getStatisticValue(Statistic<V> stat,
BinConstraints binConstraints)
The statistic value of this stat (if multiple bins match, it will automatically aggregate the
resulting values together).
|
DataTypeAdapter<?> |
getType(String typeName)
Get the data type adapter with the given type name from the data store.
|
DataTypeAdapter<?>[] |
getTypes()
Get all the adapters that have been used within this data store
|
<T> void |
ingest(String inputPath,
Index... index)
Ingest from path.
|
<T> void |
ingest(String inputPath,
IngestOptions<T> options,
Index... index)
Ingest from path with options.
|
protected <T> void |
initOnIndexWriterCreate(InternalDataAdapter<T> adapter,
Index index) |
protected <T> CloseableIterator<T> |
internalQuery(Query<T> query,
BaseDataStore.DeletionMode delete) |
protected <T> CloseableIterator<T> |
internalQuery(Query<T> query,
BaseDataStore.DeletionMode delete,
ScanCallback<T,?> scanCallback) |
protected <T> CloseableIterator<T> |
internalQuery(QueryConstraints constraints,
BaseQueryOptions queryOptions,
BaseDataStore.DeletionMode deleteMode) |
protected <V extends StatisticValue<R>,R> |
internalQueryStatistics(StatisticQuery<V,R> query) |
boolean |
isReverseIterationSupported() |
<T> CloseableIterator<T> |
query(Query<T> query)
Returns all data in this data store that matches the query parameter.
|
<T,R extends GeoWaveRow> |
query(Query<T> query,
ScanCallback<T,R> scanCallback) |
ResultSet |
query(String queryStr,
String... authorizations)
Perform a query using the GeoWave Query Language (GWQL).
|
protected CloseableIterator<Object> |
queryConstraints(List<Short> adapterIdsToQuery,
Index index,
QueryConstraints sanitizedQuery,
DedupeFilter filter,
BaseQueryOptions sanitizedQueryOptions,
PersistentAdapterStore tempAdapterStore,
AdapterIndexMappingStore mappingStore,
boolean delete) |
protected CloseableIterator<Object> |
queryInsertionId(InternalDataAdapter<?> adapter,
Index index,
InsertionIdQuery query,
DedupeFilter filter,
BaseQueryOptions sanitizedQueryOptions,
PersistentAdapterStore tempAdapterStore,
boolean delete) |
protected CloseableIterator<Object> |
queryRowPrefix(Index index,
byte[] partitionKey,
byte[] sortPrefix,
BaseQueryOptions sanitizedQueryOptions,
List<InternalDataAdapter<?>> adapters,
PersistentAdapterStore tempAdapterStore,
boolean delete) |
<V extends StatisticValue<R>,R> |
queryStatistics(StatisticQuery<V,R> query)
Get data statistics that match the given query criteria
|
void |
recalcStatistic(Statistic<?>... statistic)
Force a recomputation of the stats
|
void |
removeIndex(String indexName)
remove an index completely for all types.
|
void |
removeIndex(String typeName,
String indexName)
remove an index for the given type.
|
void |
removeStatistic(Statistic<?>... statistic)
Remove statistics from the data store.
|
void |
removeType(String typeName)
Remove all data and statistics associated with the given type.
|
void |
store(Index index) |
protected void |
store(InternalDataAdapter<?> adapter) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBinnedStatisticValues, getStatisticValue
protected final IndexStore indexStore
protected final PersistentAdapterStore adapterStore
protected final DataStatisticsStore statisticsStore
protected final AdapterIndexMappingStore indexMappingStore
protected final DataStoreOperations baseOperations
protected final DataStoreOptions baseOptions
protected final InternalAdapterStore internalAdapterStore
protected final PropertyStore propertyStore
public BaseDataStore(IndexStore indexStore, PersistentAdapterStore adapterStore, DataStatisticsStore statisticsStore, AdapterIndexMappingStore indexMappingStore, DataStoreOperations operations, DataStoreOptions options, InternalAdapterStore internalAdapterStore, PropertyStore propertyStore)
public void store(Index index)
protected void store(InternalDataAdapter<?> adapter)
public DataStatisticsStore getStatisticsStore()
public <T,R extends GeoWaveRow> CloseableIterator<T> query(Query<T> query, ScanCallback<T,R> scanCallback)
public <T> CloseableIterator<T> query(Query<T> query)
DataStore
query
in interface DataStore
query
- data constraints for the query and additional options for processing the querypublic ResultSet query(String queryStr, String... authorizations)
DataStore
protected <T> CloseableIterator<T> internalQuery(Query<T> query, BaseDataStore.DeletionMode delete)
protected <T> CloseableIterator<T> internalQuery(Query<T> query, BaseDataStore.DeletionMode delete, ScanCallback<T,?> scanCallback)
protected <T> CloseableIterator<T> internalQuery(QueryConstraints constraints, BaseQueryOptions queryOptions, BaseDataStore.DeletionMode deleteMode)
protected void deleteFromDataIndex(Map<Short,Set<ByteArray>> dataIdsToDelete, String... authorizations)
public <T> boolean delete(Query<T> query, ScanCallback<T,?> scanCallback, boolean deleteDuplicates)
public <T> boolean delete(Query<T> query)
DataStore
Statistics are updated as required.
public <T> boolean delete(Query<T> query, ScanCallback<T,?> scanCallback)
public <T> boolean delete(Query<T> query, boolean deleteDuplicates)
protected boolean deleteEverything()
protected CloseableIterator<Object> queryConstraints(List<Short> adapterIdsToQuery, Index index, QueryConstraints sanitizedQuery, DedupeFilter filter, BaseQueryOptions sanitizedQueryOptions, PersistentAdapterStore tempAdapterStore, AdapterIndexMappingStore mappingStore, boolean delete)
protected CloseableIterator<Object> queryRowPrefix(Index index, byte[] partitionKey, byte[] sortPrefix, BaseQueryOptions sanitizedQueryOptions, List<InternalDataAdapter<?>> adapters, PersistentAdapterStore tempAdapterStore, boolean delete)
protected CloseableIterator<Object> queryInsertionId(InternalDataAdapter<?> adapter, Index index, InsertionIdQuery query, DedupeFilter filter, BaseQueryOptions sanitizedQueryOptions, PersistentAdapterStore tempAdapterStore, boolean delete)
protected <T> Writer<T> createDataIndexWriter(InternalDataAdapter<T> adapter, AdapterToIndexMapping indexMapping, VisibilityHandler visibilityHandler, DataStoreOperations baseOperations, DataStoreOptions baseOptions, IngestCallback<T> callback, Closeable closable)
protected <T> Writer<T> createIndexWriter(InternalDataAdapter<T> adapter, AdapterToIndexMapping indexMapping, Index index, VisibilityHandler visibilityHandler, DataStoreOperations baseOperations, DataStoreOptions baseOptions, IngestCallback<T> callback, Closeable closable)
protected <T> void initOnIndexWriterCreate(InternalDataAdapter<T> adapter, Index index)
public DataTypeAdapter<?> getType(String typeName)
DataStore
public DataTypeAdapter<?>[] getTypes()
public void addIndex(Index index)
DataStore
public Index[] getIndices()
DataStore
getIndices
in interface DataStore
public Index getIndex(String indexName)
DataStore
public Index[] getIndices(String typeName)
DataStore
getIndices
in interface DataStore
public void addIndex(String typeName, Index... indices)
DataStore
public <T> void addType(DataTypeAdapter<T> dataTypeAdapter, Index... initialIndices)
DataStore
public <T> void addType(DataTypeAdapter<T> dataTypeAdapter, List<Statistic<?>> statistics, Index... initialIndices)
DataStore
addType
in interface DataStore
dataTypeAdapter
- the data type adapter for this type that is used to read and write
GeoWave entriesstatistics
- the initial set of statistics that will be used with this adapterinitialIndices
- the initial indexing for this type, in the future additional indices can
be addedpublic <T> void addType(DataTypeAdapter<T> dataTypeAdapter, VisibilityHandler visibilityHandler, List<Statistic<?>> statistics, Index... initialIndices)
DataStore
addType
in interface DataStore
dataTypeAdapter
- the data type adapter for this type that is used to read and write
GeoWave entriesvisibilityHandler
- the visibility handler for the adapter entriesstatistics
- the initial set of statistics that will be used with this adapterinitialIndices
- the initial indexing for this type, in the future additional indices can
be addedprotected <T> boolean addTypeInternal(DataTypeAdapter<T> dataTypeAdapter, VisibilityHandler visibilityHandler, Index... initialIndices)
public <T> Writer<T> createWriter(String typeName)
createWriter
in interface DataStore
typeName
- the typepublic <T> Writer<T> createWriter(String typeName, VisibilityHandler visibilityHandler)
createWriter
in interface DataStore
typeName
- the typevisibilityHandler
- the visibility handler for newly written entriespublic <T> void ingest(String inputPath, Index... index)
DataStore
public <T> void ingest(String inputPath, IngestOptions<T> options, Index... index)
DataStore
public <P extends Persistable,R,T> R aggregate(AggregationQuery<P,R,T> query)
DataStore
protected <V extends StatisticValue<R>,R> CloseableIterator<V> internalQueryStatistics(StatisticQuery<V,R> query)
public <V extends StatisticValue<R>,R> CloseableIterator<V> queryStatistics(StatisticQuery<V,R> query)
DataStore
queryStatistics
in interface DataStore
query
- the query criteria, use StatisticQueryBuilder or its extensions and if you're
interested in a particular common statistics type use StatisticsQueryBuilder.factory()public <V extends StatisticValue<R>,R> V aggregateStatistics(StatisticQuery<V,R> query)
DataStore
aggregateStatistics
in interface DataStore
query
- the query criteria, use StatisticQueryBuilder or its extensions and if you're
interested in a particular common statistics type use StatisticsQueryBuilder.factory()public void copyTo(DataStore other)
DataStore
public void copyTo(DataStore other, Query<?> query)
DataStore
public void removeIndex(String indexName)
DataStore
removeIndex
in interface DataStore
indexName
- the indexpublic void removeIndex(String typeName, String indexName) throws IllegalStateException
DataStore
removeIndex
in interface DataStore
typeName
- the typeindexName
- the indexIllegalStateException
- if this is the last index for a type, remove the type firstpublic void removeType(String typeName)
DataStore
removeType
in interface DataStore
typeName
- the typepublic void deleteAll()
DataStore
public IndexStore getIndexStore()
public PersistentAdapterStore getAdapterStore()
public AdapterIndexMappingStore getIndexMappingStore()
public DataStoreOperations getBaseOperations()
public InternalAdapterStore getInternalAdapterStore()
public boolean isReverseIterationSupported()
public void removeStatistic(Statistic<?>... statistic)
DataStore
removeStatistic
in interface DataStore
statistic
- the statistics to removepublic void addEmptyStatistic(Statistic<?>... statistic)
DataStore
addStatistic
instead.addEmptyStatistic
in interface DataStore
public void addStatistic(Statistic<?>... statistic)
DataStore
addEmptyStatistic
instead.addStatistic
in interface DataStore
public void recalcStatistic(Statistic<?>... statistic)
DataStore
recalcStatistic
in interface DataStore
statistic
- the statistics to recomputepublic DataTypeStatistic<?>[] getDataTypeStatistics(String typeName)
DataStore
getDataTypeStatistics
in interface DataStore
typeName
- the data type adapter to get the statistics forpublic <V extends StatisticValue<R>,R> DataTypeStatistic<V> getDataTypeStatistic(StatisticType<V> statisticType, String typeName, String tag)
DataStore
getDataTypeStatistic
in interface DataStore
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstatisticType
- the statistic type for the statistic to gettypeName
- the data type name to get the statistic fortag
- the tag of the statistic, if not specified, a tag will be inferredpublic IndexStatistic<?>[] getIndexStatistics(String indexName)
DataStore
getIndexStatistics
in interface DataStore
indexName
- the index name to retrieve statistics forpublic <V extends StatisticValue<R>,R> IndexStatistic<V> getIndexStatistic(StatisticType<V> statisticType, String indexName, String tag)
DataStore
getIndexStatistic
in interface DataStore
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstatisticType
- the statistic type for the statistic to gettag
- the tag of the statistic, if not specified, a tag will be inferredpublic FieldStatistic<?>[] getFieldStatistics(String typeName, String fieldName)
DataStore
getFieldStatistics
in interface DataStore
typeName
- the data type name to get the statistics forfieldName
- the field name to get the statistics forpublic <V extends StatisticValue<R>,R> FieldStatistic<V> getFieldStatistic(StatisticType<V> statisticType, String typeName, String fieldName, String tag)
DataStore
getFieldStatistic
in interface DataStore
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstatisticType
- the statistic type for the statistic to gettypeName
- the data type name to get the statistic fortag
- the tag of the statistic, if not specified, a tag will be inferredpublic <V extends StatisticValue<R>,R> R getStatisticValue(Statistic<V> stat, BinConstraints binConstraints)
DataStore
getStatisticValue
in interface DataStore
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstat
- the statistic to get the value forbinConstraints
- the bin(s) to get the value for based on the constraintspublic <V extends StatisticValue<R>,R> CloseableIterator<org.apache.commons.lang3.tuple.Pair<ByteArray,R>> getBinnedStatisticValues(Statistic<V> stat, BinConstraints binConstraints)
DataStore
getBinnedStatisticValues
in interface DataStore
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstat
- the statistic to get the value forbinConstraints
- the bin(s) to get the value for based on the constraintsCopyright © 2013–2022. All rights reserved.