clean log
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-analytics-persistence-couchbase@148348 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5039ef1b11
commit
09f90a327f
|
@ -1505,11 +1505,10 @@ AccountingPersistenceBackendQuery {
|
||||||
|
|
||||||
logger.debug("getUsageValueQuotaTotal init with list:{}",listUsage);
|
logger.debug("getUsageValueQuotaTotal init with list:{}",listUsage);
|
||||||
|
|
||||||
//String currentScope = ScopeProvider.instance.get();
|
|
||||||
String keyOrderingProperty = null;
|
String keyOrderingProperty = null;
|
||||||
for (UsageValue totalFilters:listUsage){
|
for (UsageValue totalFilters:listUsage){
|
||||||
|
|
||||||
logger.debug("-----------------/ init for totalFilters");
|
|
||||||
String currentScope = totalFilters.getContext();
|
String currentScope = totalFilters.getContext();
|
||||||
|
|
||||||
Collection<String> keys= new TreeSet<>();
|
Collection<String> keys= new TreeSet<>();
|
||||||
|
@ -1532,14 +1531,7 @@ AccountingPersistenceBackendQuery {
|
||||||
new TemporalConstraint(startTime.getTimeInMillis(),
|
new TemporalConstraint(startTime.getTimeInMillis(),
|
||||||
endTime.getTimeInMillis(), AggregationMode.DAILY);
|
endTime.getTimeInMillis(), AggregationMode.DAILY);
|
||||||
if (totalFilters instanceof UsageStorageValue){
|
if (totalFilters instanceof UsageStorageValue){
|
||||||
|
|
||||||
// if (totalFilters.getClz().getSimpleName().equals(AggregatedStorageStatusRecord.class.getSimpleName())){
|
|
||||||
//TODO sarebbe possibile invece con il nome verificare che getClz e' un istanza di AggregatedStorageStatusRecord?
|
|
||||||
//designDocId = "QuotaTotal";
|
|
||||||
|
|
||||||
//TEST
|
|
||||||
designDocId="QuotaTotalSeparated";
|
designDocId="QuotaTotalSeparated";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1558,12 +1550,9 @@ AccountingPersistenceBackendQuery {
|
||||||
aggregationMode, false, false);
|
aggregationMode, false, false);
|
||||||
|
|
||||||
Double totalQuota=0.00;
|
Double totalQuota=0.00;
|
||||||
//int i = 0;
|
|
||||||
//int countFilters=0;
|
|
||||||
|
|
||||||
if (totalFilters instanceof UsageServiceValue){
|
if (totalFilters instanceof UsageServiceValue){
|
||||||
UsageServiceValue totalFiltersService = (UsageServiceValue)totalFilters;
|
UsageServiceValue totalFiltersService = (UsageServiceValue)totalFilters;
|
||||||
//countFilters =totalFiltersService.getFiltersValue().size();
|
|
||||||
}
|
}
|
||||||
//do {
|
//do {
|
||||||
String viewNameTmp=null;
|
String viewNameTmp=null;
|
||||||
|
@ -1578,7 +1567,6 @@ AccountingPersistenceBackendQuery {
|
||||||
viewNameTmp=AggregatedServiceUsageRecord.CONSUMER_ID;
|
viewNameTmp=AggregatedServiceUsageRecord.CONSUMER_ID;
|
||||||
startKeyTmp.add(totalFilters.getIdentifier());
|
startKeyTmp.add(totalFilters.getIdentifier());
|
||||||
endKeyTmp.add(totalFilters.getIdentifier());
|
endKeyTmp.add(totalFilters.getIdentifier());
|
||||||
//FiltersValue singleFilter=null;
|
|
||||||
if (totalFilters instanceof UsageServiceValue){
|
if (totalFilters instanceof UsageServiceValue){
|
||||||
//logger.debug("******UsageServiceValue");
|
//logger.debug("******UsageServiceValue");
|
||||||
|
|
||||||
|
@ -1612,28 +1600,13 @@ AccountingPersistenceBackendQuery {
|
||||||
totalFilters.getClz().getSimpleName(),designDocId, viewNameTmp, groupLevelTmp, startKeyTmp, endKeyTmp,temporalStartKey.toString(), temporalEndKey.toString());
|
totalFilters.getClz().getSimpleName(),designDocId, viewNameTmp, groupLevelTmp, startKeyTmp, endKeyTmp,temporalStartKey.toString(), temporalEndKey.toString());
|
||||||
logger.trace("connectionMap:{}",connectionMap.toString());
|
logger.trace("connectionMap:{}",connectionMap.toString());
|
||||||
ViewQuery query = ViewQuery.from(designDocId, viewNameTmp);
|
ViewQuery query = ViewQuery.from(designDocId, viewNameTmp);
|
||||||
//if storage
|
|
||||||
query.inclusiveEnd();
|
query.inclusiveEnd();
|
||||||
/*
|
query.groupLevel(groupLevelTmp);
|
||||||
if (designDocId == "QuotaTotal"){
|
query.startKey(startKeyTmp);
|
||||||
|
query.endKey(endKeyTmp);
|
||||||
query.startKey(endKeyTmp);
|
query.descending(false);
|
||||||
query.endKey(startKeyTmp);
|
query.onError(OnError.STOP);
|
||||||
query.descending(true);
|
logger.trace("query row:{}",query.toString());
|
||||||
query.limit(1);
|
|
||||||
query.onError(OnError.STOP);
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
*/
|
|
||||||
query.groupLevel(groupLevelTmp);
|
|
||||||
query.startKey(startKeyTmp);
|
|
||||||
query.endKey(endKeyTmp);
|
|
||||||
query.descending(false);
|
|
||||||
query.onError(OnError.STOP);
|
|
||||||
//}
|
|
||||||
|
|
||||||
logger.trace("query row:{}",query.toString());
|
|
||||||
ViewResult viewResult;
|
ViewResult viewResult;
|
||||||
try {
|
try {
|
||||||
viewResult = connectionMap.get(totalFilters.getClz().getSimpleName()).query(query);
|
viewResult = connectionMap.get(totalFilters.getClz().getSimpleName()).query(query);
|
||||||
|
@ -1822,6 +1795,9 @@ AccountingPersistenceBackendQuery {
|
||||||
if (temporalConstraint.getAggregationMode().equals(AggregationMode.MONTHLY)){
|
if (temporalConstraint.getAggregationMode().equals(AggregationMode.MONTHLY)){
|
||||||
groupLevel= 4;
|
groupLevel= 4;
|
||||||
}
|
}
|
||||||
|
if (temporalConstraint.getAggregationMode().equals(AggregationMode.YEARLY)){
|
||||||
|
groupLevel= 3;
|
||||||
|
}
|
||||||
viewName= temporalConstraint.getAggregationMode().name().toLowerCase();
|
viewName= temporalConstraint.getAggregationMode().name().toLowerCase();
|
||||||
|
|
||||||
if (filters != null && filters.size() != 0) {
|
if (filters != null && filters.size() != 0) {
|
||||||
|
@ -1940,9 +1916,7 @@ AccountingPersistenceBackendQuery {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//logger.trace("return map:{}",map.toString());
|
|
||||||
logger.trace("return ret:{}",ret.toString());
|
logger.trace("return ret:{}",ret.toString());
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -620,7 +620,7 @@ public class AccountingPersistenceQueryCouchBaseTest {
|
||||||
filters.add(new Filter(AggregatedServiceUsageRecord.CONSUMER_ID, "alessandro.pieve"));
|
filters.add(new Filter(AggregatedServiceUsageRecord.CONSUMER_ID, "alessandro.pieve"));
|
||||||
TemporalConstraint temporalConstraint =
|
TemporalConstraint temporalConstraint =
|
||||||
new TemporalConstraint(startTime.getTimeInMillis(),
|
new TemporalConstraint(startTime.getTimeInMillis(),
|
||||||
endTime.getTimeInMillis(), AggregationMode.DAILY);
|
endTime.getTimeInMillis(), AggregationMode.YEARLY);
|
||||||
|
|
||||||
|
|
||||||
List<String> providerId=new ArrayList<String>();
|
List<String> providerId=new ArrayList<String>();
|
||||||
|
|
Reference in New Issue