Skip to Content.
Sympa Menu

perfsonar-dev - [pS-dev] [GEANT/SA2/ps-java-services] r5828 - trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsona r/service/measurementArchive/rrdType/storage/sql

Subject: perfsonar development work

List archive

[pS-dev] [GEANT/SA2/ps-java-services] r5828 - trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsona r/service/measurementArchive/rrdType/storage/sql


Chronological Thread 
  • From:
  • To:
  • Subject: [pS-dev] [GEANT/SA2/ps-java-services] r5828 - trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsona r/service/measurementArchive/rrdType/storage/sql
  • Date: Wed, 31 Aug 2011 15:56:07 +0100

Author: psnc.pikusa
Date: 2011-08-31 15:56:07 +0100 (Wed, 31 Aug 2011)
New Revision: 5828

Modified:

trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/MysqlMetadataStorageDAOImpl.java
Log:
SetupDataKeyRequest changes developed

Modified:
trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/MysqlMetadataStorageDAOImpl.java
===================================================================
---
trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/MysqlMetadataStorageDAOImpl.java
2011-08-31 14:55:24 UTC (rev 5827)
+++
trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsonar/service/measurementArchive/rrdType/storage/sql/MysqlMetadataStorageDAOImpl.java
2011-08-31 14:56:07 UTC (rev 5828)
@@ -20,7 +20,8 @@
import org.perfsonar.base2.xml.nmwg.Metadata;
import
org.perfsonar.service.measurementArchive.rrdType.storage.MetadataStorageDAO;
import
org.perfsonar.service.measurementArchive.rrdType.storage.MetadataStorageDAOFactory;
-import
org.perfsonar.service.measurementArchive.rrdType.storage.persistence.MetadaKeyRequestResponse;
+import
org.perfsonar.service.measurementArchive.rrdType.storage.persistence.MetadaKeyResponse;
+import
org.perfsonar.service.measurementArchive.rrdType.storage.persistence.SetupDataKeyResponse;
import
org.perfsonar.service.measurementArchive.rrdType.storage.persistence.entity.Interfaces;
import
org.perfsonar.service.measurementArchive.rrdType.storage.sql.query.QueryGenerator;

@@ -33,6 +34,7 @@
//private static final String PASSWORD = "@jawpcss$";

protected EntityManager em;
+ protected QueryGenerator qg = new QueryGenerator();

@Override
public void destroy() throws PerfSONARException {
@@ -80,6 +82,26 @@
@Override
public Collection<Element> fetch(Element request) throws
PerfSONARException {
// TODO Auto-generated method stub
+ checkMetadataCorectness((Message)request);
+
+ if (!(request instanceof Message)){
+ throw new PerfSONARException(
+ "parse",
+ "Object [" + request.getClass() + "] is not a valid Message
["
+ + Message.class
+ + "] element.");
+ }
+
+ Message message = (Message)request;
+ SetupDataKeyResponse sdkr = new SetupDataKeyResponse();
+
+ for (Metadata metadata : message.getMetadataCollection()) {
+ Query query = qg.getQuery(em, metadata,
Interfaces.TABLE, Interfaces.class);
+
+ // sdkr.fetchMetadata(metadata,
query.getResultList().iterator().next());
+ }
+
+
return null;
}

@@ -92,37 +114,27 @@


List<Interfaces> resultList =
(List<Interfaces>)em.createNamedQuery(Interfaces.ALL).getResultList();
- MetadaKeyRequestResponse mKRR = new MetadaKeyRequestResponse();
+ MetadaKeyResponse mKRR = new MetadaKeyResponse();

return mKRR.fetchMetadataMessage(resultList.iterator());
}

@Override
public String rawFetch(Element request) throws PerfSONARException {
+
long t1 = System.currentTimeMillis();
-
checkMetadataCorectness((Message)request);
+ Metadata metadata =
(Metadata)(((Message)request).getMetadataCollection().iterator().next());

- Map<String, String> parametersMap = new HashMap<String,
String>();
- QueryGenerator qg = new QueryGenerator();
-
- parametersMap =
qg.getQuery((Metadata)(((Message)request).getMetadataCollection().iterator().next()),
Interfaces.TABLE);
- logger.info("QUERY: " + parametersMap.get("query"));
+ Query query = qg.getQuery(em, metadata, Interfaces.TABLE,
Interfaces.class);

- Query query =
em.createNativeQuery(parametersMap.get("query"), Interfaces.class);
- for (String parameter : parametersMap.keySet()) {
- if(!parameter.equals("query"))
- query.setParameter(parameter,
parametersMap.get(parameter));
- }
- MetadaKeyRequestResponse mKRR = new
MetadaKeyRequestResponse();
+ MetadaKeyResponse mKRR = new MetadaKeyResponse();

+ String result =
mKRR.fetchMetadataMessage(query.getResultList().iterator());

- String r =
mKRR.fetchMetadataMessage(query.getResultList().iterator());
-
-
long t2 = System.currentTimeMillis();
logger.info("TIME of rawFetch: " + (t2 - t1));

- return r;
+ return result;

}




  • [pS-dev] [GEANT/SA2/ps-java-services] r5828 - trunk/perfsonar-java-rrd-sql-ma/src/main/java/org/perfsona r/service/measurementArchive/rrdType/storage/sql, svn-noreply, 08/31/2011

Archive powered by MHonArc 2.6.16.

Top of Page