This commit is contained in:
Alessandro Pieve 2016-09-08 08:46:05 +00:00
parent 0dbccf3db8
commit 23b4ffe784
10 changed files with 29 additions and 23 deletions

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

View File

@ -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>

View File

@ -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;
}

View File

@ -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);

View File

@ -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();
}

View File

@ -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;
}

View File

@ -7,7 +7,7 @@
</appender>
<logger name="org.gcube" level="TRACE" />
<logger name="org.gcube" level="DEBUG" />
<root level="WARN">
<appender-ref ref="STDOUT" />