public interface AccountingPersistenceBackendQuery
| Modifier and Type | Field and Description |
|---|---|
static int |
KEY_VALUES_LIMIT |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection to persistence
|
SortedMap<Filter,SortedMap<Calendar,Info>> |
getContextTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
List<String> contexts)
Return a SortedMap containing the TimeSeries for each context.
|
SortedSet<NumberedFilter> |
getFilterValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String key)
Return a sortedSet filter value
|
SortedSet<NumberedFilter> |
getNextPossibleValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String key,
String orderingProperty) |
SortedSet<NumberedFilter> |
getNextPossibleValuesWithMap(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String key,
String orderingProperty)
Same method but use if possible a map-reduce
|
SortedMap<Calendar,Info> |
getNoContextTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters)
Query the persistence obtaining a Map where the date is the key and the
#Info is the value.
|
SortedMap<Calendar,Info> |
getTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters)
Query the persistence obtaining a Map where the date is the key and the
#Info is the value.
|
SortedMap<NumberedFilter,SortedMap<Calendar,Info>> |
getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
List<Filter> filters,
String topKey,
String orderingProperty)
Return a SortedMap containing the TimeSeries for top values for a certain
key taking in account all Filters.
|
org.json.JSONObject |
getUsageValue(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz,
TemporalConstraint temporalConstraint,
Filter applicant)
Return a JsonObject with value
e.g.for StorageUsageRecord {"dataVolume":1860328,"operationCount":4115}
e.g.
|
List<UsageValue> |
getUsageValueQuotaTotal(List<UsageValue> listUsage)
getUsageValueQuotaTotal
Example for crequire 2 different quota (lucio.lelii for service and alessandro.pieve for storage)
Input:
[
TotalFilters [
clz=class org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord,
temporalConstraint=StartTime : 2015-05-01 11:42:34:515 UTC (1430480554515 millis), EndTime : 2016-11-09 11:42:34:515 UTC (1478691754515 millis),
Aggregated DAILY,
totalFilters=[
Filters [filters=[
{ "consumerId" : "lucio.lelii" },
{ "serviceClass" : "DataAccess" },
{ "serviceName" : "CkanConnector" }
], d=null, orderingProperty=null],
Filters [filters=[
{ "consumerId" : "lucio.lelii" },
{ "serviceClass" : "VREManagement" }
], d=null, orderingProperty=null]
], d=null, orderingProperty=null]
]
Output:
[
TotalFilters [
clz=class org.gcube.accounting.datamodel.aggregation.AggregatedServiceUsageRecord,
temporalConstraint=StartTime : 2015-05-01 11:42:34:515 UTC (1430480554515 millis), EndTime : 2016-11-09 11:42:34:515 UTC (1478691754515 millis),
Aggregated DAILY,
totalFilters=[
Filters [filters=[
{ "consumerId" : "lucio.lelii" },
{ "serviceClass" : "DataAccess" },
{ "serviceName" : "CkanConnector" }
], d=1.0, orderingProperty=operationCount],
Filters [filters=[
{ "consumerId" : "lucio.lelii" },
{ "serviceClass" : "VREManagement" }
], d=1.0, orderingProperty=operationCount]
], d=2.0, orderingProperty=null]
]
|
void |
prepareConnection(AccountingPersistenceBackendQueryConfiguration configuration) |
static final int KEY_VALUES_LIMIT
void prepareConnection(AccountingPersistenceBackendQueryConfiguration configuration) throws Exception
ExceptionSortedMap<Calendar,Info> getTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
clz - the Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)filters - list of filter to obtain the time series. If null or empty
list get all data for the interested Record Class with the
applying temporal constraint. All Filter must have not null
and not empty key and value. The filters are must be related
to different keys and are in AND. If the list contains more
than one filter with the same key an Exception is thrown.DuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionSortedMap<Calendar,Info> getNoContextTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
clz - the Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)filters - list of filter to obtain the time series. If null or empty
list get all data for the interested Record Class with the
applying temporal constraint. All Filter must have not null
and not empty key and value. The filters are must be related
to different keys and are in AND. If the list contains more
than one filter with the same key an Exception is thrown.DuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionSortedMap<NumberedFilter,SortedMap<Calendar,Info>> getTopValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String topKey, String orderingProperty) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
clz - the Usage Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)filters - list of filter to obtain the time series of top values. If
null or empty list get all data for the interested Record
Class with the applying temporal constraint. All Filter must
have not null and not empty key and value. The filters are
must be related to different keys and are in AND. If the list
contains more than one filter with the same key an Exception
is thrown.topKey - orderingProperty - DuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionSortedSet<NumberedFilter> getNextPossibleValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String key, String orderingProperty) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception
clz - temporalConstraint - filters - key - orderingProperty - DuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionSortedSet<NumberedFilter> getNextPossibleValuesWithMap(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String key, String orderingProperty) throws Exception
clz - temporalConstraint - filters - key - orderingProperty - Exceptionvoid close()
throws Exception
Exception - if the close failsSortedSet<NumberedFilter> getFilterValues(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, String key) throws Exception
clz - temporalConstraint - filters - key - orderingProperty - DuplicatedKeyFilterExceptionKeyExceptionValueExceptionExceptionorg.json.JSONObject getUsageValue(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, Filter applicant) throws Exception
clz - the Usage Record Class of interesttemporalConstraint - the TemporalConstraint (interval and aggregation)applicant - the type field and valueExceptionList<UsageValue> getUsageValueQuotaTotal(List<UsageValue> listUsage) throws Exception
listUsage - ExceptionSortedMap<Filter,SortedMap<Calendar,Info>> getContextTimeSeries(Class<? extends org.gcube.documentstore.records.AggregatedRecord<?,?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters, List<String> contexts) throws Exception
clz - temporalConstraint - filters - contexts - ExceptionCopyright © 2017. All Rights Reserved.