Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2604 - in branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType: . fetch

Subject: perfsonar development work

List archive

perfsonar: r2604 - in branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType: . fetch


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2604 - in branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType: . fetch
  • Date: Wed, 8 Aug 2007 09:13:42 -0400

Author: roman
Date: 2007-08-08 09:13:42 -0400 (Wed, 08 Aug 2007)
New Revision: 2604

Added:

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/DiscardsResponseGenerator.java

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ErrorsResponseGenerator.java

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/GenericResponseGenerator.java

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ResponseGenerator.java

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ResponseGeneratorFactory.java

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/UtilizationResponseGenerator.java
Modified:

branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java
Log:

support of namespaces of datum elements which are tied to eventType values



Modified:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java
===================================================================
---
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java
2007-08-08 12:36:42 UTC (rev 2603)
+++
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/RRDStorageManager.java
2007-08-08 13:13:42 UTC (rev 2604)
@@ -35,6 +35,9 @@
import java.util.Iterator;
import java.util.Vector;

+import
org.perfsonar.service.measurementArchive.rrdType.fetch.ResponseGeneratorFactory;
+import
org.perfsonar.service.measurementArchive.rrdType.fetch.ResponseGenerator;
+import
org.perfsonar.service.measurementArchive.rrdType.fetch.GenericResponseGenerator;


/**
@@ -327,6 +330,8 @@
Parameter dataSource =
key.getParameterByName("http://ggf.org/ns/nmwg/base/2.0/";, "dataSource");
Parameter valueUnits =
key.getParameterByName("http://ggf.org/ns/nmwg/base/2.0/";, "valueUnits");

+ Parameter eventType =
key.getParameterByName("http://ggf.org/ns/nmwg/base/2.0/";, "eventType");
+
Parameter dataSourceStep =
key.getParameterByName("http://ggf.org/ns/nmwg/base/2.0/";, "dataSourceStep");
Parameter dataSourceType =
key.getParameterByName("http://ggf.org/ns/nmwg/base/2.0/";, "dataSourceType");
Parameter dataSourceHeartbeat =
key.getParameterByName("http://ggf.org/ns/nmwg/base/2.0/";,
"dataSourceHeartbeat");
@@ -343,6 +348,8 @@
String _dataSource = null;
String _valueUnits = null;

+ String _eventType = null;
+
String _dataSourceStep = null;
String _dataSourceType = null;
String _dataSourceHeartbeat = null;
@@ -383,6 +390,14 @@
_valueUnits = "unknown";
}

+ try {
+ _eventType = eventType.getParameterValue();
+ if (_eventType.trim().equals("")) _eventType = null;
+ } catch (Exception ex) {
+ _eventType = null;
+ }
+
+
_file = file.getParameterValue();
_dataSource = dataSource.getParameterValue();

@@ -473,7 +488,7 @@
__endTime,
__resolution);

- Data data = getRRDColumn(fdata, _dataSource, _valueUnits);
+ Data data = getRRDColumn(fdata, _dataSource, _valueUnits,
_eventType);

Parameters parameters = new Parameters();

@@ -606,16 +621,19 @@
* @author romradz
* @author mac
*/
- private Data getRRDColumn(FetchData data, String dataSource, String
valueUnits)
+ private Data getRRDColumn(FetchData fetchData,
+ String dataSource,
+ String valueUnits,
+ String eventType)
throws PerfSONARException {

- int rows = data.getRowCount();
- int cols = data.getColCount();
+ int rows = fetchData.getRowCount();
+ int cols = fetchData.getColCount();

//which data source? (-1 = unknown)
int ds = -1;
for (int i = 0; (i < cols) && (ds == -1); i++) {
- if (data.getColName(i).equalsIgnoreCase(dataSource)) ds=i;
+ if (fetchData.getColName(i).equalsIgnoreCase(dataSource)) ds = i;
}

//DEBUG
@@ -623,24 +641,18 @@

if (ds > -1) {

- Data _data = new Data();
+ ResponseGenerator responseGenerator = null;
+ Data data = null;

- for (int i = 0; i < rows; i++) {
+ if (eventType == null) {
+ responseGenerator = new GenericResponseGenerator();
+ } else {
+ responseGenerator =
ResponseGeneratorFactory.getResponseGenerator(eventType);
+ }
+ data = responseGenerator.getResponse(fetchData, ds, rows,
valueUnits);

- if (i + 1 == rows) break;
- Datum datum = new Datum();
- datum.setTimeValue(Long.toString(data.getTimestamp(i + 1)));
- datum.setTimeType("unix");
- datum.setValue(Double.toString(data.getValue(i, ds)));
- datum.setValueUnits(valueUnits);
- _data.addChild(datum);
+ return data;

- }
- //DEBUG
- //System.out.println(rows+" rows read");
-
- return _data;
-
} else {

throw new PerfSONARException(

Added:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/DiscardsResponseGenerator.java


Property changes on:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/DiscardsResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ErrorsResponseGenerator.java


Property changes on:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ErrorsResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/GenericResponseGenerator.java


Property changes on:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/GenericResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ResponseGenerator.java


Property changes on:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ResponseGeneratorFactory.java


Property changes on:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/ResponseGeneratorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/UtilizationResponseGenerator.java


Property changes on:
branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/fetch/UtilizationResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native



  • perfsonar: r2604 - in branches/new-structure/trunk/geant2_java-rrd-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType: . fetch, svnlog, 08/08/2007

Archive powered by MHonArc 2.6.16.

Top of Page