Revision: 212
Author:
tobha...@gmail.com
Date: Wed Aug 29 22:51:20 2012
Log: java doc comments updated
http://code.google.com/a/apache-extras.org/p/metcat/source/detail?r=212
Modified:
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/index/WorkflowIndex.java
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowEvents.java
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowIterator.java
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowProgress.java
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowStatus.java
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowSummarizer.java
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/dispatcher/DispatchQueue.java
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/dispatcher/Dispatcher.java
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/index/WorkflowIndex.java
Wed Aug 29 02:59:51 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/index/WorkflowIndex.java
Wed Aug 29 22:51:20 2012
@@ -39,25 +39,61 @@
super(dbImpl);
}
+ /**
+ * Inserts index for a workflow property
+ *
+ * @param propertyName
+ * @param propertyValue
+ * @param workflowID
+ * @throws Exception
+ */
public void insertWorkflowPropertyIndex(String propertyName, String
propertyValue, String workflowID) throws Exception {
this.datamodelImpl.insertItem(ModelConfig.KEYSPACE,
ModelConfig.WORKFLOW_INDEX_COLUMN_FAMILY,
propertyName, propertyValue + PART_DELIMETER + UUID.randomUUID(),
workflowID);
}
+ /**
+ * Inserts index for a event property
+ *
+ * @param eventPropertyName
+ * @param eventPropertyValue
+ * @param eventID
+ * @throws Exception
+ */
public void insertEventPropertyIndex(String eventPropertyName, String
eventPropertyValue, String eventID) throws Exception {
this.datamodelImpl.insertItem(ModelConfig.KEYSPACE,
ModelConfig.WORKFLOW_INDEX_COLUMN_FAMILY,
(EVENT_PROPERTY_NAME_PREFIX + eventPropertyName),
(eventPropertyValue + PART_DELIMETER + UUID.randomUUID()), eventID );
}
+ /**
+ * Inserts index for a log property
+ *
+ * @param logPropertyName
+ * @param logPropertyValue
+ * @param eventID
+ * @throws Exception
+ */
public void insertLogPropertyIndex(String logPropertyName, String
logPropertyValue, String eventID) throws Exception {
this.datamodelImpl.insertItem(ModelConfig.KEYSPACE,
ModelConfig.WORKFLOW_INDEX_COLUMN_FAMILY,
(LOG_PROPERTY_NAME_PREFIX + logPropertyName), (logPropertyValue +
PART_DELIMETER + UUID.randomUUID()), eventID );
}
+ /**
+ * Inserts bulk indexes for a workflow property
+ *
+ * @param items
+ * @throws Exception
+ */
public void insertBulkIndexOnce(List<String> items) throws Exception {
this.datamodelImpl.insertItems(ModelConfig.KEYSPACE,
ModelConfig.WORKFLOW_INDEX_COLUMN_FAMILY, items);
}
+ /**
+ * Returns indexed workflow property names list
+ *
+ * @return workflow property names
+ * @throws Exception
+ */
public List<String> getWorkflowProperties () throws Exception
{
List<String> resultList;
@@ -72,6 +108,12 @@
return newResultList;
}
+ /**
+ * Returns event property names list
+ *
+ * @return event property names
+ * @throws Exception
+ */
public List<String> getEventProperties () throws Exception
{
List<String> resultList;
@@ -88,12 +130,28 @@
return newResultList;
}
+ /**
+ * Returns workflow ids for a given workflow property and value
+ *
+ * @param propertyName
+ * @param propertyValue
+ * @return workflow Ids
+ * @throws Exception
+ */
public List<String>
getWorkflowIDsOfGivenWorkflowPropertyAndValue(String propertyName, String
propertyValue) throws Exception
{
return
this.datamodelImpl.getValuesInCellRange(ModelConfig.WORKFLOW_INDEX_COLUMN_FAMILY,propertyName,
( propertyValue + DataModel.PART_DELIMETER ),(
propertyValue + DataModel.PART_DELIMETER + "|"));
}
+ /**
+ * Returns event ids for a given event property and value
+ *
+ * @param propertyName
+ * @param propertyValue
+ * @return event ids
+ * @throws Exception
+ */
public List<String> getEventIDsOfGivenEventPropertyAndValue(String
propertyName, String propertyValue) throws Exception
{
return
this.datamodelImpl.getValuesInCellRange(ModelConfig.WORKFLOW_INDEX_COLUMN_FAMILY,EVENT_PROPERTY_NAME_PREFIX
+ propertyName,
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowEvents.java
Tue Aug 28 05:39:19 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowEvents.java
Wed Aug 29 22:51:20 2012
@@ -36,6 +36,17 @@
super(dbImpl);
}
+ /**
+ * Store event data in to Workflow Event CF
+ *
+ * @param experimentID
+ * @param workflowID
+ * @param serviceID
+ * @param timestamp
+ * @param eventName
+ * @param valueContent
+ * @throws Exception
+ */
public void setEventData(String experimentID, String workflowID, String
serviceID, String timestamp, String eventName, String valueContent) throws
Exception {
if (workflowID != null) {
logger.info("Adding event [" + eventName + "] for workflow " +
workflowID + " at " + timestamp);
@@ -53,6 +64,13 @@
}
+ /**
+ * Get workflow event data
+ *
+ * @param experimentID
+ * @return
+ * @throws Exception
+ */
public Map<String, String> getEventData(String experimentID) throws
Exception {
return
this.datamodelImpl.getValuesInSingleRow(ModelConfig.WORKFLOW_EVENT_COLUMN_FAMILY,
experimentID);
}
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowIterator.java
Thu Aug 23 17:55:36 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowIterator.java
Wed Aug 29 22:51:20 2012
@@ -40,6 +40,14 @@
super(dbImpl);
}
+ /**
+ * Puts a workflow in to WF Iteretor CF when it is invoked
+ *
+ * @param experimentID
+ * @param workflowID
+ * @param timestamp
+ * @throws Exception
+ */
public void createWorkflowIterator(String experimentID, String
workflowID, String timestamp) throws Exception {
logger.info("Adding workflow [" + (workflowID == null ?
experimentID : workflowID) + "] to the iterator");
this.datamodelImpl.insertItem(ModelConfig.KEYSPACE,
ModelConfig.WORKFLOW_ITERATOR_COLUMN_FAMILY,
@@ -47,12 +55,32 @@
workflowID == null ? experimentID : workflowID);
}
+ /**
+ * Gets workflows for a given time duration
+ *
+ * @param rowKey
+ * @param timestamp1
+ * @param timestamp2
+ * @return workflows
+ * @throws Exception
+ */
public List<String> getWorkflowsForATimeDuration(String rowKey, String
timestamp1, String timestamp2)
throws Exception {
return
this.datamodelImpl.getValuesInCellRange(ModelConfig.WORKFLOW_ITERATOR_COLUMN_FAMILY,
rowKey, timestamp1, timestamp2);
}
+ /**
+ * Gets fixed number of workflows for a given time duration
+ *
+ * @param rowKey
+ * @param timestamp1
+ * @param timestamp2
+ * @param numberOfRecords
+ * @param isFirst
+ * @return workflows
+ * @throws Exception
+ */
public List<String> getWorkflowsForATimeDurationWithPagination(String
rowKey, String timestamp1, String timestamp2,
int numberOfRecords, boolean isFirst) throws Exception {
@@ -60,12 +88,31 @@
ModelConfig.WORKFLOW_ITERATOR_COLUMN_FAMILY,rowKey,timestamp1,timestamp2,numberOfRecords,isFirst);
}
+ /**
+ * Gets workflows and timestamps for a given time duration
+ *
+ * @param timestamp1
+ * @param timestamp2
+ * @return workflows and timestamps
+ * @throws Exception
+ */
public Map<String, String> getWorkflowAndTimestampForADuration(String
timestamp1, String timestamp2) throws Exception
{
return
this.datamodelImpl.getValuesInSingleRowWithRange(ModelConfig.WORKFLOW_ITERATOR_COLUMN_FAMILY,
"workflows", timestamp1, timestamp2);
}
+ /**
+ * Gets fixed number of workflows and timestamps for a given time
duration
+ *
+ * @param rowKey
+ * @param timestamp1
+ * @param timestamp2
+ * @param numberOfRecords
+ * @param isFirst
+ * @return workflows and timestamps
+ * @throws Exception
+ */
public Map<String, String>
getWorkflowAndTimestampForADurationWithPagination(String rowKey, String
timestamp1,
String timestamp2, int numberOfRecords, boolean isFirst)throws
Exception {
@@ -73,6 +120,15 @@
rowKey,timestamp1,timestamp2,numberOfRecords,isFirst);
}
+ /**
+ * Returns number of columns in a specified row.
+ *
+ * @param rowKey
+ * @param timestamp1
+ * @param timestamp2
+ * @return number of columns
+ * @throws Exception
+ */
public int CountColumnsInSingleRow(String rowKey, String timestamp1,
String timestamp2) throws Exception {
return
this.datamodelImpl.CountColumnsInSingleRow(ModelConfig.WORKFLOW_ITERATOR_COLUMN_FAMILY,
rowKey,timestamp1,timestamp2);
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowProgress.java
Thu Aug 23 17:55:36 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowProgress.java
Wed Aug 29 22:51:20 2012
@@ -40,6 +40,16 @@
super(dbImpl);
}
+ /**
+ * Adds an event to Workflow Progress CF
+ *
+ * @param experimentID Experiment ID
+ * @param serviceID event service ID
+ * @param workflowID workflow ID if available or, null
+ * @param timestamp event timstamp
+ * @param eventName event name
+ * @throws Exception
+ */
public void addStepToWorkflowProgress(String experimentID, String
serviceID, String workflowID, String timestamp, String eventName) throws
Exception {
logger.debug("Adding new node for " + (workflowID == null ?
experimentID : workflowID) + " as " + eventName
+ " [" + serviceID + "]");
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowStatus.java
Thu Aug 23 17:55:36 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowStatus.java
Wed Aug 29 22:51:20 2012
@@ -41,7 +41,6 @@
public WorkflowStatus(DataModelImpl dbImpl) {
super(dbImpl);
-
this.loadAllStates();
}
@@ -158,17 +157,40 @@
}
+ /**
+ * Get list of workflows in a given state
+ *
+ * @param status
+ * @return Workflows
+ * @throws Exception
+ */
public Map<String, String> getAllWorkflowsByStatus(WorkflowStatusEnum
status) throws Exception {
return
this.datamodelImpl.getValuesInSingleRow(ModelConfig.WORKFLOW_STATES_COLUMN_FAMILY,
status.getText());
}
+ /**
+ * Returns requested number of workflows in a given state
+ *
+ * @param status
+ * @param numberOfRecords
+ * @param isFirst
+ * @return Workflows
+ * @throws Exception
+ */
public Map<String, String>
getAllWorkflowsByStatusWithPagination(WorkflowStatusEnum status, int
numberOfRecords,
boolean isFirst) throws Exception {
return this.datamodelImpl.getXnumberOfColumnsInSingleRow(
ModelConfig.WORKFLOW_STATES_COLUMN_FAMILY,
status.getText(),"", "",numberOfRecords, isFirst);
}
+ /**
+ * Returns number of columns in a specified row.
+ *
+ * @param status
+ * @return number of columns in a row
+ * @throws Exception
+ */
public int CountColumnsInSingleRow(WorkflowStatusEnum status) throws
Exception {
return
this.datamodelImpl.CountColumnsInSingleRow(ModelConfig.WORKFLOW_STATES_COLUMN_FAMILY,
status.getText(),"","");
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowSummarizer.java
Thu Aug 23 17:55:36 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/db/model/WorkflowSummarizer.java
Wed Aug 29 22:51:20 2012
@@ -80,11 +80,16 @@
this.datamodelImpl.insertItems(ModelConfig.KEYSPACE,
ModelConfig.WORKFLOW_SUMMARY_COLUMN_FAMILY, items);
}
+ /**
+ * Returns details of a workflow
+ *
+ * @param workflowID
+ * @return Workflow details
+ * @throws Exception
+ */
public Map<String,String> getWorkflowSummary(String workflowID) throws
Exception
{
return
this.datamodelImpl.getValuesInSingleRow(ModelConfig.WORKFLOW_SUMMARY_COLUMN_FAMILY,
workflowID);
}
-
-
}
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/dispatcher/DispatchQueue.java
Thu Aug 9 20:35:43 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/dispatcher/DispatchQueue.java
Wed Aug 29 22:51:20 2012
@@ -33,11 +33,21 @@
queue = new LinkedList<Document>();
}
+ /**
+ * Puts a document object to dispatcher queue
+ *
+ * @param doc document object
+ */
public synchronized void addMsgToQueue(Document doc){
queue.add(doc);
notifyAll();
}
+ /**
+ * Returns a document object from the dispatcher queue
+ *
+ * @return document object
+ */
public synchronized Document getMsgFromQueue(){
Document doc = queue.pollFirst();
while(doc==null){
@@ -51,6 +61,11 @@
return doc;
}
+ /**
+ * Returns a singleton dispatch queue object
+ *
+ * @return Dispatch queue object
+ */
public static DispatchQueue getInstance(){
if(instance == null ){
instance = new DispatchQueue();
@@ -58,6 +73,11 @@
return instance;
}
+ /**
+ * Returns dispatch queue size
+ *
+ * @return queue size
+ */
public long getQueueSize(){
return queue.size();
}
=======================================
---
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/dispatcher/Dispatcher.java
Tue Aug 28 21:57:32 2012
+++
/trunk/metcatserver/src/main/java/org/apache/airavata/metcat/dispatcher/Dispatcher.java
Wed Aug 29 22:51:20 2012
@@ -77,6 +77,7 @@
}
eventMsgHandler.setXmlMessageDocument(doc);
exec.execute(eventMsgHandler);
+ logger.debug("Dispatched messgage of type : " + eventType);
}
private String getEventMessageType(Document doc) throws Exception {