git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics@131198 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0dbccf3db8
commit
23b4ffe784
4
.project
4
.project
|
@ -16,12 +16,12 @@
|
|||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="accounting-analytics">
|
||||
<wb-resource deploy-path="/" source-path="/src/main/java"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<installed facet="java" version="1.7"/>
|
||||
<installed facet="jst.utility" version="1.0"/>
|
||||
</faceted-project>
|
|
@ -0,0 +1,2 @@
|
|||
disabled=06target
|
||||
eclipse.preferences.version=1
|
3
pom.xml
3
pom.xml
|
@ -9,7 +9,7 @@
|
|||
|
||||
<groupId>org.gcube.accounting</groupId>
|
||||
<artifactId>accounting-analytics</artifactId>
|
||||
<version>2.1.0-SNAPSHOT</version>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<name>accounting-analytics</name>
|
||||
|
||||
<properties>
|
||||
|
@ -78,6 +78,7 @@
|
|||
<version>1.0.13</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
@ -74,9 +74,6 @@ public class NumberedFilter extends Filter {
|
|||
|
||||
public int compareTo(NumberedFilter numberedFilter) {
|
||||
int compareResult = this.d.compareTo(numberedFilter.d);
|
||||
if(compareResult==0){
|
||||
super.compareTo(numberedFilter);
|
||||
}
|
||||
return compareResult;
|
||||
}
|
||||
|
||||
|
|
|
@ -162,11 +162,11 @@ public class TemporalConstraint {
|
|||
int calendarValue = calendarValues[aggregationMode.ordinal()].getCalendarValue();
|
||||
|
||||
Calendar alignedStartTime = getAlignedStartTime();
|
||||
logger.trace("Aligned StartTime : {}", timeInMillisToString(alignedStartTime.getTimeInMillis()));
|
||||
//logger.trace("Aligned StartTime : {}", timeInMillisToString(alignedStartTime.getTimeInMillis()));
|
||||
|
||||
Calendar alignedEndTime = getAlignedEndTime();
|
||||
long alignedEndTimeInMillis = alignedEndTime.getTimeInMillis();
|
||||
logger.trace("Aligned EndTime : {}", timeInMillisToString(alignedEndTime.getTimeInMillis()));
|
||||
//logger.trace("Aligned EndTime : {}", timeInMillisToString(alignedEndTime.getTimeInMillis()));
|
||||
|
||||
Calendar progressTime = Calendar.getInstance();
|
||||
progressTime.setTimeZone(DEFAULT_TIME_ZONE);
|
||||
|
|
|
@ -41,6 +41,7 @@ public abstract class AccountingPersistenceBackendQueryFactory {
|
|||
}
|
||||
|
||||
AccountingPersistenceBackendQuery accountingPersistenceQuery = accountingPersistenceQueries.get(scope);
|
||||
logger.debug("Scope {}", scope);
|
||||
if(accountingPersistenceQuery==null){
|
||||
|
||||
try {
|
||||
|
@ -49,24 +50,26 @@ public abstract class AccountingPersistenceBackendQueryFactory {
|
|||
Class<? extends AccountingPersistenceBackendQuery> foundClass=null;
|
||||
try {
|
||||
foundClass = found.getClass();
|
||||
logger.debug("Testing foundClass{}", foundClass.toString());
|
||||
String foundClassName = foundClass.getSimpleName();
|
||||
logger.debug("Testing {}", foundClassName);
|
||||
logger.debug("Testing foundClassName{}", foundClassName);
|
||||
AccountingPersistenceBackendQueryConfiguration configuration = new AccountingPersistenceBackendQueryConfiguration(foundClass);
|
||||
found.prepareConnection(configuration);
|
||||
accountingPersistenceQuery = found;
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
logger.error(String.format("%s not initialized correctly. It will not be used", foundClass.getSimpleName()));
|
||||
|
||||
logger.error(String.format("%s not initialized correctly. It will not be used", foundClass.getSimpleName()),e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch(Exception e){
|
||||
logger.error(String.format("service loader or not initialized correctly."));
|
||||
e.printStackTrace();
|
||||
throw new NoUsableAccountingPersistenceQueryFound(e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
if(accountingPersistenceQuery==null){
|
||||
logger.error(String.format("accountingPersistenceQuery null"));
|
||||
logger.error(String.format("accountingPersistenceQuery null"));
|
||||
throw new NoUsableAccountingPersistenceQueryFound();
|
||||
}
|
||||
|
||||
|
|
|
@ -168,10 +168,6 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
|||
String topKey, String orderingProperty, boolean pad, int limit)
|
||||
throws DuplicatedKeyFilterException, KeyException, ValueException,
|
||||
Exception {
|
||||
|
||||
|
||||
|
||||
|
||||
SortedMap<NumberedFilter, SortedMap<Calendar, Info>> got;
|
||||
|
||||
if(orderingProperty==null){
|
||||
|
@ -182,15 +178,13 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
|||
.getTopValues(clz, temporalConstraint, filters, topKey,
|
||||
orderingProperty);
|
||||
|
||||
|
||||
int count = got.size() > limit ? limit : got.size();
|
||||
|
||||
NumberedFilter firstRemovalKey = null;
|
||||
|
||||
for(NumberedFilter nf : got.keySet()){
|
||||
if(--count>=0 || limit<=0){
|
||||
if(pad){
|
||||
padMap(got.get(nf), temporalConstraint);
|
||||
padMap(got.get(nf), temporalConstraint);
|
||||
|
||||
}
|
||||
}else{
|
||||
if(firstRemovalKey==null){
|
||||
|
@ -200,11 +194,9 @@ public class AccountingPersistenceQuery implements AccountingPersistenceBackendQ
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(firstRemovalKey!=null){
|
||||
return got.subMap(got.firstKey(), firstRemovalKey);
|
||||
}
|
||||
|
||||
return got;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</appender>
|
||||
|
||||
|
||||
<logger name="org.gcube" level="TRACE" />
|
||||
<logger name="org.gcube" level="DEBUG" />
|
||||
|
||||
<root level="WARN">
|
||||
<appender-ref ref="STDOUT" />
|
Loading…
Reference in New Issue