Skip to Content.
Sympa Menu

perfsonar-dev - r1457 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: rrdType storageManager storageManager/eventTypeConfig storageManager/queryGenerator storageManager/responseGenerator

Subject: perfsonar development work

List archive

r1457 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: rrdType storageManager storageManager/eventTypeConfig storageManager/queryGenerator storageManager/responseGenerator


Chronological Thread 
  • From:
  • To:
  • Subject: r1457 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: rrdType storageManager storageManager/eventTypeConfig storageManager/queryGenerator storageManager/responseGenerator
  • Date: Wed, 19 Jul 2006 09:33:01 -0400

Author: roman
Date: 2006-07-19 09:33:01 -0400 (Wed, 19 Jul 2006)
New Revision: 1457

Added:

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventType.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventTypeConfiguration.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventTypeConfigurationComponent.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/L2PathStatusResponseGenerator.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/ResponseGenerator.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/ResponseGeneratorFactory.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/UtilizationResponseGenerator.java
Removed:

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/MetadataQueries.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/MetadataQueryConfigurationComponent.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/queryConfig/
Modified:

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java

trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/queryGenerator/MetadataQueryGeneratorFactory.java
Log:
Improved support for L2 path status and also for other metrics. Now it's much
easier to generate different response messages
for different metrics (eventTypes).

Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2006-07-18 18:59:00 UTC (rev 1456)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/rrdType/RRDTypeMAServiceEngine.java
2006-07-19 13:33:01 UTC (rev 1457)
@@ -316,7 +316,6 @@

}

-
return response;

}
@@ -369,6 +368,13 @@

Message msg = metadataConfig.fetch(query);

+ //logger.debug(
+ // "RRDTypeMAServiceEngine._getKey: "
+ // + "found in metadata configuration: "
+ // + msg);
+
+ getEventType(metadata, msg);
+
for (Object m : msg.getMetadataMap().values())
message.addChild((Metadata)m);

@@ -420,6 +426,8 @@
query.addChild(metadata);

Message msg = metadataConfig.fetch(query);
+
+ getEventType(metadata, msg);

for (Object m : msg.getMetadataMap().values())
message.addChild((Metadata)m);
@@ -731,5 +739,28 @@



+ //---------------------------------- private methods

+
+
+ private String getEventType(Metadata metadata, Message msg) {
+
+ String eventType = null;
+ try {
+ eventType = metadata.getEventType().getEventType();
+ } catch (Exception ex1) {
+ ;
+ }
+
+ for (Object d : msg.getDataMap().values()) {
+ Key key = ((Data)d).getKey();
+ key.addParameter("eventType", eventType);
+ }
+
+ return eventType;
+
+ }
+
+
+
} //RRDTypeMAServiceEngine

Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
2006-07-18 18:59:00 UTC (rev 1456)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/SQLStorageManager.java
2006-07-19 13:33:01 UTC (rev 1457)
@@ -42,6 +42,9 @@
import org.perfsonar.service.commons.exceptions.RequestException;
import org.perfsonar.service.commons.exceptions.SystemException;

+import
org.perfsonar.service.measurementArchive.storageManager.responseGenerator.ResponseGenerator;
+import
org.perfsonar.service.measurementArchive.storageManager.responseGenerator.ResponseGeneratorFactory;
+
/**
* SQL storage manager responsible for accessing an sql database.
*
@@ -162,7 +165,7 @@

}

- Data data = new Data();
+ Data data = null;


// ibatis action
@@ -198,49 +201,13 @@
logger.debug("SQLStorageManager.fetch: number of fetched
rows: "
+ resultList.size());

- for (int i = 0; i < resultList.size(); i++) {
+ String eventType = (String)ibatisParams.get("eventType");
+ logger.debug("SQLStorageManager.fetch: EventType: " +
eventType);
+
+ ResponseGenerator responseGenerator =
+
ResponseGeneratorFactory.getResponseGenerator(eventType);
+ data = responseGenerator.getResponse(resultList);

- Datum datum = new Datum();
-
- Map resultMap = (Map) resultList.get(i);
- Collection<String> kCollection =
((Map)resultList.get(i)).keySet();
-
- for (String column : kCollection) {
-
- Object value = resultMap.get(column);
- String className = value.getClass().getName();
- String strValue = null;
-
- if (className.equals("java.lang.Float"))
- strValue = Float.toString((Float) value);
- if (className.equals("java.lang.Double"))
- strValue = Double.toString((Double) value);
- else if (className.equals("java.lang.Integer"))
- strValue = Integer.toString((Integer) value);
- else if (className.equals("java.lang.Long"))
- strValue = Long.toString((Long) value);
- else if (className.equals("java.lang.Date"))
- strValue = ((Date) value).toString();
- else if (className.equals("java.lang.String"))
- strValue = (String) value;
-
- if (strValue != null) {
-
- if (column.equals("value"))
datum.setValue(strValue);
- else if (column.equals("valueUnits"))
datum.setValueUnits(strValue);
- else if (column.equals("timeValue"))
datum.setTimeValue(strValue);
-
- //logger.debug("SQLStorageManager.fetch: "
- // + "column: " + column + ", value: " +
strValue );
-
- }
-
- }
-
- data.addChild(datum);
-
- }
-
} catch (Exception ioex) {

logger.debug("SQLStorageManager.fetch: Unable to fetch data:
"

Copied:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig
(from rev 1451,
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/queryConfig)

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventType.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventType.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventTypeConfiguration.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventTypeConfiguration.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventTypeConfigurationComponent.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/EventTypeConfigurationComponent.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Deleted:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/MetadataQueries.java

Deleted:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/eventTypeConfig/MetadataQueryConfigurationComponent.java

Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/queryGenerator/MetadataQueryGeneratorFactory.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/queryGenerator/MetadataQueryGeneratorFactory.java
2006-07-18 18:59:00 UTC (rev 1456)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/queryGenerator/MetadataQueryGeneratorFactory.java
2006-07-19 13:33:01 UTC (rev 1457)
@@ -12,8 +12,8 @@

import org.perfsonar.service.commons.exceptions.SystemException;

-import
org.perfsonar.service.measurementArchive.storageManager.queryConfig.MetadataQuery;
-import
org.perfsonar.service.measurementArchive.storageManager.queryConfig.MetadataQueryConfigurationComponent;
+import
org.perfsonar.service.measurementArchive.storageManager.eventTypeConfig.EventType;
+import
org.perfsonar.service.measurementArchive.storageManager.eventTypeConfig.EventTypeConfigurationComponent;


/**
@@ -31,7 +31,7 @@
* in order to fetch relevant metadata configuration.
*
*/
- public static MetadataQueryGenerator getMetadataQueryGenerator(String
eventType)
+ public static MetadataQueryGenerator getMetadataQueryGenerator(String
eventTypeName)
throws SystemException {


@@ -40,28 +40,28 @@
getInstance().
getComponent(ComponentNames.LOGGER);

- MetadataQueryConfigurationComponent metadataQueryConfiguration =
- (MetadataQueryConfigurationComponent)
+ EventTypeConfigurationComponent eventTypeConfigurationComponent =
+ (EventTypeConfigurationComponent)
AuxiliaryComponentManager.
getInstance().
-
getComponent("ma_metadata_query_mapper");
+ getComponent("eventType_config");


- MetadataQuery metadataQuery =
- metadataQueryConfiguration.getMetadataQuery(eventType);
+ EventType eventType =
+ eventTypeConfigurationComponent.getEventType(eventTypeName);

- if (metadataQuery == null)
+ if (eventType == null)
throw new SystemException(
"error.ma.query",

"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "
- + "eventType " + eventType + " is not supported");
+ + "eventType " + eventTypeName + " is not supported");


- String className = metadataQuery.getClassName();
+ String className = eventType.getMetadataQueryGenerator();

logger.debug(

"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "
- + "class name for eventType (" + eventType + "): "
+ + "class name for eventType (" + eventTypeName + "):
"
+ className);

if (className == null || className.trim().equals(""))
@@ -69,7 +69,7 @@
"error.ma.metadata_query_mapping_configuration",

"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "
+ "Could not find class name for eventType "
- + eventType);
+ + eventTypeName);


MetadataQueryGenerator metadataQueryGenerator = null;
@@ -101,12 +101,12 @@
logger.error(

"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "
+ "Could not create a metadataQueryGenerator object for "
- + "eventType: " + eventType);
+ + "eventType: " + eventTypeName);
throw new SystemException(
"error.ma.metadata_query_mapping_configuration",

"MetadataQueryGeneratorFactory.getMetadataQueryGenerator: "
+ "Could not create a metadataQueryGenerator for "
- + "eventType: " + eventType);
+ + "eventType: " + eventTypeName);

}


Added:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/L2PathStatusResponseGenerator.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/L2PathStatusResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/ResponseGenerator.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/ResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/ResponseGeneratorFactory.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/ResponseGeneratorFactory.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native

Added:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/UtilizationResponseGenerator.java


Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementArchive/storageManager/responseGenerator/UtilizationResponseGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native



  • r1457 - in trunk/perfsonar/src/org/perfsonar/service/measurementArchive: rrdType storageManager storageManager/eventTypeConfig storageManager/queryGenerator storageManager/responseGenerator, svnlog, 07/19/2006

Archive powered by MHonArc 2.6.16.

Top of Page