Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5355 - in branches/new-structure-with-base2/ps-mdm-ls: . contrib/SOAPRequestAuxilary/inputs contrib/SOAPRequestAuxilary/src/pl/psnc contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/servlets src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/resources src/main/resources/log4j src/main/resources/log4j/production src/main/resources/log4j/test

Subject: perfsonar development work

List archive

perfsonar: r5355 - in branches/new-structure-with-base2/ps-mdm-ls: . contrib/SOAPRequestAuxilary/inputs contrib/SOAPRequestAuxilary/src/pl/psnc contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/servlets src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/resources src/main/resources/log4j src/main/resources/log4j/production src/main/resources/log4j/test


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5355 - in branches/new-structure-with-base2/ps-mdm-ls: . contrib/SOAPRequestAuxilary/inputs contrib/SOAPRequestAuxilary/src/pl/psnc contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/servlets src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/resources src/main/resources/log4j src/main/resources/log4j/production src/main/resources/log4j/test
  • Date: Wed, 25 Nov 2009 04:31:47 -0500

Author: trzaszcz
Date: 2009-11-25 04:31:47 -0500 (Wed, 25 Nov 2009)
New Revision: 5355

Added:

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/inputs/LSRegistrationCore.xml

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/inputs/LSRegistrationRequest100.xml

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/inputs/LSRegistrationRequest500.xml

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

branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/production/

branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/production/log4j.properties
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/test/

branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/test/log4j.properties
Removed:

branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j.properties
Modified:

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/Main.py

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/TestService.py

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/XMLGenerator.py

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/Main.py

branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/RegistrationThread.py
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/LSCleanupSchedulerAction.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/servlets/ExistDbInitializerServlet.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/SummarizationDAOImpl.java

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

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/summarization/LSSummarySynchronizationAction.java
Log:
MultipleFiles, performance improvement, log4j - mvn profile

Added:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/inputs/LSRegistrationCore.xml


Property changes on:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/inputs/LSRegistrationCore.xml
___________________________________________________________________
Name: svn:executable
+ *

Added:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/inputs/LSRegistrationRequest100.xml

Added:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/inputs/LSRegistrationRequest500.xml

Modified:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/Main.py
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/Main.py
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/Main.py
2009-11-25 09:31:47 UTC (rev 5355)
@@ -5,17 +5,16 @@
'''

import pl.psnc.trzaszczka.auxiliary.Auxiliary
+from pl.psnc.trzaszczka.auxiliary.XMLGenerator import XMLGenerator
import os

if __name__ == '__main__':

- f=open("../../../inputs/request.xml","r")
+ xmlGenerator=XMLGenerator()
+
content=xmlGenerator.generateMessage("../../../inputs/LSRegistrationCore.xml",
"metaId", "192.168.132", "man.poznan.pl", 500);
+ f=file("LSRegistrationRequest500.xml","w")
+ f.write(content)
+# print content;
+# print xmlGenerator.generateIP("192")

- soap_content=f.read()
-
- auxiliary=pl.psnc.trzaszczka.auxiliary.Auxiliary.Sender("127.0.0.1:8080")
- auxiliary.connect()
-
- print auxiliary.send("/perfsonar-java-xml-ls/services/LookupService",
soap_content)
-
pass
\ No newline at end of file

Modified:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/TestService.py
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/TestService.py
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/TestService.py
2009-11-25 09:31:47 UTC (rev 5355)
@@ -33,8 +33,10 @@
c=0
for message in messagesList :
before=time.time()
-
sender.send("/perfsonar-java-xml-ls/services/LookupService",message)
+ sender.send(self.url,message)
result_list.append((time.time()-before)*1000)
+ print c
+ c=c+1

for t in range(0,len(result_list)) :
sum=sum+result_list[t]

Modified:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/XMLGenerator.py
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/XMLGenerator.py
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary/XMLGenerator.py
2009-11-25 09:31:47 UTC (rev 5355)
@@ -20,11 +20,11 @@


def generateIP(self,prefix):
- dots=prefix.__contains__(".")
+ dots=prefix.count(".")


result=prefix
- for c in range(1, 3-dots) :
+ for c in range(0, 3-dots) :
result=result+"."+str(random.randint(0,255))

return result

Modified:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/Main.py
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/Main.py
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/Main.py
2009-11-25 09:31:47 UTC (rev 5355)
@@ -13,7 +13,7 @@


if __name__ == '__main__':
-
+
# url of LS service
url="127.0.0.1:8080"
# url_path to LS sertvice http://url/url_path
@@ -24,15 +24,13 @@
# free ids prepared for registration
f_list=range(1,1000)

-
-
regThread=RegistrationThread(0.005,1000,url,url_path,"../../../../../inputs/LSRegistrationRequest100.xml",r_list,f_list);
-
deregThread=DeregistrationThread(0.030,url,url_path,"../../../../../inputs/LSDeregisterRequest.xml",r_list,f_list);
+
regThread=RegistrationThread(0.005,2000,140,url,url_path,"../../../../../inputs/LSRegistrationRequest100.xml",r_list,f_list);
+
deregThread=DeregistrationThread(0.050,url,url_path,"../../../../../inputs/LSDeregisterRequest.xml",r_list,f_list);

qThread=QueryingThread(0.001,url,url_path,"../../../../../inputs/LSQueryRequest.xml",r_list,f_list);

-
regThread.start()
# give some time for services registration
- time.sleep(2)
+ time.sleep(20)
deregThread.start()
qThread.start()


Modified:
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/RegistrationThread.py
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/RegistrationThread.py
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests/RegistrationThread.py
2009-11-25 09:31:47 UTC (rev 5355)
@@ -16,11 +16,12 @@
'''


- def __init__(self,delay,count,host,url_path,file_url,r_list,f_list):
+ def __init__(self,delay,count,max,host,url_path,file_url,r_list,f_list):
'''
Constructor
'''
self.count=count
+ self.max=max
StressThread.__init__(self, delay, host,url_path, file_url, r_list,
f_list)


@@ -31,11 +32,13 @@
while (iteration<self.count):
print "r:",len(self.r_list)," f:",len(self.f_list)
print "R [",iteration,"/",self.count,"]"
- id=self.f_list[0]
- # registration
-
soap_message=template.replace("LS_REGISTRATION_ACCESS_POINT","http://localhost:8180/"+str(id))
- connection.send(self.url_path, soap_message)
- self.registerElement(id)
- time.sleep(self.delay)
- iteration=iteration+1
-
\ No newline at end of file
+
+ # if number of registrated services is greater then MAX - >
don't register more !
+ if self.max >= len(self.r_list) :
+ id=self.f_list[0]
+ # registration
+
soap_message=template.replace("LS_REGISTRATION_ACCESS_POINT","http://localhost:8180/"+str(id))
+ connection.send(self.url_path, soap_message)
+ self.registerElement(id)
+ iteration=iteration+1
+ time.sleep(self.delay)
\ No newline at end of file

Modified: branches/new-structure-with-base2/ps-mdm-ls/pom.xml
===================================================================
--- branches/new-structure-with-base2/ps-mdm-ls/pom.xml 2009-11-24 12:42:34
UTC (rev 5354)
+++ branches/new-structure-with-base2/ps-mdm-ls/pom.xml 2009-11-25 09:31:47
UTC (rev 5355)
@@ -1,5 +1,4 @@
<project>
-
<properties>
<configurationFile>configuration.xml
</configurationFile>
@@ -81,10 +80,18 @@
</plugin>

<plugin>
+
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
+
<directory>${basedir}/src/main/resources/log4j/${log4j}</directory>
+ <includes>
+
<include>log4j.properties</include>
+ </includes>
+
<targetPath>WEB-INF/classes</targetPath>
+ </resource>
+ <resource>

<directory>${basedir}/db</directory>
<includes>

<include>**/*.xml</include>
@@ -336,7 +343,41 @@
<groupId>org.apache.xmlrpc</groupId>
<version>3.0</version>
</dependency>
+ <dependency>
+ <groupId>commons-pool</groupId>
+ <artifactId>commons-pool</artifactId>
+ <version>1.5.3</version>
+ </dependency>
+ <dependency>
+ <groupId>antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>2.7.2</version>
+ </dependency>
+ <dependency>
+ <groupId>exist</groupId>
+ <artifactId>exist-xmldb</artifactId>
+ <version>1.0rc</version>
+ </dependency>
</dependencies>


+ <profiles>
+ <profile>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <id>test</id>
+ <properties>
+ <log4j>test</log4j>
+ </properties>
+ </profile>
+ <profile>
+ <id>production</id>
+ <properties>
+ <log4j>production</log4j>
+ </properties>
+ </profile>
+ </profiles>
+
+
</project>

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupSchedulerAction.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupSchedulerAction.java
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSCleanupSchedulerAction.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -30,7 +30,6 @@

// TODO: run Action should throw an exception
public void runAction() {
-
try {
if(!isInitialized){
// create Service Engine for Cleanup
@@ -51,7 +50,6 @@
} catch (PerfSONARException e) {
logger.error(e);
}
-
}



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-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/LSRegisterServiceEngine.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -307,7 +307,6 @@
}
// get response with success code and key
serviceResponse.setElement(getLSRegisterResponse(metadataId));
-
} // end performAction

} // LSLookupAction

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/servlets/ExistDbInitializerServlet.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/servlets/ExistDbInitializerServlet.java
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/servlets/ExistDbInitializerServlet.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -83,6 +83,8 @@
Collection lsCollection =
colMngmtService.createCollection("ls");
Collection copyCollection = colMngmtService
.createCollection("copy");
+
+ colMngmtService.createCollection("ls/store");

User user = new User(

existDbComponent.getCredential().getUsername(),
@@ -106,7 +108,8 @@

writer.append("DbInitializer - success");

- uploadFile("LSStore.xml", dbPath, lsCollection);
+// uploadFile("LSStore.xml", dbPath, lsCollection);
+
uploadFile("LSStore-control.xml", dbPath,
lsCollection);
uploadFile("LSStore-summary.xml", dbPath,
lsCollection);


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

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-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/MultipleFilesExistDAOImpl.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -1,6 +1,7 @@
package org.perfsonar.service.lookupservice.storage.exist;

import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;

import org.perfsonar.base2.service.exceptions.PerfSONARException;
import org.perfsonar.base2.service.storage.xml.XMLDBResult;
@@ -14,7 +15,7 @@
* Implementation of LookupServiceDAO: eXist HTTP connection using Multiple
* files in separate collections: /store and /control
*
- * @author Maciej Glowiak
+ * @author Maciej Glowiak,Slawomir Trzaszczka
*
*/
public class MultipleFilesExistDAOImpl extends XQueryDAOSupportImpl {
@@ -32,14 +33,10 @@

private static final String LS_STORE_FOOTER = "\n</nmwg:store>";

- private static final String STORE_COLLECTION = "store";
-
-
public MultipleFilesExistDAOImpl() {
super();
}

-
public void putLookupInfo(Metadata m, Data[] d) throws
PerfSONARException {

StringBuffer sb = new StringBuffer();
@@ -69,16 +66,12 @@

sb.append(LS_STORE_FOOTER);

- // System.out.println(sb.toString());
-
// convert to md5
- String file;
+
try {
- file = getStoreFile(m.getId());
- getDataStorage().put(sb.toString(), file,
getDataCredential());
- } catch (Exception e) {
- throw new PerfSONARException("error/encode",
- "Cannot encode metadata ID to URL");
+ uploadStoreFile(md5(m.getId()) + ".xml",
sb.toString());
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
}

}
@@ -88,23 +81,20 @@
int result = 0;

try {
- getDataStorage().delete(getStoreFile(metadataId),
- getDataCredential());
- } catch (PerfSONARException ex) {
- logger.warn(ex);
+ removeFile(md5(metadataId) + ".xml");
+ } catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
}

- String xquery =XQUERY_DECLARE_NAMESPACES+
- " for $i in " +
- "(" +
-
"/nmwg:store[@type='"
+ LS_STORE_CONTROL_COLLECTION_TYPE
+"']/nmwg:metadata[@id='"
+ metadataId + "']"+
- ", "+
-
"/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE+
"']/nmwg:metadata[@id='"
+ metadataId + "']" +
- ")" +
- " return (update delete $i, 'removed') ";
-
+ String xquery = XQUERY_DECLARE_NAMESPACES + " for $i in " +
"("
+ +
"/nmwg:store[@type='"
+ LS_STORE_CONTROL_COLLECTION_TYPE
+ +
"']/nmwg:metadata[@id='"
+ metadataId + "']" + ", "
+ +
"/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE
+ +
"']/nmwg:metadata[@id='"
+ metadataId + "']" + ")"
+ + " return (update delete $i, 'removed') ";
+
XMLDBResult res = performXQuery(xquery);
- result=res.getTotal();
+ result = res.getTotal();

return result;

@@ -112,14 +102,13 @@

private void removeControlElement(String metadataId)
throws PerfSONARException {
- String xquery = DECLARE_NMWG_NAMESPACE+
- " for $meta in
/nmwg:store[@type='LSStore-control']/nmwg:metadata[@id='"+metadataId+"']
\n" +
- " return (update delete $meta)";
-
+ String xquery = DECLARE_NMWG_NAMESPACE
+ + " for $meta in
/nmwg:store[@type='LSStore-control']/nmwg:metadata[@id='"
+ + metadataId + "'] \n" + " return (update
delete $meta)";
+
performXQuery(xquery);
}

-
public int cleanupLookupInfo(long timestamp, long defaultInterval)
throws PerfSONARException {
int result;
@@ -141,7 +130,7 @@
+ " where $ts + $interval < $now\n" +
"return $metaid\n";

XMLDBResult res = performXQuery(xquery);
- result=res.getResults().size();
+ result = res.getResults().size();
for (Element e : res.getResults()) {
String metadataId = e.getText();
removeLookupInfo(metadataId);
@@ -151,8 +140,7 @@
return result;
}

-
- private String md5(String text) throws Exception {
+ private String md5(String text) throws NoSuchAlgorithmException {
MessageDigest md = null;
md = MessageDigest.getInstance("MD5");
md.update(text.getBytes());
@@ -170,14 +158,4 @@
return md5val;
}

- private String getStoreFile(String id) {
- try {
- String file = getDataCollection() + "/" +
STORE_COLLECTION + "/"
- + md5(id) + ".xml";
- return file;
- } catch (Exception ex) {
- return null;
- }
- }
-
}

Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/SummarizationDAOImpl.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/SummarizationDAOImpl.java
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/SummarizationDAOImpl.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -31,11 +31,11 @@
StringBuffer sb = new StringBuffer();

// performance improvement
+// sb.append(LOCK);
sb.append("xmldb:copy('/db/copy/', '/db/ls/',
'LSStore-summary.xml')");
+// sb.append(")");
+ performXQuery(sb.toString());

- getDataStorage().performXQuery(sb.toString(),
getDataCollection(),
- getDataCredential());
-
}

public void putSummaryData(Element m) throws PerfSONARException {
@@ -62,22 +62,18 @@
xmls.append(UPDATE_LSSTORE_SUMMARY);

String query = xmls.toString();
- getDataStorage().performXQuery(query, getDataCollection(),
- getDataCredential());
+ performXQuery(query);
}

public String[] queryIpResults() throws PerfSONARException {

StringBuffer sb = new StringBuffer();

- sb
- .append(" declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\";; \n");
+ sb.append(" declare namespace
nmwg=\"http://ggf.org/ns/nmwg/base/2.0/\";; \n");
sb.append(" for $d in
/nmwg:store[@type='LSStore']/nmwg:data
\n");
sb.append(" let $metaIdRef := data($d/@metadataIdRef) \n");
- sb
- .append(" for $val in
$d/nmwg:metadata/*:subject//*:ifAddress/text() \n");
- sb
- .append(" return if (empty($val)) then $val
else concat($metaIdRef,',',$val) \n");
+ sb.append(" for $val in
$d/nmwg:metadata/*:subject//*:ifAddress/text() \n");
+ sb.append(" return if (empty($val)) then $val else
concat($metaIdRef,',',$val) \n");

return performXQuery(sb.toString()).getTextResults();

@@ -125,7 +121,9 @@
public XMLDBResult getSummaryData() throws PerfSONARException {
StringBuffer sb = new StringBuffer();
sb.append(DECLARE_NMWG_NAMESPACE);
+// sb.append(LOCK);

sb.append("/nmwg:store[@type='LSStore-summary']/nmwg:metadata");
+// sb.append(")");

return performXQuery(sb.toString());
}
@@ -163,8 +161,7 @@
xmls.append(UPDATE_LSSTORE_SUMMARY);

String query = xmls.toString();
- getDataStorage().performXQuery(query, getDataCollection(),
- getDataCredential());
+ performXQuery(query);

}


Modified:
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryDAOSupportImpl.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryDAOSupportImpl.java
2009-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryDAOSupportImpl.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -6,17 +6,22 @@
import org.perfsonar.service.lookupservice.storage.XQueryDAOSupport;

public abstract class XQueryDAOSupportImpl extends CommonExistDAOImpl
implements
- XQueryDAOSupport,LookupServiceDAO {
+ XQueryDAOSupport, LookupServiceDAO {
+
+ public void uploadStoreFile(String name,String content){
+ ExistXmlDb.uploadStoreFile(name, content);
+ }

public XMLDBResult performXQuery(String xquery) throws
PerfSONARException {
-
- XMLDBResult res = getDataStorage().performXQuery(xquery,
- getDataCollection(), getDataCredential());
-
- return res;
-
+ XMLDBResult result=ExistXmlDb.performXQuery(xquery);
+ return result;
}

+
+ public void removeFile(String fileName){
+ ExistXmlDb.removeFile(fileName);
+ }
+
public boolean isDBCollection(String collection) throws
PerfSONARException {

String xquery = DECLARE_NMWG_NAMESPACE + "
count(/nmwg:store[@type='"
@@ -33,7 +38,7 @@
return true;

}
-
+
/**
* Returns pair of numbers separated by space: "#M #D" where #M is
number of
* metadata blocks with specific metadataId, #D is number of related
data
@@ -64,7 +69,7 @@
String result = countLookupInfo(metadataId);
return !("0 0".equals(result));
}
-
+
@Override
public void setControlParameter(String metadataId, String parameter,
String value) throws PerfSONARException {

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-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/storage/exist/XQueryExistDAOImpl.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -26,6 +26,7 @@
protected static final String UPDATE_INSERT = " update insert ";

protected static final String UPDATE_INTO = " into ";
+

protected static final String UPDATE_LSSTORE = "
/nmwg:store[@type='"
+ LS_STORE_COLLECTION_TYPE + "'] ";

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-11-24 12:42:34 UTC (rev 5354)
+++
branches/new-structure-with-base2/ps-mdm-ls/src/main/java/org/perfsonar/service/lookupservice/summarization/LSSummarySynchronizationAction.java
2009-11-25 09:31:47 UTC (rev 5355)
@@ -63,7 +63,6 @@

@Override
public void runAction() {
-
if(!summarizationInProgress){
int nrOfChanges = 0;


Added:
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/production/log4j.properties


Property changes on:
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/production/log4j.properties
___________________________________________________________________
Name: svn:executable
+ *

Added:
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/test/log4j.properties


Property changes on:
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j/test/log4j.properties
___________________________________________________________________
Name: svn:executable
+ *

Deleted:
branches/new-structure-with-base2/ps-mdm-ls/src/main/resources/log4j.properties



  • perfsonar: r5355 - in branches/new-structure-with-base2/ps-mdm-ls: . contrib/SOAPRequestAuxilary/inputs contrib/SOAPRequestAuxilary/src/pl/psnc contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/auxiliary contrib/SOAPRequestAuxilary/src/pl/psnc/trzaszczka/stressTests src/main/java/org/perfsonar/service/lookupservice src/main/java/org/perfsonar/service/lookupservice/servlets src/main/java/org/perfsonar/service/lookupservice/storage/exist src/main/java/org/perfsonar/service/lookupservice/summarization src/main/resources src/main/resources/log4j src/main/resources/log4j/production src/main/resources/log4j/test, svnlog, 11/25/2009

Archive powered by MHonArc 2.6.16.

Top of Page