Add a new method getNextPossibleValuesWithMap
(calculate top with map) git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@141628 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ece86afce3
commit
2e637013b6
5
pom.xml
5
pom.xml
|
@ -9,7 +9,7 @@
|
|||
|
||||
<groupId>org.gcube.accounting</groupId>
|
||||
<artifactId>accounting-analytics</artifactId>
|
||||
<version>2.3.0-SNAPSHOT</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<name>accounting-analytics</name>
|
||||
|
||||
<properties>
|
||||
|
@ -26,9 +26,10 @@
|
|||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-smartgears-bom</artifactId>
|
||||
<artifactId>gcube-bom</artifactId>
|
||||
<version>LATEST</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
|
|
|
@ -31,6 +31,7 @@ public class TemporalConstraint {
|
|||
*/
|
||||
public enum AggregationMode {
|
||||
YEARLY, MONTHLY, DAILY, HOURLY, MINUTELY, SECONDLY, MILLISECONDLY
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -39,6 +40,7 @@ public class TemporalConstraint {
|
|||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public enum CalendarEnum {
|
||||
|
||||
YEAR(Calendar.YEAR),
|
||||
MONTH(Calendar.MONTH),
|
||||
DAY(Calendar.DAY_OF_MONTH),
|
||||
|
|
|
@ -9,15 +9,16 @@ import org.gcube.accounting.datamodel.AggregatedUsageRecord;
|
|||
*
|
||||
*/
|
||||
public abstract class UsageValue {
|
||||
|
||||
public UsageValue(){}
|
||||
|
||||
protected Class<? extends AggregatedUsageRecord<?, ?>> clz;
|
||||
protected TemporalConstraint temporalConstraint;
|
||||
//protected List<FiltersValue> filtersValue;
|
||||
protected String identifier;
|
||||
protected Double d;
|
||||
protected String orderingProperty;
|
||||
protected String context;
|
||||
|
||||
public UsageValue(){}
|
||||
public abstract Class<? extends AggregatedUsageRecord<?, ?>> getClz();
|
||||
public abstract String getIdentifier();
|
||||
public abstract Double getD();
|
||||
|
|
|
@ -116,6 +116,23 @@ public interface AccountingPersistenceBackendQuery {
|
|||
DuplicatedKeyFilterException, KeyException, ValueException,
|
||||
Exception;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Same method but use if possible a map-reduce
|
||||
* @param clz
|
||||
* @param temporalConstraint
|
||||
* @param filters
|
||||
* @param key
|
||||
* @param orderingProperty
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public SortedSet<NumberedFilter> getNextPossibleValuesWithMap(
|
||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
||||
String key, String orderingProperty) throws Exception;
|
||||
|
||||
/**
|
||||
* Close the connection to persistence
|
||||
*
|
||||
|
@ -252,4 +269,6 @@ public interface AccountingPersistenceBackendQuery {
|
|||
TemporalConstraint temporalConstraint, List<Filter> filters,List<String> contexts)
|
||||
throws Exception;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -247,6 +247,17 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
|||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SortedSet<NumberedFilter> getNextPossibleValuesWithMap(
|
||||
Class<? extends AggregatedRecord<?, ?>> clz,
|
||||
TemporalConstraint temporalConstraint, List<Filter> filters,
|
||||
String key, String orderingProperty) throws Exception {
|
||||
return AccountingPersistenceBackendQueryFactory.getInstance()
|
||||
.getNextPossibleValuesWithMap(clz, temporalConstraint, filters,
|
||||
key, orderingProperty);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
@ -340,4 +351,6 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue