[metcat] r196 committed - java docs updated

1 view
Skip to first unread message

metcat.apach...@codespot.com

unread,
Aug 29, 2012, 4:52:37 AM8/29/12
to metca...@googlegroups.com
Revision: 196
Author: tobha...@gmail.com
Date: Wed Aug 29 01:52:17 2012
Log: java docs updated
http://code.google.com/a/apache-extras.org/p/metcat/source/detail?r=196

Modified:

/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/api/MetCatAPI.java

/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/DataProductInfo.java

=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/api/MetCatAPI.java
Wed Aug 29 01:30:11 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/api/MetCatAPI.java
Wed Aug 29 01:52:17 2012
@@ -757,8 +757,6 @@
*
* @param dataproduct
* data product identification
- * @param depth
- * the depth to be searched
* @return JSON Array String which contains JSON objects with values
* DATAPRODUCT
*/
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/DataProductInfo.java
Wed Aug 29 00:42:00 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/DataProductInfo.java
Wed Aug 29 01:52:17 2012
@@ -35,104 +35,117 @@
public class DataProductInfo extends DataProductModel {

private DecimalFormat df = new DecimalFormat("0000");
-
+
private final Logger logger = LogManager.getLogger(DataProductInfo.class);
-
+
public DataProductInfo(DataModelImpl dbImpl) {
super(dbImpl);
}
-
+
private void addNewDataProductInfo(List<String> items) throws Exception {
- this.datamodelImpl.insertItems(ModelConfig.KEYSPACE,
ModelConfig.DATAPRODUCT_INFO_COLUMN_FAMILY,
- items);
+ this.datamodelImpl.insertItems(ModelConfig.KEYSPACE,
+ ModelConfig.DATAPRODUCT_INFO_COLUMN_FAMILY, items);
}
-
+
private void addNewDataProductInfo(String[] items) throws Exception {
- this.datamodelImpl.insertItems(ModelConfig.KEYSPACE,
ModelConfig.DATAPRODUCT_INFO_COLUMN_FAMILY,
- items);
+ this.datamodelImpl.insertItems(ModelConfig.KEYSPACE,
+ ModelConfig.DATAPRODUCT_INFO_COLUMN_FAMILY, items);
}
-
+
/**
- * Add a new data product into the database.
- * @param dproduct data product to be inserted
- * @throws Exception Hector Exception
+ * Add a new data product into the database.
+ *
+ * @param dproduct
+ * data product to be inserted
+ * @throws Exception
+ * Hector Exception
*/
public void addNewDataProductInfo(DataProduct dproduct) throws Exception {
- if (dproduct == null || dproduct.getId() == null) return;
-
+ if (dproduct == null || dproduct.getId() == null)
+ return;
+
List<String> items = new ArrayList<String>();
items.add(dproduct.getId());
items.add("_id");
items.add(dproduct.getId());
-
+
List<String> locs = dproduct.getLocations();
if (locs != null && locs.size() > 0) {
if (locs.size() > 1) {
- logger.debug("Data product [" + dproduct.getId() + "] has multiple
locations. (" + locs.size() + ")");
+ logger.debug("Data product [" + dproduct.getId()
+ + "] has multiple locations. (" + locs.size() + ")");
}
-
- for (int i=0; i<locs.size(); i++) {
+
+ for (int i = 0; i < locs.size(); i++) {
items.add(dproduct.getId());
items.add("location_" + df.format(i));
items.add(locs.get(i));
}
}
-
-
+
if (!dproduct.getSizeinBytes().equals("-1")) {
items.add(dproduct.getId());
items.add("sizeInBytes");
items.add(dproduct.getSizeinBytes());
}
-
+
if (dproduct.getTimestamp() != null) {
items.add(dproduct.getId());
items.add("timestamp");
items.add(dproduct.getTimestamp());
}
-
+
if (dproduct.getDescription() != null) {
items.add(dproduct.getId());
items.add("description");
items.add(dproduct.getDescription());
}
-
+
logger.info("Adding data product information for " + dproduct.getId());
this.addNewDataProductInfo(items);
}

/**
- * Adds a set of metadata extracted from a third-party tool and inserts
them to
- * the database.
+ * Adds a set of metadata extracted from a third-party tool and inserts
them
+ * to the database.
*
- * @param dataID identification of data product
- * @param metadata map of metadata extracted
- * @throws Exception Hector Exception
+ * @param dataID
+ * identification of data product
+ * @param metadata
+ * map of metadata extracted
+ * @throws Exception
+ * Hector Exception
*/
- public void addDataProductMetadata(String dataID, Map<String, String>
metadata) throws Exception {
- if (dataID == null || metadata == null) return;
-
+ public void addDataProductMetadata(String dataID,
+ Map<String, String> metadata) throws Exception {
+ if (dataID == null || metadata == null)
+ return;
+
String[] mdatarows = new String[metadata.size() * 3];
int c = 0;
- for (String key : metadata.keySet()) {
- mdatarows[c*3] = dataID;
- mdatarows[c*3+1] = key;
- mdatarows[c*3+2] = metadata.get(key);
+ for (String key : metadata.keySet()) {
+ mdatarows[c * 3] = dataID;
+ mdatarows[c * 3 + 1] = key;
+ mdatarows[c * 3 + 2] = metadata.get(key);
}
-
- logger.info("Adding " + metadata.size() + " meta-data(s) for data
product [" + dataID + "]");
+
+ logger.info("Adding " + metadata.size()
+ + " meta-data(s) for data product [" + dataID + "]");
this.addNewDataProductInfo(mdatarows);
}
-
+
/**
* Returns data product properties
- * @param Data Product ID
+ *
+ * @param dataProductID
+ * Data Product ID
* @return Map of details of the given data product
* @throws Exception
*/
- public Map<String,String> getDataProductByID (String dataProductID)
throws Exception
- {
- return
this.datamodelImpl.getValuesInSingleRow(ModelConfig.DATAPRODUCT_INFO_COLUMN_FAMILY,dataProductID);
+ public Map<String, String> getDataProductByID(String dataProductID)
+ throws Exception {
+ return this.datamodelImpl.getValuesInSingleRow(
+ ModelConfig.DATAPRODUCT_INFO_COLUMN_FAMILY, dataProductID);
}
-
+
}
Reply all
Reply to author
Forward
0 new messages