From d3fcb6171502402cfa99faf09a7140d639ec6834 Mon Sep 17 00:00:00 2001 From: Alessandro Pieve Date: Thu, 23 Feb 2017 15:25:13 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/accounting/accounting-aggregator-se-plugin@144203 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../madeaggregation/Aggregation.java | 2 +- .../plugin/AccountingAggregatorPlugin.java | 28 +++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/gcube/accounting/aggregator/madeaggregation/Aggregation.java b/src/main/java/org/gcube/accounting/aggregator/madeaggregation/Aggregation.java index c6e1bb9..4c8a571 100644 --- a/src/main/java/org/gcube/accounting/aggregator/madeaggregation/Aggregation.java +++ b/src/main/java/org/gcube/accounting/aggregator/madeaggregation/Aggregation.java @@ -113,7 +113,7 @@ public class Aggregation { //logger.debug("else -- add getAggregatedRecord"); records.add(getAggregatedRecord(record)); } catch (Exception e) { - + logger.debug("pre Exception but records"); records.add(record); logger.debug("Exception but records Add e:{}",e); } diff --git a/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPlugin.java b/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPlugin.java index 1241166..c5ae6d2 100644 --- a/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPlugin.java +++ b/src/main/java/org/gcube/accounting/aggregator/plugin/AccountingAggregatorPlugin.java @@ -147,7 +147,7 @@ public class AccountingAggregatorPlugin extends Plugin notDeletedTemp = null; while ((index < Constant.NUM_RETRY) && !succesfulDelete){ - List notDeletedTemp = new ArrayList(); + notDeletedTemp = new ArrayList(); for (JsonDocument doc: notDeleted){ + if (index>0){ + logger.trace("delete Start {} pass",index); + } countDelete ++; try{ - - //accountingBucket.remove(doc.id(),PersistTo.MASTER,Constant.CONNECTION_TIMEOUT_BUCKET, TimeUnit.SECONDS); accountingBucket.remove(doc.id(),persisted,Constant.CONNECTION_TIMEOUT_BUCKET, TimeUnit.SECONDS); }catch(Exception e){ logger.warn("doc:{} not deleted retry:{} for error:{}",doc.id(),index,e); @@ -489,15 +493,17 @@ public class AccountingAggregatorPlugin extends Plugin(notDeletedTemp); Thread.sleep(1000); + logger.trace("First pass no delete all succesfulDelete:{} index:{}",succesfulDelete,index); } } if (!succesfulDelete){ logger.error("Error Delete record"); } + + logger.debug("notDeletedTemp size:{} notDeleted:{}",notDeletedTemp.size(),notDeleted.size()); logger.debug("Delete complete:{}, Start a insert aggregated document:{}",countDelete,notInserted.size()); // delete all record and ready for insert a new aggregated record if (succesfulDelete){ @@ -508,6 +514,9 @@ public class AccountingAggregatorPlugin extends Plugin notInsertedTemp = new ArrayList(); for (JsonDocument document: notInserted){ + if (index>0){ + logger.trace("insert Start {} pass for document:{}",index,document.toString()); + } countInsert ++; try{ //JsonDocument response = accountingBucket.upsert(document,PersistTo.MASTER,Constant.CONNECTION_TIMEOUT_BUCKET, TimeUnit.SECONDS); @@ -540,10 +549,11 @@ public class AccountingAggregatorPlugin extends Plugin(notInsertedTemp); - Thread.sleep(1000); + Thread.sleep(1000); + logger.trace("First pass no insert all succesfulInsert:{} index:{}",succesfulInsert,index); } } if (!succesfulInsert){