perfsonar-dev - perfsonar: r4111 - in trunk/geant2-java-rrd-ma: ant conf samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType
Subject: perfsonar development work
List archive
perfsonar: r4111 - in trunk/geant2-java-rrd-ma: ant conf samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4111 - in trunk/geant2-java-rrd-ma: ant conf samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType
- Date: Thu, 3 Jul 2008 09:15:47 -0400
Author: roman
Date: 2008-07-03 09:15:46 -0400 (Thu, 03 Jul 2008)
New Revision: 4111
Added:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-random-fetch-test.xml
Modified:
trunk/geant2-java-rrd-ma/ant/test-targets.xml
trunk/geant2-java-rrd-ma/conf/eventType-map.xml
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
Log:
New test that fetches data from random rrd file added.
request:
<nmwg:message type="EchoRequest"
id="id1"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
<nmwg:metadata id="meta">
<nmwg:eventType>http://schemas.perfsonar.net/tools/admin/echo/2.0/random-fetch-test</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="data" metadataIdRef="meta"/>
</nmwg:message>
example response:
<nmwg:message id="id1_resp" messageIdRef="id1" type="EchoResponse"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/">
<nmwg:metadata id="1">
<nmwg:key id="localhost.-7bfb0349:11ae90927b2:-7ffe">
<nmwg:parameters id="localhost.-7bfb0349:11ae90927b2:-7ffd">
<nmwg:parameter name="dataSource">inoctets</nmwg:parameter>
<nmwg:parameter
name="dataSourceMaxValue">10000000</nmwg:parameter>
<nmwg:parameter name="dataSourceStep">300</nmwg:parameter>
<nmwg:parameter
name="file">/home/romradz/Dev/perfsonar/trunk-20080702/geant2-java-rrd-ma/samples/rrd/test.rrd</nmwg:parameter>
<nmwg:parameter name="dataSourceMinValue">0</nmwg:parameter>
<nmwg:parameter
name="eventType">http://ggf.org/ns/nmwg/characteristic/utilization/2.0</nmwg:parameter>
<nmwg:parameter
name="dataSourceType">ABSOLUTE</nmwg:parameter>
<nmwg:parameter
name="dataSourceHeartbeat">400</nmwg:parameter>
<nmwg:parameter name="valueUnits">Bps</nmwg:parameter>
</nmwg:parameters>
</nmwg:key>
</nmwg:metadata>
<nmwg:data id="localhost.-7bfb0349:11ae90927b2:-7fee" metadataIdRef="1">
<netutil:datum timeType="unix" timeValue="1215004200"
value="NaN" valueUnits="Bps"
xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/"/>
<netutil:datum timeType="unix" timeValue="1215004500"
value="NaN" valueUnits="Bps"
xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/"/>
(...)
<netutil:datum timeType="unix" timeValue="1215090600"
value="NaN" valueUnits="Bps"
xmlns:netutil="http://ggf.org/ns/nmwg/characteristic/utilization/2.0/"/>
<nmwg:parameters id="localhost.-7bfb0349:11ae90927b2:-7fef">
<nmwg:parameter name="dataSourceMaxValue" value="10000000"/>
<nmwg:parameter name="dataSourceStep" value="300"/>
<nmwg:parameter name="dataSourceMinValue" value="0"/>
<nmwg:parameter name="dataSourceType" value="ABSOLUTE"/>
<nmwg:parameter name="dataSourceHeartbeat" value="400"/>
</nmwg:parameters>
</nmwg:data>
</nmwg:message>
Modified: trunk/geant2-java-rrd-ma/ant/test-targets.xml
===================================================================
--- trunk/geant2-java-rrd-ma/ant/test-targets.xml 2008-07-03 11:31:29
UTC (rev 4110)
+++ trunk/geant2-java-rrd-ma/ant/test-targets.xml 2008-07-03 13:15:46
UTC (rev 4111)
@@ -65,8 +65,20 @@
<arg value="${basedir}/samples/requests/response-1-xmldb-content.xml"/>
</java>
</target>
-
+
+ <target name="echo-random-fetch-test"
+ depends="init-test">
+ <java classname="org.perfsonar.client.testHarness.SOAPClient"
+ classpathref="classpath"
+ fork="true">
+ <arg value="${ma.local}"/>
+ <arg
value="${basedir}/samples/requests/EchoRequest-random-fetch-test.xml"/>
+ <arg value="${basedir}/samples/requests/response-1-random-fetch.xml"/>
+ </java>
+ </target>
+
+
<target name="lookup-info-test"
depends="init-test">
<java classname="org.perfsonar.client.testHarness.SOAPClient"
Modified: trunk/geant2-java-rrd-ma/conf/eventType-map.xml
===================================================================
--- trunk/geant2-java-rrd-ma/conf/eventType-map.xml 2008-07-03 11:31:29
UTC (rev 4110)
+++ trunk/geant2-java-rrd-ma/conf/eventType-map.xml 2008-07-03 13:15:46
UTC (rev 4111)
@@ -35,4 +35,9 @@
<metadataQueryGenerator>org.perfsonar.service.measurementArchive.metadataConfig.queryGenerator.XmlDbContentTestQueryGenerator</metadataQueryGenerator>
</eventType>
+ <eventType>
+
<name>http://schemas.perfsonar.net/tools/admin/echo/2.0/random-fetch-test</name>
+
<metadataQueryGenerator>org.perfsonar.service.measurementArchive.metadataConfig.queryGenerator.RandomFetchTestQueryGenerator</metadataQueryGenerator>
+ </eventType>
+
</eventType-config>
Added:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-random-fetch-test.xml
Property changes on:
trunk/geant2-java-rrd-ma/samples/requests/EchoRequest-random-fetch-test.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2008-07-03 11:31:29 UTC (rev 4110)
+++
trunk/geant2-java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2008-07-03 13:15:46 UTC (rev 4111)
@@ -92,6 +92,7 @@
public static final String ECHO_XMLDB_ACCESS_TEST_NAMESPACE =
"http://schemas.perfsonar.net/tools/admin/echo/2.0/xmldb-access-test";
public static final String ECHO_XMLDB_CONTENT_TEST_NAMESPACE =
"http://schemas.perfsonar.net/tools/admin/echo/2.0/xmldb-content-test";
+ public static final String ECHO_RANDOM_FETCH_TEST_NAMESPACE =
"http://schemas.perfsonar.net/tools/admin/echo/2.0/random-fetch-test";
// ---------------------------------- constructors
@@ -912,6 +913,8 @@
if (eventTypeStr.equals(ECHO_XMLDB_ACCESS_TEST_NAMESPACE)
|| eventTypeStr.equals(ECHO_XMLDB_CONTENT_TEST_NAMESPACE))
response = executeXmlDBSimpleTest(request);
+ else if (eventTypeStr.equals(ECHO_RANDOM_FETCH_TEST_NAMESPACE))
+ response = executeRandomFetchTest(request);
else
return generateResultCodeResponse(
"error.request", "This eventType in echo request is not
supported");
@@ -934,6 +937,35 @@
}
+ protected Message executeRandomFetchTest(Message request) throws
PerfSONARException {
+
+ Message keyMessage = metadataConfig.fetch(request);
+ Data keyData = null;
+ try {
+ keyData = keyMessage.getDataArray()[0];
+ } catch (Exception ex) {
+ return generateResultCodeResponse(
+ "error.test", "No data elements in the metadata
configuration");
+ }
+ Key key = keyData.getKey();
+ if (key == null)
+ return generateResultCodeResponse("error.test",
+ "No key in data element with
id='"
+ + keyData.getId()
+ + "' in the metadata
configuration");
+
+ Metadata metadata = new Metadata();
+ metadata.setKey(key);
+ Data data = new Data();
+ data.setMetadataIdRef(metadata.getId());
+ Message dataRequest = new Message();
+ dataRequest.setMetadata(metadata);
+ dataRequest.setData(data);
+
+ return getData(dataRequest);
+ }
+
+
/**
* Method used by SQL-MA to store dynamic metadata keys.
*
- perfsonar: r4111 - in trunk/geant2-java-rrd-ma: ant conf samples/requests src/main/java/org/perfsonar/service/measurementArchive/rrdType, svnlog, 07/03/2008
Archive powered by MHonArc 2.6.16.