perfsonar-dev - r1916 - trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
Subject: perfsonar development work
List archive
r1916 - trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
Chronological Thread
- From:
- To:
- Subject: r1916 - trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator
- Date: Tue, 16 Jan 2007 08:43:02 -0500
Author: roman
Date: 2007-01-16 08:43:01 -0500 (Tue, 16 Jan 2007)
New Revision: 1916
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
Log:
Update of xquery statements for fetching the data of utilization and L2 path
status metrics.
Each reference to the value of attribute should be put in fn:data. Because it
was missing in few places in xquery statement
for L2 path status metric some test requests migth didn't work for newer
version of eXist db.
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
2007-01-16 13:37:43 UTC (rev 1915)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/L2PathStatusQueryGenerator.java
2007-01-16 13:43:01 UTC (rev 1916)
@@ -128,7 +128,7 @@
+ " for $k in $metaids
\n"
+ " let $d :=
\n"
+ " for $l in //nmwg:data
\n"
- + " where $l/@metadataIdRef = $k
\n"
+ + " where fn:data($l/@metadataIdRef) = $k
\n"
+ " return $l
\n"
+ " return $d
\n"
+ "
\n"
@@ -175,8 +175,8 @@
+ " let $nodeMetadata :=
\n"
+ " if ($linkMetadata != '') then
\n"
+ " for $n in //nmwg:metadata
\n"
- + " where $n/nmwg:subject/nmwgtopo3:node/@id =
\n"
- + "
$linkMetadata/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef
\n"
+ + " where
fn:data($n/nmwg:subject/nmwgtopo3:node/@id) =
\n"
+ + "
fn:data($linkMetadata/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef)
\n"
+ " return $n
\n"
+ " else
\n"
+ " ''
\n"
@@ -189,7 +189,7 @@
+ " for $k in $metaids
\n"
+ " let $d :=
\n"
+ " for $l in //nmwg:data
\n"
- + " where $l/@metadataIdRef = $k
\n"
+ + " where fn:data($l/@metadataIdRef) = $k
\n"
+ " return $l
\n"
+ " return $d
\n"
+ "
\n"
@@ -233,20 +233,20 @@
node1 = " let $node1_metadata := '' \n"
+ " let $node1_id := '' ";
else
- node1 = " let $node1_metadata :=
\n"
- + " for $i in //nmwg:metadata
\n"
- + " where 1
\n"
+ node1 = " let $node1_metadata :=
\n"
+ + " for $i in //nmwg:metadata
\n"
+ + " where 1
\n"
+ (node1Name != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + node1Name + "') \n" : "")
+ (node1Country != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + node1Country + "') \n" : "")
+ (node1City != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + node1City + "') \n" : "")
+ (node1Institution != "" ? " and
fn:lower-case($i/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + node1Institution + "') \n" : "")
- + " return $i
\n"
- + "
\n"
- + " let $node1_id :=
\n"
- + " if ($node1_metadata) then
\n"
- + "
$node1_metadata/nmwg:subject/nmwgtopo3:node/@id \n"
- + " else
\n"
- + " ''
\n";
+ + " return $i
\n"
+ + "
\n"
+ + " let $node1_id :=
\n"
+ + " if ($node1_metadata) then
\n"
+ + "
fn:data($node1_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ + " else
\n"
+ + " ''
\n";
String node2 = null;
@@ -254,20 +254,20 @@
node2 = " let $node2_metadata := '' \n"
+ " let $node2_id := '' ";
else
- node2 = " let $node2_metadata :=
\n"
- + " for $j in //nmwg:metadata
\n"
- + " where 1
\n"
+ node2 = " let $node2_metadata :=
\n"
+ + " for $j in //nmwg:metadata
\n"
+ + " where 1
\n"
+ (node2Name != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:name) =
fn:lower-case('" + node2Name + "') \n" : "")
+ (node2Country != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:country) =
fn:lower-case('" + node2Country + "') \n" : "")
+ (node2City != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:city) =
fn:lower-case('" + node2City + "') \n" : "")
+ (node2Institution != "" ? " and
fn:lower-case($j/nmwg:subject/nmwgtopo3:node/nmwgtopo3:institution) =
fn:lower-case('" + node2Institution + "') \n" : "")
- + " return $j
\n"
- + "
\n"
- + " let $node2_id :=
\n"
- + " if ($node2_metadata) then
\n"
- + "
$node2_metadata/nmwg:subject/nmwgtopo3:node/@id \n"
- + " else
\n"
- + " ''
\n";
+ + " return $j
\n"
+ + "
\n"
+ + " let $node2_id :=
\n"
+ + " if ($node2_metadata) then
\n"
+ + "
fn:data($node2_metadata/nmwg:subject/nmwgtopo3:node/@id) \n"
+ + " else
\n"
+ + " ''
\n";
xQuery = "
\n "
@@ -278,20 +278,20 @@
+ " let $linkMetadata :=
\n"
+ " if ($node1_id != '' and $node2_id != '') then
\n"
+ " for $k in //nmwg:metadata
\n"
- + " where
$k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef = $node1_id
\n"
- + " and
$k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef = $node2_id
\n"
+ + " where
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node1_id
\n"
+ + " and
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node2_id
\n"
+ " and
$k/nmwg:parameters/nmwg:parameter[(text()='Path.Status' and
@name='supportedEventType') \n"
+ " or
(@value='Path.Status' and @name='supportedEventType')] \n"
+ " return $k
\n"
+ " else if ($node1_id != '' and $node2_id = '') then
\n"
+ " for $k in //nmwg:metadata
\n"
- + " where
$k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef = $node1_id
\n"
+ + " where
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node1_id
\n"
+ " and
$k/nmwg:parameters/nmwg:parameter[(text()='Path.Status' and
@name='supportedEventType') \n"
+ " or
(@value='Path.Status' and @name='supportedEventType')] \n"
+ " return $k
\n"
+ " else if ($node1_id = '' and $node2_id != '') then
\n"
+ " for $k in //nmwg:metadata
\n"
- + " where
$k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef = $node2_id
\n"
+ + " where
fn:data($k/nmwg:subject/nmtl2:link/nmwgtopo3:node/@nodeIdRef) = $node2_id
\n"
+ " and
$k/nmwg:parameters/nmwg:parameter[(text()='Path.Status' and
@name='supportedEventType') \n"
+ " or
(@value='Path.Status' and @name='supportedEventType')] \n"
+ " return $k
\n"
@@ -306,7 +306,7 @@
+ " for $k in $metaids
\n"
+ " let $d :=
\n"
+ " for $l in //nmwg:data
\n"
- + " where $l/@metadataIdRef = $k
\n"
+ + " where fn:data($l/@metadataIdRef) = $k
\n"
+ " return $l
\n"
+ " return $d
\n"
+ "
\n"
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-01-16 13:37:43 UTC (rev 1915)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator/UtilizationQueryGenerator.java
2007-01-16 13:43:01 UTC (rev 1916)
@@ -184,21 +184,21 @@
xQuery += "\n"
- + " return $i \n"
- + " \n"
- + " let $metaids := \n"
- + " for $j in $res \n"
- + " return fn:data($j/@id) \n"
- + " \n"
- + " let $datas := \n"
- + " for $k in $metaids \n"
- + " let $d := \n"
- + " for $l in //nmwg:data \n"
- + " where $l/@metadataIdRef = $k \n"
- + " return $l \n"
- + " return $d \n"
- + " \n"
- + " return ($res, $datas) \n";
+ + " return $i \n"
+ + " \n"
+ + " let $metaids := \n"
+ + " for $j in $res \n"
+ + " return fn:data($j/@id) \n"
+ + " \n"
+ + " let $datas := \n"
+ + " for $k in $metaids \n"
+ + " let $d := \n"
+ + " for $l in //nmwg:data \n"
+ + " where fn:data($l/@metadataIdRef) = $k \n"
+ + " return $l \n"
+ + " return $d \n"
+ + " \n"
+ + " return ($res, $datas) \n";
//logger.debug(
- r1916 - trunk/perfsonar/src/org/perfsonar/service/measurementArchive/metadataConfig/queryGenerator, svnlog, 01/16/2007
Archive powered by MHonArc 2.6.16.