public interface DataStore
Here is a simple snippet of pseudocode showing how a data store can be used to store and retrieve your data.
DataStore store = DataStoreFactory.createDataStore(<data store options>);
store.addType(<my data type>, <my index>);
try(Writer writer = store.createWriter()){
//write data
writer.writer(<data);
}
//this just queries everything
try(CloseableIterator it = store.query(QueryBuilder.newBuilder().build())){
while(it.hasNext()){
//retrieve results matching query criteria and do something
it.next();
}
}
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.
|
<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
|
<T> Writer<T> |
createWriter(String typeName)
Returns an index writer to perform batched write operations for the given data type name.
|
<T> Writer<T> |
createWriter(String typeName,
VisibilityHandler visibilityHandler)
Returns an index writer to perform batched write operations for the given data type name.
|
<T> boolean |
delete(Query<T> query)
Delete all data in this data store that matches the query parameter.
|
void |
deleteAll()
Delete ALL data and ALL metadata for this datastore.
|
default <V extends StatisticValue<R>,R> |
getBinnedStatisticValues(Statistic<V> stat)
Returns all of the statistic values of this stat as well as the associated bin.
|
<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.
|
<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.
|
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.
|
default <V extends StatisticValue<R>,R> |
getStatisticValue(Statistic<V> stat)
The statistic value of this stat (if multiple bins match, it will automatically aggregate the
resulting values together).
|
<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 data type 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.
|
<T> CloseableIterator<T> |
query(Query<T> query)
Returns all data in this data store that matches the query parameter.
|
ResultSet |
query(String queryStr,
String... authorizations)
Perform a query using the GeoWave Query Language (GWQL).
|
<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.
|
<T> void ingest(String inputPath, Index... index)
inputPath
- The path for data to read and ingest into this data storeindex
- The indexing approach to use.<T> void ingest(String inputPath, IngestOptions<T> options, Index... index)
inputPath
- The path for data to read and ingest into this data storeoptions
- a set of available options for ingesting from a URLindex
- The configuration information for the primary index to use.<T> CloseableIterator<T> query(Query<T> query)
query
- data constraints for the query and additional options for processing the queryResultSet query(String queryStr, String... authorizations)
queryStr
- the GWQL query to performauthorizations
- the authorizations to use for the query<P extends Persistable,R,T> R aggregate(AggregationQuery<P,R,T> query)
query
- the Aggregation Query, use AggregationQueryBuilder or its extensions to createDataTypeAdapter<?> getType(String typeName)
typeName
- the name of the type to getnull
if it couldn't be foundDataTypeAdapter<?>[] getTypes()
void addEmptyStatistic(Statistic<?>... statistic)
addStatistic
instead.statistics
- the statistics to addvoid addStatistic(Statistic<?>... statistic)
addEmptyStatistic
instead.statistics
- the statistics to addvoid removeStatistic(Statistic<?>... statistic)
statistic
- the statistics to removevoid recalcStatistic(Statistic<?>... statistic)
statistic
- the statistics to recomputeDataTypeStatistic<?>[] getDataTypeStatistics(String typeName)
typeName
- the data type adapter to get the statistics for<V extends StatisticValue<R>,R> DataTypeStatistic<V> getDataTypeStatistic(StatisticType<V> statisticType, String typeName, @Nullable String tag)
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 inferredIndexStatistic<?>[] getIndexStatistics(String indexName)
indexName
- the index name to retrieve statistics for<V extends StatisticValue<R>,R> IndexStatistic<V> getIndexStatistic(StatisticType<V> statisticType, String indexName, @Nullable String tag)
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstatisticType
- the statistic type for the statistic to getindexName
- tag
- the tag of the statistic, if not specified, a tag will be inferredFieldStatistic<?>[] getFieldStatistics(String typeName, String fieldName)
typeName
- the data type name to get the statistics forfieldName
- the field name to get the statistics for<V extends StatisticValue<R>,R> FieldStatistic<V> getFieldStatistic(StatisticType<V> statisticType, String typeName, String fieldName, @Nullable String tag)
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 forfieldName
- tag
- the tag of the statistic, if not specified, a tag will be inferreddefault <V extends StatisticValue<R>,R> R getStatisticValue(Statistic<V> stat)
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstat
- the statistic to get the value for<V extends StatisticValue<R>,R> R getStatisticValue(Statistic<V> stat, BinConstraints binConstraints)
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 constraintsdefault <V extends StatisticValue<R>,R> CloseableIterator<org.apache.commons.lang3.tuple.Pair<ByteArray,R>> getBinnedStatisticValues(Statistic<V> stat)
V
- the StatisticValue implementation of the statisticR
- the raw value type of the statisticstat
- the statistic to get the value for<V extends StatisticValue<R>,R> CloseableIterator<org.apache.commons.lang3.tuple.Pair<ByteArray,R>> getBinnedStatisticValues(Statistic<V> stat, BinConstraints binConstraints)
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 constraints<V extends StatisticValue<R>,R> CloseableIterator<V> queryStatistics(StatisticQuery<V,R> query)
query
- the query criteria, use StatisticQueryBuilder or its extensions and if you're
interested in a particular common statistics type use StatisticsQueryBuilder.factory()<V extends StatisticValue<R>,R> V aggregateStatistics(StatisticQuery<V,R> query)
query
- the query criteria, use StatisticQueryBuilder or its extensions and if you're
interested in a particular common statistics type use StatisticsQueryBuilder.factory()void addIndex(Index index)
index
- the index to addIndex[] getIndices()
Index[] getIndices(String typeName)
the
- data type nameIndex getIndex(String indexName)
indexName
- the index name for which to retrieve an indexvoid copyTo(DataStore other)
other
- the other store to copy data intovoid copyTo(DataStore other, Query<?> query)
other
- the other store to copy data intoquery
- a query to select which data to copy - use QueryBuilder or its extension to createvoid addIndex(String typeName, Index... indices)
typeName
- the typeindices
- the new indices to addvoid removeIndex(String indexName) throws IllegalStateException
indexName
- the indexIllegalStateException
- if this is the last index for a type, remove the type firstvoid removeIndex(String typeName, String indexName) throws IllegalStateException
typeName
- the typeindexName
- the indexIllegalStateException
- if this is the last index for a type, remove the type firstvoid removeType(String typeName)
typeName
- the type<T> boolean delete(Query<T> query)
Statistics are updated as required.
query
- the query criteria to use for deletionvoid deleteAll()
<T> void addType(DataTypeAdapter<T> dataTypeAdapter, Index... initialIndices)
dataTypeAdapter
- the data type adapter for this type that is used to read and write
GeoWave entriesinitialIndices
- the initial indexing for this type, in the future additional indices can
be added<T> void addType(DataTypeAdapter<T> dataTypeAdapter, List<Statistic<?>> statistics, Index... initialIndices)
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 added<T> void addType(DataTypeAdapter<T> dataTypeAdapter, VisibilityHandler visibilityHandler, List<Statistic<?>> statistics, Index... initialIndices)
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 added<T> Writer<T> createWriter(String typeName)
typeName
- the type<T> Writer<T> createWriter(String typeName, VisibilityHandler visibilityHandler)
typeName
- the typevisibilityHandler
- the visibility handler for newly written entriesCopyright © 2013–2022. All rights reserved.