Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5275 - in branches/new-structure-with-base2/ps-mdm-ls: . ant conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/dao src/main/java/org/perfsonar/service/lookupservice/registration src/main/java/org/perfsonar/service/lookupservice/storage src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/java/org/perfsonar/service/lookupservice/summarization/dao

Subject: perfsonar development work

List archive

perfsonar: r5275 - in branches/new-structure-with-base2/ps-mdm-ls: . ant conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/dao src/main/java/org/perfsonar/service/lookupservice/registration src/main/java/org/perfsonar/service/lookupservice/storage src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/java/org/perfsonar/service/lookupservice/summarization/dao


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5275 - in branches/new-structure-with-base2/ps-mdm-ls: . ant conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/dao src/main/java/org/perfsonar/service/lookupservice/registration src/main/java/org/perfsonar/service/lookupservice/storage src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/java/org/perfsonar/service/lookupservice/summarization/dao
  • Date: Thu, 3 Sep 2009 10:07:18 -0400

Author: trzaszcz
Date: 2009-09-03 10:07:16 -0400 (Thu, 03 Sep 2009)
New Revision: 5275

Added:

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

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

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

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/SummarizationBuilder.java
Removed:

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

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/dao/SummarizationDAO.java
Modified:
branches/new-structure-with-base2/ps-mdm-ls/ant/build.xml
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/registration/DiscoveryRequestGenerator.java

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

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

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

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

branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
Log:
LS-Store summarization

Modified: branches/new-structure-with-base2/ps-mdm-ls/ant/build.xml
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/ant/build.xml 2009-09-01
10:29:10 UTC (rev 5274)
+++ branches/new-structure-with-base2/ps-mdm-ls/ant/build.xml 2009-09-03
14:07:16 UTC (rev 5275)
@@ -68,10 +68,10 @@

<artifact:dependencies>

-
+ <dependency groupId="org.apache.ws.commons.schema"
artifactId="XmlSchema" version="1.4.3"/>
+ <dependency groupId="org.apache.axis2"
artifactId="axis2-jaxws" version="1.4.1"/>
<dependency groupId="perfsonar"
artifactId="ps-mdm-base2" version="0.0.4"/>
<dependency groupId="commons-digester"
artifactId="commons-digester" version="2.0"/>
- <dependency groupId="org.apache.axis2"
artifactId="axis2-jaxws" version="1.4.1"/>

<localRepository refid="local.repository"/>
<remoteRepository refid="remote.repository"/>
@@ -87,10 +87,11 @@
<property name="lib.dir" value="${basedir}/lib"/>

<property name="jar.name" value="ps-mdm-ls"/>
+ <property name="axis.version" value="1.5"/>
<property name="jar.version" value="4.0"/>

<property name="config.file.name" value="configuration.xml" />
- <property name="axis.dir" value="resources/axis2-1.4.1" />
+ <property name="axis.dir" value="resources/axis2-${axis.version}" />

<path id="service.classpath">
<fileset dir="${lib.dir}">
@@ -217,7 +218,6 @@

</target>

-
<target name="create.war"
depends="clean,create.service,init,prepare.repo">
<war destfile="${build.dir}/${war.name}.war"
webxml="${axis.dir}/webapp/WEB-INF/web.xml">
@@ -272,14 +272,12 @@
<!--TOMCAT-->

<target name="tomcat.start">
-
<exec executable="xterm" spawn="true"
dir="${tomcat.dir}/bin/">
<arg line=" -hold -e "/>
<arg line=" sh catalina.sh run "/>
</exec>

<echo message="tomcat is running"/>
-
</target>

<target name="tomcat.stop">
@@ -289,12 +287,16 @@
<echo message="tomcat stopped"/>
</target>

- <target name="tomcat.deploy" depends="tomcat.undeploy">
+ <target name="tomcat.deploy" depends="create.war">
<copy todir="${tomcat.dir}/webapps/"
file="build/${war.name}.war"/>
</target>

+ <target name="hitAndRun" depends="tomcat.deploy,tomcat.start"/>
+
<target name="tomcat.undeploy">
- <delete includeemptydirs="true"
dir="${tomcat.dir}/webapps/${war.name}/" description="delete ${war.name} from
webapps "/>
+ <delete includeemptydirs="true"
dir="${tomcat.dir}/webapps/${war.name}/" description="delete ${war.name} from
webapps ">
+ <include name="**/**/*"/>
+ </delete>
<delete file="${tomcat.dir}/webapps/${war.name}.war"/>
<echo message=" ${war.name}.war and ${war.name} folder
deleted from tomcat webapps"/>
</target>

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-01 10:29:10 UTC (rev 5274)
+++ branches/new-structure-with-base2/ps-mdm-ls/conf/configuration.xml
2009-09-03 14:07:16 UTC (rev 5275)
@@ -65,11 +65,6 @@
<option name="authN" value="no" />
</message>

-
-
-
-
-
</messageHandler>

<!--
....................................................................................
-->
@@ -104,12 +99,6 @@
</component>


- <!-- Summarization Service DAO -->
- <component name="summarizationdao"
-
className="org.perfsonar.service.lookupservice.summarization.dao.SummarizationDAO">
- <option name="exist-config" value="exist"/> <!-- reference to eXist
DB XML config-->
- </component>
-
<!-- Lookup Service DAO -->
<component name="lsdao"

className="org.perfsonar.service.lookupservice.storage.exist.XQueryExistDAOImpl">
@@ -120,7 +109,13 @@
<component name="lsdao-ro"

className="org.perfsonar.service.lookupservice.storage.exist.XQueryExistDAOImpl">
<option name="exist-config" value="exist-ro"/> <!-- reference to
eXist DB XML config-->
- </component>
+ </component>
+
+ <!-- Summarization Service DAO -->
+ <component name="summarizationdao"
+
className="org.perfsonar.service.lookupservice.dao.SummarizationDAO">
+ <option name="exist-config" value="exist"/> <!-- reference to eXist
DB XML config-->
+ </component>

<!-- Scheduler -->
<component name="scheduling"
@@ -135,8 +130,15 @@
<option name="interval" value="45" />
<option name="lsTTL" value="360"/>
</action>
+
+ <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"/>
+ </action>

-
+
<action name="registration"
className="org.perfsonar.base2.service.registration.LSRegistrationAction">

<option name="status" value="on" />

Modified: branches/new-structure-with-base2/ps-mdm-ls/pom.xml
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/pom.xml 2009-09-01 10:29:10
UTC (rev 5274)
+++ branches/new-structure-with-base2/ps-mdm-ls/pom.xml 2009-09-03 14:07:16
UTC (rev 5275)
@@ -6,7 +6,7 @@
<properties>
<configurationFile>configuration.xml</configurationFile>
<axis2Id>axis2-1.4.1</axis2Id>
- <packageName>ps-mdm-ls</packageName>
+ <packageName>perfsonar-java-xml-ls</packageName>
</properties>



Added:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/dao/ISummarizationDAO.java


Property changes on:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/dao/ISummarizationDAO.java
___________________________________________________________________
Name: svn:executable
+ *

Added:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/dao/SummarizationDAO.java


Property changes on:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/dao/SummarizationDAO.java
___________________________________________________________________
Name: svn:executable
+ *

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/registration/DiscoveryRequestGenerator.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/registration/DiscoveryRequestGenerator.java
2009-09-01 10:29:10 UTC (rev 5274)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/registration/DiscoveryRequestGenerator.java
2009-09-03 14:07:16 UTC (rev 5275)
@@ -15,7 +15,7 @@
*/
public class DiscoveryRequestGenerator {

- List<Metadata> metadataList=new ArrayList<Metadata>();
+ List<Element> dataList=new ArrayList<Element>();

public Message createMessageElement() {

@@ -49,7 +49,8 @@
data.addAttribute("id", metadataId+"_dataTriger");
data.addAttribute("metadataIdRef", metadataId);
message.addChild(data);
- metadataList.add(metadata);
+ dataList.add(metadata);
+ dataList.add(data);

return subject;
}
@@ -134,7 +135,7 @@
return parameter;
}

- public List<Metadata> getMetadataList() {
- return metadataList;
+ public List<Element> getDataList() {
+ return dataList;
}
}

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/registration/LSSummaryRegisterDataSource.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/registration/LSSummaryRegisterDataSource.java
2009-09-01 10:29:10 UTC (rev 5274)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/registration/LSSummaryRegisterDataSource.java
2009-09-03 14:07:16 UTC (rev 5275)
@@ -4,13 +4,6 @@
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;

import javax.xml.stream.XMLStreamException;

@@ -18,14 +11,12 @@
import org.perfsonar.base2.service.exceptions.PerfSONARException;
import org.perfsonar.base2.service.registration.RegisterDataSource;
import org.perfsonar.base2.service.requesthandler.ServiceMessage;
+import org.perfsonar.base2.service.storage.xml.XMLDBResult;
import org.perfsonar.base2.xml.Element;
import org.perfsonar.base2.xml.ElementSerializer;
import org.perfsonar.base2.xml.nmwg.Message;
-import org.perfsonar.base2.xml.nmwg.Metadata;
-import
org.perfsonar.service.lookupservice.registration.summarization.SummarizeIpAddrs;
+import org.perfsonar.service.lookupservice.dao.ISummarizationDAO;
import org.perfsonar.service.lookupservice.storage.LookupServiceDAOFactory;
-import org.perfsonar.service.lookupservice.summarization.ServiceSummary;
-import
org.perfsonar.service.lookupservice.summarization.dao.ISummarizationDAO;

/**
* This class get data and summarize
@@ -38,15 +29,8 @@
protected static final Logger logger = Logger

.getLogger(LSSummaryRegisterDataSource.class.getName());

- private static final int IP = 100;
- private static final int DOMAIN = 200;
- private static final int EVENT_TYPE = 300;
- private static final int KEYWORD = 400;
-
protected ISummarizationDAO dao;

- //
----------------------------------------------------------------------
-
public LSSummaryRegisterDataSource() throws PerfSONARException {

super();
@@ -54,288 +38,40 @@
}

public ServiceMessage getRegisterData() throws PerfSONARException {
+
logger.debug("Getting Summary register data");
-
- // get all topology information (IPs)
-
- logger.debug("Get services info from DB");
- Map<String, ServiceSummary> summaries =
getAllServicesSummaries();
- // now having all data in "summaries" structure and need to
summarize
- // IPs, domains separately. EventTypes will remain the same.
-
- // So, summarize information
- logger.debug("Summarize...");
-
- // boolean doIPSummarization =
- // config.getProperty("service.ls.do_ip_summarization");
- int i = 0;
- // work on the same data - summarize and store in "summaries"
structure
- for (ServiceSummary s : summaries.values()) {
- i++; // increase counter
-
- // summarize IPs
- logger.debug("Summarize IP addresses for service #["
+ i + "]");
-
s.setIpAddresses(summarizeIPAddresses(s.getIpAddresses()));
-
- // summarize domains
- logger.debug("Summarize domains for service #[" + i +
"]");
- s.setDomains(summarizeDomains(s.getDomains()));
-
- logger.debug("Summarize eventTypes and keywords...");
- // summarize eventTypes
- // no summarization, just store
-
- // summarize keywords
- // no summarization, just store
-
+
+ XMLDBResult dbResult=dao.getSummaryData();
+
+ Message message= new Message();
+ message.setId("LSDiscoveryRequest");
+ message.setType("LSQueryRequest");
+
+
+ for(Element element : dbResult.getResults()){
+ message.addChild(element);
}
-
- // TODO: TEMPORARY:
- showSummary(summaries);
-
- DiscoveryRequestGenerator gen = new
DiscoveryRequestGenerator();
- Message msg = gen.createMessageElement();
-
- // for every single summary get XML
- for (Entry<String, ServiceSummary> s : summaries.entrySet()) {
-
- Element subject = gen.createSubjectElement(msg,
s.getKey());
-
- for (String ip : s.getValue().getIpAddresses()) {
-
- // split results - ip/netmask or assume 32 as
netmask if wrong
- // format
- String[] ipvals = ip.split("/", 2);
- if (ipvals.length != 2) {
- ipvals = new String[] { ip, "32" };
- }
- gen.createAddressElement(subject, ipvals[0],
ipvals[1]);
- }
-
- for (String dom : s.getValue().getDomains()) {
- gen.createDomainElement(subject, dom);
- }
-
- // get sum of parameters to determine whether there
is any parameter
- // to be printed
- int paramsSum = s.getValue().getEventTypes().size()
- + s.getValue().getKeywords().size();
- // if it is at least one, put it.
- if (paramsSum > 0) {
- Element parametersElement = gen
-
.createParametersElement(subject);
-
- for (String evt :
s.getValue().getEventTypes()) {
-
gen.createParameterElement(parametersElement, "eventType",
- evt);
- }
- for (String kw : s.getValue().getKeywords()) {
- gen
-
.createParameterElement(parametersElement,
-
"keyword", kw);
- }
- }
-
- }
- // logger.debug("Summary data is:\n" + msg);
-
- dao.removeSummaryData();
-
- for (Metadata metadata : gen.getMetadataList()) {
- dao.putSummaryData(metadata);
- }
-
- ElementSerializer es = new ElementSerializer();
- File file = new File("/home/czacha/Desktop/log");
-
+
+ ElementSerializer es=new ElementSerializer();
+ File file=new File("/home/czacha/Desktop/glsRequest.txt");
+
+ FileOutputStream fos;
try {
- es.write(new FileOutputStream(file), msg);
+ fos = new FileOutputStream(file);
+ es.write(fos, message);
} catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
e.printStackTrace();
} catch (XMLStreamException e) {
// TODO Auto-generated catch block
+ e.printStackTrace();
} catch (IOException e) {
+ // TODO Auto-generated catch block
e.printStackTrace();
}
-
- return new ServiceMessage(msg);
-
+
+
+ return new ServiceMessage(message);
}

- /**
- * Get topology data and eventTypes from all services store it in
- * Map<String, ServiceSummary>
- *
- * @return
- */
- private Map<String, ServiceSummary> getAllServicesSummaries()
- throws PerfSONARException {
-
- Map<String, ServiceSummary> summaries = new HashMap<String,
ServiceSummary>();
- String[] ipResults = dao.queryIpResults();
- String[] domainResults = dao.queryDomainResults();
- String[] eventTypeResults = dao.queryEventTypeResults();
- String[] keywordResults = dao.queryKeywordResults();
-
- logger
-
.debug("LSSummaryServiceContent.getAllServicesSummaries: got summary from
database. Number of: ");
- try {
- logger.debug(" - IP: [" + ipResults.length +
"]");
- logger.debug(" - domains: [" +
domainResults.length + "]");
- logger.debug(" - eventvTypes: [" +
eventTypeResults.length
- + "]");
- } catch (Exception ex) {
- }
-
- populateSummary(summaries, ipResults, IP);
- populateSummary(summaries, domainResults, DOMAIN);
- populateSummary(summaries, eventTypeResults, EVENT_TYPE);
- populateSummary(summaries, keywordResults, KEYWORD);
-
- return summaries;
-
- }
-
- /**
- * Get subdomains for domain. For example for input string
- * "www.man.poznan.pl" and limit=3 it will return collection of "pl",
- * "poznan.pl" and "man.poznan.pl"
- *
- * @param domain
- * input domain e.g. "www.man.poznan.pl"
- * @param limit
- * number of subdomains to be returned. Value -1 means
"all"
- * @param list
- * collection where results are to be added
- * @return updated Collection
- */
- public Collection<String> getSubDomains(String domain, int limit,
- Collection<String> list) {
-
- if (domain == null)
- return null;
-
- int last = domain.length();
-
- for (int current = last - 1; current >= 0; current--) {
-
- if (limit == 0)
- break;
-
- if (domain.charAt(current) == '.') {
- String subdomain = domain.substring(current +
1);
- if (!"".equals(subdomain))
- list.add(subdomain);
- limit--;
- }
- }
- return list;
- }
-
- /**
- * Do IPs summarization. Returns new, summarized set of data Input
data is
- * not changed.
- *
- * @param data
- * @return
- */
- private Set<String> summarizeIPAddresses(Set<String> ipAddresses) {
-
- Set<String> result;
-
- try {
- result = SummarizeIpAddrs.getSummary(ipAddresses);
- } catch (Exception ex) {
- logger.error("IP summarization failed. " +
"Exception: " + ex
- + " : " + ex.getMessage());
- result = ipAddresses;
- }
- return result;
-
- }
-
- /**
- * Do domains summarization. Returns new, summarized set of data
Input data
- * is not changed.
- *
- * @param data
- * @return
- */
- private Set<String> summarizeDomains(Set<String> data) {
-
- HashSet<String> summarizedData = new HashSet<String>();
- for (String s : data) {
- getSubDomains(s, 3, summarizedData);
- }
- return summarizedData;
-
- }
-
- /**
- * Extracts data from lines (DB results) and put them into the right
place
- * in summaries
- *
- * @param summaries
- * @param lines
- * results from DB
- * @param type
- * type of field to be populated
- */
- private void populateSummary(Map<String, ServiceSummary> summaries,
- String[] lines, int type) {
-
- // split and store results
- for (String line : lines) {
-
- // split result
- String[] params = line.split(",", 2);
-
- if (params.length != 2) {
- logger.debug("suppressing line; invalid
format(value='" + line
- + "')");
- break;
- }
-
- String key = params[0];
- String content = params[1];
- // System.out.println(" -- parse results: "+key+" :
"+content);
-
- // get or create summary for the service
- ServiceSummary summary = summaries.get(key);
- if (summary == null) {
- summary = new ServiceSummary();
- summaries.put(key, summary);
- }
-
- // fill the right field
- switch (type) {
- case IP:
- summary.getIpAddresses().add(content);
- break;
- case DOMAIN:
- summary.getDomains().add(content);
- break;
- case EVENT_TYPE:
- summary.getEventTypes().add(content);
- break;
- case KEYWORD:
- summary.getKeywords().add(content);
- break;
- }
-
- }
-
- }
-
- private void showSummary(Map<String, ServiceSummary> summaries) {
- Iterator<Entry<String, ServiceSummary>> i =
summaries.entrySet()
- .iterator();
- while (i.hasNext()) {
- Map.Entry<String, ServiceSummary> e = i.next();
- logger.debug("\n==== " + e.getKey() + " ====\n");
- logger.debug(e.getValue().toString());
-
- }
- }
-
}
\ No newline at end of file

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAO.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAO.java
2009-09-01 10:29:10 UTC (rev 5274)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAO.java
2009-09-03 14:07:16 UTC (rev 5275)
@@ -137,4 +137,7 @@
*/
public boolean isDBConnectivity() throws PerfSONARException;

+
+ public int getControlParameterCount(long timeBefore) throws
NumberFormatException, PerfSONARException ;
+
} //LookupServiceDAO

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAOFactory.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAOFactory.java
2009-09-01 10:29:10 UTC (rev 5274)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/LookupServiceDAOFactory.java
2009-09-03 14:07:16 UTC (rev 5275)
@@ -2,7 +2,7 @@

import org.perfsonar.base2.service.configuration.ConfigurationManager;
import org.perfsonar.base2.service.exceptions.PerfSONARException;
-import
org.perfsonar.service.lookupservice.summarization.dao.ISummarizationDAO;
+import org.perfsonar.service.lookupservice.dao.ISummarizationDAO;

public class LookupServiceDAOFactory {


Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/MultipleFilesExistDAOImpl.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/MultipleFilesExistDAOImpl.java
2009-09-01 10:29:10 UTC (rev 5274)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/MultipleFilesExistDAOImpl.java
2009-09-03 14:07:16 UTC (rev 5275)
@@ -233,15 +233,21 @@


public void putSummaryData(Metadata m) throws PerfSONARException {
- // TODO Auto-generated method stub
+ throw new RuntimeException("Not implemented");

}


public void removeSummaryData() throws PerfSONARException {
- // TODO Auto-generated method stub
+ throw new RuntimeException("Not implemented");

}

+
+ @Override
+ public int getControlParameterCount(long timeBefore) {
+ throw new RuntimeException("Not implemented");
+ }
+

} //MultipleFilesExistDAOImpl

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
2009-09-01 10:29:10 UTC (rev 5274)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
2009-09-03 14:07:16 UTC (rev 5275)
@@ -268,48 +268,25 @@
+
"']/nmwg:data[@metadataIdRef='"
+ metadataId + "']" + ")";
}

-// public void removeSummaryData() throws PerfSONARException {
-//
-// StringBuffer sb = new StringBuffer();
-//
-// sb.append(XQUERY_DECLARE_NAMESPACES);
-// sb.append("update delete
/nmwg:store[@type='LSStore-summary']/nmwg:metadata");
-//
-// getDataStorage().performXQuery(sb.toString(),
getDataCollection(),
-// getDataCredential());
-//
-// }
-//
-// public void putSummaryData(Metadata m) throws PerfSONARException {
-// ElementSerializer ser = new ElementSerializer();
-// ser.setStartingDocumentDeclaration(false);
-// StringBuffer xmls = new StringBuffer();
-// StringBufferOutputStream os = new
StringBufferOutputStream(xmls);
-//
-// // add xquery namespaces and UPDATE instruction
-// xmls.append(XQUERY_DECLARE_NAMESPACES);
-// xmls.append(UPDATE_INSERT);
-// xmls.append(" (\n"); // IMPORTANT - begin Xquery collection
(m, d, d,
-// // ...)
-//
-// try {
-//
-// // add metadata to StringBuffer
-// ser.write(os, m);
-//
-// } catch (Exception e) {
-// throw new PerfSONARException("error/parse",
-// "Cannot serialize elements in
XQueryExistDAOImpl");
-// }
-// // send XQuery
-// xmls.append(" )\n"); // IMPORTANT - end of Xquery collection
(m, d, d,
-// // ...)
-// xmls.append(UPDATE_INTO);
-// xmls.append(UPDATE_LSSTORE_SUMMARY);
-//
-// String query = xmls.toString();
-// getDataStorage().performXQuery(query, getDataCollection(),
-// getDataCredential());
-// }
+ @Override
+ public int getControlParameterCount(long timeBefore) throws
NumberFormatException, PerfSONARException {
+ StringBuffer sb=new StringBuffer();
+
+ sb.append(DECLARE_NMWG_NAMESPACE);
+ sb.append(" count (");
+ sb.append(" for $i in
/nmwg:store[@type='LSStore-control']/nmwg:metadata/nmwg:parameters/nmwg:parameter[@name='timestamp']");
+ sb.append(" let $timestamp:=data($i/@value) cast as
xs:integer");
+ sb.append(" where ($timestamp > ");
+ sb.append(timeBefore);
+ sb.append(" )return 1");
+ sb.append(" )");
+ String []
results=getDataStorage().performXQuery(sb.toString(),
getDataCollection(),getDataCredential()).getTextResults();
+ if(results.length==1){
+ return Integer.parseInt(results[0]);
+ }else{
+ return 0;
+ }
+
+ }

-} // SingleFileExistHttpDAOImpl
+}

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


Property changes on:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/LSSummarySynchronizationAction.java
___________________________________________________________________
Name: svn:executable
+ *

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


Property changes on:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/SummarizationBuilder.java
___________________________________________________________________
Name: svn:executable
+ *

Deleted:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/dao/ISummarizationDAO.java

Deleted:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/dao/SummarizationDAO.java



  • perfsonar: r5275 - in branches/new-structure-with-base2/ps-mdm-ls: . ant conf src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/dao src/main/java/org/perfsonar/service/lookupservice/registration src/main/java/org/perfsonar/service/lookupservice/storage src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/java/org/perfsonar/service/lookupservice/summarization/dao, svnlog, 09/03/2009

Archive powered by MHonArc 2.6.16.

Top of Page