reformatted code
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@154378 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
390136c155
commit
7c45a1d29a
|
@ -51,42 +51,35 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static SortedSet<String> getQuerableKeys(
|
public static SortedSet<String> getQuerableKeys(@SuppressWarnings("rawtypes") AggregatedRecord instance)
|
||||||
@SuppressWarnings("rawtypes") AggregatedRecord instance)
|
|
||||||
throws Exception {
|
throws Exception {
|
||||||
return instance.getQuerableKeys();
|
return instance.getQuerableKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SortedSet<String> getQuerableKeys(
|
public static SortedSet<String> getQuerableKeys(Class<? extends AggregatedRecord<?, ?>> clz) throws Exception {
|
||||||
Class<? extends AggregatedRecord<?,?>> clz)
|
|
||||||
throws Exception {
|
|
||||||
AggregatedRecord<?, ?> instance = clz.newInstance();
|
AggregatedRecord<?, ?> instance = clz.newInstance();
|
||||||
|
|
||||||
//limit filter key for accounting storage status (used from portlet accounting for tad space)
|
// limit filter key for accounting storage status (used from portlet
|
||||||
|
// accounting for tad space)
|
||||||
if (clz.equals(AggregatedStorageStatusRecord.class)) {
|
if (clz.equals(AggregatedStorageStatusRecord.class)) {
|
||||||
SortedSet<String> storageStatus = new TreeSet<>();
|
SortedSet<String> storageStatus = new TreeSet<>();
|
||||||
storageStatus.add(AggregatedStorageStatusRecord.CONSUMER_ID);
|
storageStatus.add(AggregatedStorageStatusRecord.CONSUMER_ID);
|
||||||
storageStatus.add(AggregatedStorageStatusRecord.DATA_SERVICEID);
|
storageStatus.add(AggregatedStorageStatusRecord.DATA_SERVICEID);
|
||||||
return storageStatus;
|
return storageStatus;
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
return instance.getQuerableKeys();
|
return instance.getQuerableKeys();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getDefaultOrderingProperties(
|
public static String getDefaultOrderingProperties(Class<? extends AggregatedRecord<?, ?>> clz) {
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz){
|
|
||||||
if (clz.isAssignableFrom(AggregatedStorageUsageRecord.class)) {
|
if (clz.isAssignableFrom(AggregatedStorageUsageRecord.class)) {
|
||||||
return AggregatedStorageUsageRecord.DATA_VOLUME;
|
return AggregatedStorageUsageRecord.DATA_VOLUME;
|
||||||
}
|
}
|
||||||
return AggregatedRecord.OPERATION_COUNT;
|
return AggregatedRecord.OPERATION_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static JSONObject getPaddingJSONObject(
|
protected static JSONObject getPaddingJSONObject(Map<Calendar, Info> unpaddedResults) throws JSONException {
|
||||||
Map<Calendar, Info> unpaddedResults) throws JSONException {
|
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
// verify data consistency
|
// verify data consistency
|
||||||
|
@ -115,8 +108,7 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* if fails
|
* if fails
|
||||||
*/
|
*/
|
||||||
public static SortedMap<Calendar, Info> padMap(
|
public static SortedMap<Calendar, Info> padMap(SortedMap<Calendar, Info> unpaddedData,
|
||||||
SortedMap<Calendar, Info> unpaddedData,
|
|
||||||
TemporalConstraint temporalConstraint) throws Exception {
|
TemporalConstraint temporalConstraint) throws Exception {
|
||||||
|
|
||||||
JSONObject jsonObject = getPaddingJSONObject(unpaddedData);
|
JSONObject jsonObject = getPaddingJSONObject(unpaddedData);
|
||||||
|
@ -134,30 +126,23 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public SortedMap<Calendar, Info> getTimeSeries(
|
public SortedMap<Calendar, Info> getTimeSeries(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?,?>> clz,
|
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters)
|
TemporalConstraint temporalConstraint, List<Filter> filters)
|
||||||
throws DuplicatedKeyFilterException, KeyException, ValueException,
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
Exception {
|
|
||||||
|
|
||||||
return this.getTimeSeries(clz, temporalConstraint, filters, false);
|
return this.getTimeSeries(clz, temporalConstraint, filters, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedMap<Calendar, Info> getTimeSeries(
|
public SortedMap<Calendar, Info> getTimeSeries(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?,?>> clz,
|
TemporalConstraint temporalConstraint, List<Filter> filters, boolean pad)
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
boolean pad) throws DuplicatedKeyFilterException, KeyException,
|
SortedMap<Calendar, Info> ret = AccountingPersistenceBackendQueryFactory.getInstance().getTimeSeries(clz,
|
||||||
ValueException, Exception {
|
temporalConstraint, filters);
|
||||||
SortedMap<Calendar, Info> ret =
|
|
||||||
AccountingPersistenceBackendQueryFactory.getInstance()
|
|
||||||
.getTimeSeries(clz, temporalConstraint,
|
|
||||||
filters);
|
|
||||||
|
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
ret = new TreeMap<>();
|
ret = new TreeMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pad) {
|
if (pad) {
|
||||||
ret = padMap(ret, temporalConstraint);
|
ret = padMap(ret, temporalConstraint);
|
||||||
}
|
}
|
||||||
|
@ -165,32 +150,23 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SortedMap<Calendar, Info> getNoContextTimeSeries(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
|
|
||||||
public SortedMap<Calendar, Info> getNoContextTimeSeries(
|
|
||||||
Class<? extends AggregatedRecord<?,?>> clz,
|
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters)
|
TemporalConstraint temporalConstraint, List<Filter> filters)
|
||||||
throws DuplicatedKeyFilterException, KeyException, ValueException,
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
Exception {
|
|
||||||
|
|
||||||
return this.getNoContextTimeSeries(clz, temporalConstraint, filters, false);
|
return this.getNoContextTimeSeries(clz, temporalConstraint, filters, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedMap<Calendar, Info> getNoContextTimeSeries(
|
public SortedMap<Calendar, Info> getNoContextTimeSeries(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?,?>> clz,
|
TemporalConstraint temporalConstraint, List<Filter> filters, boolean pad)
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
boolean pad) throws DuplicatedKeyFilterException, KeyException,
|
SortedMap<Calendar, Info> ret = AccountingPersistenceBackendQueryFactory.getInstance()
|
||||||
ValueException, Exception {
|
.getNoContextTimeSeries(clz, temporalConstraint, filters);
|
||||||
SortedMap<Calendar, Info> ret =
|
|
||||||
AccountingPersistenceBackendQueryFactory.getInstance()
|
|
||||||
.getNoContextTimeSeries(clz, temporalConstraint,
|
|
||||||
filters);
|
|
||||||
|
|
||||||
if (ret == null) {
|
if (ret == null) {
|
||||||
ret = new TreeMap<>();
|
ret = new TreeMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pad) {
|
if (pad) {
|
||||||
ret = padMap(ret, temporalConstraint);
|
ret = padMap(ret, temporalConstraint);
|
||||||
}
|
}
|
||||||
|
@ -198,24 +174,18 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SortedMap<NumberedFilter, SortedMap<Calendar, Info>> getTopValues(
|
public SortedMap<NumberedFilter, SortedMap<Calendar, Info>> getTopValues(
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
Class<? extends AggregatedRecord<?, ?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters,
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
|
||||||
String topKey, String orderingProperty, boolean pad, int limit)
|
String topKey, String orderingProperty, boolean pad, int limit)
|
||||||
throws DuplicatedKeyFilterException, KeyException, ValueException,
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
Exception {
|
|
||||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> got;
|
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> got;
|
||||||
|
|
||||||
if (orderingProperty == null) {
|
if (orderingProperty == null) {
|
||||||
orderingProperty = getDefaultOrderingProperties(clz);
|
orderingProperty = getDefaultOrderingProperties(clz);
|
||||||
}
|
}
|
||||||
|
|
||||||
got = AccountingPersistenceBackendQueryFactory.getInstance()
|
got = AccountingPersistenceBackendQueryFactory.getInstance().getTopValues(clz, temporalConstraint, filters,
|
||||||
.getTopValues(clz, temporalConstraint, filters, topKey,
|
topKey, orderingProperty);
|
||||||
orderingProperty);
|
|
||||||
|
|
||||||
int count = got.size() > limit ? limit : got.size();
|
int count = got.size() > limit ? limit : got.size();
|
||||||
NumberedFilter firstRemovalKey = null;
|
NumberedFilter firstRemovalKey = null;
|
||||||
|
@ -240,18 +210,11 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedMap<NumberedFilter, SortedMap<Calendar, Info>> getTopValues(
|
public SortedMap<NumberedFilter, SortedMap<Calendar, Info>> getTopValues(
|
||||||
Class<? extends AggregatedRecord<?,?>> clz,
|
Class<? extends AggregatedRecord<?, ?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters,
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
String topKey) throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
String topKey) throws DuplicatedKeyFilterException,
|
String orderingProperty = AccountingPersistenceQuery.getDefaultOrderingProperties(clz);
|
||||||
KeyException, ValueException, Exception {
|
|
||||||
String orderingProperty = AccountingPersistenceQuery
|
|
||||||
.getDefaultOrderingProperties(clz);
|
|
||||||
|
|
||||||
|
return this.getTopValues(clz, temporalConstraint, filters, topKey, orderingProperty, false, 0);
|
||||||
|
|
||||||
|
|
||||||
return this.getTopValues(clz, temporalConstraint, filters, topKey,
|
|
||||||
orderingProperty, false, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -259,54 +222,40 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SortedMap<NumberedFilter, SortedMap<Calendar, Info>> getTopValues(
|
public SortedMap<NumberedFilter, SortedMap<Calendar, Info>> getTopValues(
|
||||||
Class<? extends AggregatedRecord<?,?>> clz,
|
Class<? extends AggregatedRecord<?, ?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters,
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
String topKey, String orderingProperty)
|
||||||
String topKey, String orderingProperty) throws
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
DuplicatedKeyFilterException, KeyException, ValueException,
|
return this.getTopValues(clz, temporalConstraint, filters, topKey, orderingProperty, false, 0);
|
||||||
Exception {
|
|
||||||
return this.getTopValues(clz, temporalConstraint, filters, topKey,
|
|
||||||
orderingProperty, false, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SortedSet<NumberedFilter> getNextPossibleValues(
|
public SortedSet<NumberedFilter> getNextPossibleValues(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?,?>> clz,
|
TemporalConstraint temporalConstraint, List<Filter> filters, String key)
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
String key) throws DuplicatedKeyFilterException, KeyException,
|
|
||||||
ValueException, Exception {
|
|
||||||
|
|
||||||
String orderingProperty = AccountingPersistenceQuery
|
String orderingProperty = AccountingPersistenceQuery.getDefaultOrderingProperties(clz);
|
||||||
.getDefaultOrderingProperties(clz);
|
|
||||||
|
|
||||||
return this.getNextPossibleValues(clz, temporalConstraint, filters,
|
return this.getNextPossibleValues(clz, temporalConstraint, filters, key, orderingProperty);
|
||||||
key, orderingProperty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public SortedSet<NumberedFilter> getNextPossibleValues(
|
public SortedSet<NumberedFilter> getNextPossibleValues(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
TemporalConstraint temporalConstraint, List<Filter> filters, String key, String orderingProperty)
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
throws DuplicatedKeyFilterException, KeyException, ValueException, Exception {
|
||||||
String key, String orderingProperty) throws
|
|
||||||
DuplicatedKeyFilterException, KeyException, ValueException,
|
|
||||||
Exception {
|
|
||||||
|
|
||||||
return AccountingPersistenceBackendQueryFactory.getInstance()
|
return AccountingPersistenceBackendQueryFactory.getInstance().getNextPossibleValues(clz, temporalConstraint,
|
||||||
.getNextPossibleValues(clz, temporalConstraint, filters,
|
filters, key, orderingProperty);
|
||||||
key, orderingProperty);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortedSet<NumberedFilter> getNextPossibleValuesWithMap(
|
public SortedSet<NumberedFilter> getNextPossibleValuesWithMap(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
TemporalConstraint temporalConstraint, List<Filter> filters, String key, String orderingProperty)
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
throws Exception {
|
||||||
String key, String orderingProperty) throws Exception {
|
return AccountingPersistenceBackendQueryFactory.getInstance().getNextPossibleValuesWithMap(clz,
|
||||||
return AccountingPersistenceBackendQueryFactory.getInstance()
|
temporalConstraint, filters, key, orderingProperty);
|
||||||
.getNextPossibleValuesWithMap(clz, temporalConstraint, filters,
|
|
||||||
key, orderingProperty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -321,63 +270,46 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void prepareConnection(
|
public void prepareConnection(AccountingPersistenceBackendQueryConfiguration configuration) throws Exception {
|
||||||
AccountingPersistenceBackendQueryConfiguration configuration)
|
|
||||||
throws Exception {
|
|
||||||
throw new InvalidActivityException();
|
throw new InvalidActivityException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortedSet<NumberedFilter> getFilterValues(
|
public SortedSet<NumberedFilter> getFilterValues(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
TemporalConstraint temporalConstraint, List<Filter> filters, String key) throws Exception {
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
|
||||||
String key) throws Exception {
|
|
||||||
|
|
||||||
return AccountingPersistenceBackendQueryFactory.getInstance()
|
return AccountingPersistenceBackendQueryFactory.getInstance().getFilterValues(clz, temporalConstraint, filters,
|
||||||
.getFilterValues(clz, temporalConstraint, filters,
|
|
||||||
key);
|
key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getUsageValue(Class<? extends AggregatedRecord<?, ?>> clz,
|
public JSONObject getUsageValue(Class<? extends AggregatedRecord<?, ?>> clz, TemporalConstraint temporalConstraint,
|
||||||
TemporalConstraint temporalConstraint, Filter applicant)
|
Filter applicant) throws Exception {
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
return AccountingPersistenceBackendQueryFactory.getInstance()
|
return AccountingPersistenceBackendQueryFactory.getInstance().getUsageValue(clz, temporalConstraint, applicant);
|
||||||
.getUsageValue(clz, temporalConstraint, applicant);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<UsageValue> getUsageValueQuotaTotal( List<UsageValue> listUsage)
|
public List<UsageValue> getUsageValueQuotaTotal(List<UsageValue> listUsage) throws Exception {
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
return AccountingPersistenceBackendQueryFactory.getInstance()
|
return AccountingPersistenceBackendQueryFactory.getInstance().getUsageValueQuotaTotal(listUsage);
|
||||||
.getUsageValueQuotaTotal(listUsage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortedMap<Filter, SortedMap<Calendar, Info>> getContextTimeSeries(
|
public SortedMap<Filter, SortedMap<Calendar, Info>> getContextTimeSeries(
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
Class<? extends AggregatedRecord<?, ?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters,
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,List<String> contexts)
|
List<String> contexts) throws Exception {
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
return AccountingPersistenceBackendQueryFactory.getInstance()
|
return AccountingPersistenceBackendQueryFactory.getInstance().getContextTimeSeries(clz, temporalConstraint,
|
||||||
.getContextTimeSeries(clz, temporalConstraint, filters, contexts);
|
filters, contexts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public SortedMap<Filter, SortedMap<Calendar, Info>> getContextTimeSeries(
|
public SortedMap<Filter, SortedMap<Calendar, Info>> getContextTimeSeries(
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
Class<? extends AggregatedRecord<?, ?>> clz, TemporalConstraint temporalConstraint, List<Filter> filters,
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
List<String> contexts, boolean pad) throws DuplicatedKeyFilterException, Exception {
|
||||||
List<String> contexts, boolean pad)
|
|
||||||
throws DuplicatedKeyFilterException,
|
|
||||||
Exception {
|
|
||||||
SortedMap<Filter, SortedMap<Calendar, Info>> got;
|
SortedMap<Filter, SortedMap<Calendar, Info>> got;
|
||||||
got = AccountingPersistenceBackendQueryFactory.getInstance()
|
got = AccountingPersistenceBackendQueryFactory.getInstance().getContextTimeSeries(clz, temporalConstraint,
|
||||||
.getContextTimeSeries(clz, temporalConstraint, filters, contexts);
|
filters, contexts);
|
||||||
int count = got.size();
|
int count = got.size();
|
||||||
Filter firstRemovalKey = null;
|
Filter firstRemovalKey = null;
|
||||||
for (Filter nf : got.keySet()) {
|
for (Filter nf : got.keySet()) {
|
||||||
|
@ -400,17 +332,12 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
return got;
|
return got;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getRecord(String recordId, String type) throws Exception {
|
public String getRecord(String recordId, String type) throws Exception {
|
||||||
String record = AccountingPersistenceBackendQueryFactory.getInstance().getRecord(recordId, type);
|
String record = AccountingPersistenceBackendQueryFactory.getInstance().getRecord(recordId, type);
|
||||||
return record;
|
return record;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortedSet<String> getSpaceProvidersIds() throws Exception {
|
public SortedSet<String> getSpaceProvidersIds() throws Exception {
|
||||||
SortedSet<String> providersId = AccountingPersistenceBackendQueryFactory.getInstance().getSpaceProvidersIds();
|
SortedSet<String> providersId = AccountingPersistenceBackendQueryFactory.getInstance().getSpaceProvidersIds();
|
||||||
|
@ -419,18 +346,11 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SortedMap<Filter, SortedMap<Calendar, Long>> getSpaceTimeSeries(
|
public SortedMap<Filter, SortedMap<Calendar, Long>> getSpaceTimeSeries(Class<? extends AggregatedRecord<?, ?>> clz,
|
||||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
TemporalConstraint temporalConstraint, List<Filter> filters, List<String> providersId) throws Exception {
|
||||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
|
||||||
List<String> providersId)
|
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
|
|
||||||
SortedMap<Filter, SortedMap<Calendar, Long>> spaceTimeSeries=
|
|
||||||
AccountingPersistenceBackendQueryFactory.getInstance().getSpaceTimeSeries(clz, temporalConstraint, filters, providersId);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
SortedMap<Filter, SortedMap<Calendar, Long>> spaceTimeSeries = AccountingPersistenceBackendQueryFactory
|
||||||
|
.getInstance().getSpaceTimeSeries(clz, temporalConstraint, filters, providersId);
|
||||||
|
|
||||||
int count = spaceTimeSeries.size();
|
int count = spaceTimeSeries.size();
|
||||||
Filter firstRemovalKey = null;
|
Filter firstRemovalKey = null;
|
||||||
|
@ -450,13 +370,9 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
}
|
}
|
||||||
return spaceTimeSeries;
|
return spaceTimeSeries;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SortedMap<Calendar, Long> padMapStorage(SortedMap<Calendar, Long> unpaddedData,
|
||||||
public SortedMap<Calendar, Long> padMapStorage(
|
|
||||||
SortedMap<Calendar, Long> unpaddedData,
|
|
||||||
TemporalConstraint temporalConstraint) throws Exception {
|
TemporalConstraint temporalConstraint) throws Exception {
|
||||||
SortedSet<Calendar> sequence = temporalConstraint.getCalendarSequence();
|
SortedSet<Calendar> sequence = temporalConstraint.getCalendarSequence();
|
||||||
Long longValuePre = null;
|
Long longValuePre = null;
|
||||||
|
@ -478,7 +394,4 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
||||||
return AccountingPersistenceBackendQueryFactory.getInstance().isConnectionActive();
|
return AccountingPersistenceBackendQueryFactory.getInstance().isConnectionActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue