Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5279 - in branches/new-structure-with-base2/ps-mdm-ls: . conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/summarization

Subject: perfsonar development work

List archive

perfsonar: r5279 - in branches/new-structure-with-base2/ps-mdm-ls: . conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/summarization


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5279 - in branches/new-structure-with-base2/ps-mdm-ls: . conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/summarization
  • Date: Mon, 7 Sep 2009 05:55:51 -0400

Author: trzaszcz
Date: 2009-09-07 05:55:49 -0400 (Mon, 07 Sep 2009)
New Revision: 5279

Removed:
branches/new-structure-with-base2/ps-mdm-ls/build/
branches/new-structure-with-base2/ps-mdm-ls/conf/configuration-dls.xml
Modified:
branches/new-structure-with-base2/ps-mdm-ls/conf/configuration.xml
branches/new-structure-with-base2/ps-mdm-ls/pom.xml

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupServiceEngine.java

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/LSSummarySynchronizationAction.java
Log:
summarization enhancement

Deleted:
branches/new-structure-with-base2/ps-mdm-ls/conf/configuration-dls.xml

Modified: branches/new-structure-with-base2/ps-mdm-ls/conf/configuration.xml
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/conf/configuration.xml
2009-09-04 11:51:01 UTC (rev 5278)
+++ branches/new-structure-with-base2/ps-mdm-ls/conf/configuration.xml
2009-09-07 09:55:49 UTC (rev 5279)
@@ -117,8 +117,8 @@
<option name="exist-config" value="exist"/> <!-- reference to eXist
DB XML config-->
</component>

- <component name="countChangesComponent"
-
className="org.perfsonar.service.lookupservice.summarization.CountChangesComponent">
+ <component name="modificationCounterComponent"
+
className="org.perfsonar.service.lookupservice.summarization.ModificationCounterComponent">
</component>

<!-- Scheduler -->
@@ -138,8 +138,8 @@
<action name="LSSummarySynchronization"
className="org.perfsonar.service.lookupservice.summarization.LSSummarySynchronizationAction">
<option name="status" value="on" />
<option name="interval" value="45" />
- <option name="diffCount" value="4"/>
- <option name="loopCount" value="2"/>
+ <option name="nrOfModifications" value="4"/>
+ <option name="nrOfIterations" value="2"/>
</action>



Modified: branches/new-structure-with-base2/ps-mdm-ls/pom.xml
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/pom.xml 2009-09-04 11:51:01
UTC (rev 5278)
+++ branches/new-structure-with-base2/ps-mdm-ls/pom.xml 2009-09-07 09:55:49
UTC (rev 5279)
@@ -1,5 +1,3 @@
-<!-- <?xml version="1.0" encoding="UTF-8"?> -->
-<!-- romradz -->
<project>


@@ -180,12 +178,6 @@
<dependencies>

<dependency>
- <groupId>rrdjtool</groupId>
- <artifactId>rrdjtool</artifactId>
- <version>1.0</version>
- </dependency>
-
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.3</version>
@@ -209,31 +201,6 @@
<version>1.7</version>
</dependency>

- <dependency>
- <groupId>exist</groupId>
- <artifactId>exist-optional</artifactId>
- <version>1.0rc</version>
- </dependency>
-
- <dependency>
- <groupId>exist</groupId>
- <artifactId>exist-xmldb</artifactId>
- <version>1.0rc</version>
- </dependency>
-
- <dependency>
- <groupId>exist</groupId>
- <artifactId>exist-xmlrpc</artifactId>
- <version>1.0rc</version>
- </dependency>
-
- <dependency>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- <version>1.4</version>
- </dependency>
-
-
<!-- taken from axis2 sources -->

<dependency>
@@ -334,7 +301,6 @@
<version>2.7.0</version>
</dependency>

-
</dependencies>



Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupServiceEngine.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupServiceEngine.java
2009-09-04 11:51:01 UTC (rev 5278)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupServiceEngine.java
2009-09-07 09:55:49 UTC (rev 5279)
@@ -6,7 +6,7 @@
import org.perfsonar.base2.service.requesthandler.ServiceMessage;
import org.perfsonar.base2.service.util.ResultCodesUtil;
import org.perfsonar.base2.xml.nmwg.Message;
-import
org.perfsonar.service.lookupservice.summarization.CountChangesComponent;
+import
org.perfsonar.service.lookupservice.summarization.ModificationCounterComponent;



@@ -99,7 +99,7 @@
if ( elementRemoved > 0){
// some elements were removed, ChangesRecorder should be
informed about it
ConfigurationManager cm=ConfigurationManager.getInstance();
- CountChangesComponent component =(CountChangesComponent)
cm.getConfiguration().getAuxiliaryComponent("countChangesComponent");
+ ModificationCounterComponent component
=(ModificationCounterComponent)
cm.getConfiguration().getAuxiliaryComponent("modificationCounterComponent");
component.increaseCounter();
}


Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java
2009-09-04 11:51:01 UTC (rev 5278)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSDeregisterServiceEngine.java
2009-09-07 09:55:49 UTC (rev 5279)
@@ -7,7 +7,7 @@
import org.perfsonar.base2.service.util.ResultCodesUtil;
import org.perfsonar.base2.xml.nmwg.Message;
import org.perfsonar.base2.xml.nmwg.Metadata;
-import
org.perfsonar.service.lookupservice.summarization.CountChangesComponent;
+import
org.perfsonar.service.lookupservice.summarization.ModificationCounterComponent;


/**
@@ -77,9 +77,9 @@

// inform about changes Component !
ConfigurationManager cm = ConfigurationManager.getInstance();
- CountChangesComponent component = (CountChangesComponent) cm
+ ModificationCounterComponent component =
(ModificationCounterComponent) cm
.getConfiguration().getAuxiliaryComponent(
- "countChangesComponent");
+
"modificationCounterComponent");
component.increaseCounter();

logger.debug("!!! C");

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java
2009-09-04 11:51:01 UTC (rev 5278)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java
2009-09-07 09:55:49 UTC (rev 5279)
@@ -12,7 +12,7 @@
import org.perfsonar.base2.xml.nmwg.Metadata;
import
org.perfsonar.service.lookupservice.registerService.LSRegisterServiceHelper;
import org.perfsonar.service.lookupservice.registration.LsTTLParameterStatus;
-import
org.perfsonar.service.lookupservice.summarization.CountChangesComponent;
+import
org.perfsonar.service.lookupservice.summarization.ModificationCounterComponent;

/**
* REGISTER and UPDATE Action
@@ -293,9 +293,9 @@

// some element was added, ChangesRecorder should be informed
about it
ConfigurationManager cm = ConfigurationManager.getInstance();
- CountChangesComponent component = (CountChangesComponent) cm
+ ModificationCounterComponent component =
(ModificationCounterComponent) cm
.getConfiguration().getAuxiliaryComponent(
- "countChangesComponent");
+
"modificationCounterComponent");
component.increaseCounter();

logger.info("[LS Registration] Put new Lookup Info (" +
metadataId

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/LSSummarySynchronizationAction.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/LSSummarySynchronizationAction.java
2009-09-04 11:51:01 UTC (rev 5278)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/LSSummarySynchronizationAction.java
2009-09-07 09:55:49 UTC (rev 5279)
@@ -1,8 +1,8 @@
package org.perfsonar.service.lookupservice.summarization;

import java.util.List;
-import java.util.logging.Logger;

+import org.apache.log4j.Logger;
import org.perfsonar.base2.service.configuration.Action;
import org.perfsonar.base2.service.configuration.ConfigurationManager;
import org.perfsonar.base2.service.exceptions.PerfSONARException;
@@ -11,90 +11,98 @@
import org.perfsonar.service.lookupservice.dao.ISummarizationDAO;
import org.perfsonar.service.lookupservice.storage.LookupServiceDAOFactory;

-public class LSSummarySynchronizationAction extends Action implements
SchedulerAction {
+/**
+ *
+ * Action synchronize summary data.
+ * This component uses ModificationCounterComponent which store nr of
+ * modification. This action bases on 2 constant. NR_OF_MODIFICATIONS
+ * (boundary value of modification nr; when nr of modification is greater
then
+ * NR_OF_MODIFICATIONS then synchronization is required)
+ * NR_OF_ITERATION - if this value is equal iteration nr summarization
process is executed
+ * only if exists any modifications
+ *
+ * @author trzaszcz
+ */
+public class LSSummarySynchronizationAction extends Action implements
+ SchedulerAction {

-
- private int DIFF_COUNT;
- private int LOOP_COUNT;
- private int loopCountNr=0;
+ private int NR_OF_MODIFICATIONS;
+ private int NR_OF_ITERATIONS;
+ private int iteration = 0;
private ISummarizationDAO summarizationDao;
private SummarizationBuilder builder;
- private Logger logger=Logger.getAnonymousLogger();
- private boolean firstLoop=true;
-
-
+ private Logger logger = Logger
+ .getLogger(LSSummarySynchronizationAction.class);
+
public LSSummarySynchronizationAction() throws PerfSONARException {
super();
}
-
+
@Override
public void runAction() {
try {
-
summarizationDao=LookupServiceDAOFactory.getSumarizationDAO();
- builder=new SummarizationBuilder(summarizationDao);
+ summarizationDao =
LookupServiceDAOFactory.getSumarizationDAO();
+ builder = new SummarizationBuilder(summarizationDao);
} catch (PerfSONARException e) {
e.printStackTrace();
}
-
- int nrOfChanges=0;
- CountChangesComponent component = null;
+
+ int nrOfChanges = 0;
+ ModificationCounterComponent component = null;
try {
ConfigurationManager cm =
ConfigurationManager.getInstance();
-
- component = (CountChangesComponent) cm
-
.getConfiguration().getAuxiliaryComponent(
-
"countChangesComponent");
- nrOfChanges=component.getCounter();
+
+ component = (ModificationCounterComponent)
cm.getConfiguration()
+
.getAuxiliaryComponent("modificationCounterComponent");
+ nrOfChanges = component.getCounter();
} catch (PerfSONARException e) {
e.printStackTrace();
}
-
- DIFF_COUNT=getOption("diffCount").getValueAsInteger();
- LOOP_COUNT=getOption("loopCount").getValueAsInteger();

+ NR_OF_MODIFICATIONS =
getOption("nrOfModifications").getValueAsInteger();
+ NR_OF_ITERATIONS =
getOption("nrOfIterations").getValueAsInteger();
+
try {
-
- if(firstLoop){
+
+ if (iteration==0) {
+ // in first iteration summary data is build
synchronizeSummarizationCollection();
- firstLoop=false;
- logger.info("--------------FIRST TIME");
- }else if(loopCountNr!=LOOP_COUNT){
- if (nrOfChanges >= DIFF_COUNT){
-
synchronizeSummarizationCollection();
- component.resetCounter();
- logger.info("--------------DO
");
- }else{
-
logger.info("--------------LAZY");
- }
- loopCountNr++;
- }else{
- loopCountNr=0;
- if(nrOfChanges != 0){
+ iteration++;
+ } else if (iteration != NR_OF_ITERATIONS) {
+
+
+ if (nrOfChanges >= NR_OF_MODIFICATIONS) {
+ // if nr of changes is greater then
const NR_OF_MODIFICATIONS -> summary data must be refreshed
synchronizeSummarizationCollection();
component.resetCounter();
- logger.info("--------------DO != 0");
- }else{
- logger.info("--------------LAZY - >
0");
}
+ iteration++;
+ } else {
+ // if NR_OF_ITERATION is equal iteration nr
...
+ iteration = 0;
+ //summarization is obligatory when there are
any differences
+ if (nrOfChanges != 0) {
+ synchronizeSummarizationCollection();
+ component.resetCounter();
+ }
}
-
+
} catch (NumberFormatException e1) {
e1.printStackTrace();
} catch (PerfSONARException e1) {
e1.printStackTrace();
}
-
+
}
-
-
- private void synchronizeSummarizationCollection() throws
PerfSONARException{
- logger.info("------------SYNC--------------");
+
+ private void synchronizeSummarizationCollection() throws
PerfSONARException {
+ logger.debug("building summarization data");
summarizationDao.removeSummaryData();
- List<Element> datas=builder.build();
- for(Element element:datas){
+ List<Element> datas = builder.build();
+ for (Element element : datas) {
summarizationDao.putSummaryData(element);
}
-
+
}

}



  • perfsonar: r5279 - in branches/new-structure-with-base2/ps-mdm-ls: . conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/summarization, svnlog, 09/07/2009

Archive powered by MHonArc 2.6.16.

Top of Page