Added javadocs to api.application package. Fixed some typos in method names.
git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_dev_next@653 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IApplicationContext.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IApplicationContext.java
index c739a5e..c07de41 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IApplicationContext.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IApplicationContext.java
@@ -16,8 +16,27 @@
import java.io.Serializable;
+/**
+ * Base class of the {@link ICCApplicationContext} and the
+ * {@link INCApplicationContext}.
+ *
+ * @author vinayakb
+ *
+ */
public interface IApplicationContext {
+ /**
+ * Provides the Class Loader that loads classes for this Hyracks Application
+ * at the CC.
+ *
+ * @return the application {@link ClassLoader}.
+ */
public ClassLoader getClassLoader();
- public Serializable getDestributedState();
+ /**
+ * Gets the distributed state that is made available to all the Application
+ * Contexts of this application in the cluster.
+ *
+ * @return
+ */
+ public Serializable getDistributedState();
}
\ No newline at end of file
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IBootstrap.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IBootstrap.java
index efbf0df..19f97b4 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IBootstrap.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/IBootstrap.java
@@ -14,8 +14,23 @@
*/
package edu.uci.ics.hyracks.api.application;
+/**
+ * Base class of {@link ICCBootstrap} and {@link INCBootstrap}.
+ *
+ * @author vinayakb
+ */
public interface IBootstrap {
+ /**
+ * Method called to start the application at a Hyracks CC or NC node.
+ *
+ * @throws Exception
+ */
public void start() throws Exception;
+ /**
+ * Method called to shutdown the application at a Hyracks CC or NC node.
+ *
+ * @throws Exception
+ */
public void stop() throws Exception;
}
\ No newline at end of file
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCApplicationContext.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCApplicationContext.java
index 0987bd2..2e02101 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCApplicationContext.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCApplicationContext.java
@@ -19,13 +19,51 @@
import edu.uci.ics.hyracks.api.context.ICCContext;
import edu.uci.ics.hyracks.api.job.IJobLifecycleListener;
import edu.uci.ics.hyracks.api.job.IJobSpecificationFactory;
+import edu.uci.ics.hyracks.api.job.JobSpecification;
+/**
+ * Application Context at the Cluster Controller for an application.
+ *
+ * @author vinayakb
+ *
+ */
public interface ICCApplicationContext extends IApplicationContext {
+ /**
+ * Sets the state that must be distributed by the infrastructure to all the
+ * NC application contects. Any state set by calling thsi method in the
+ * {@link ICCBootstrap#start()} call is made available to all the
+ * {@link INCApplicationContext} objects at each Node Controller. The state
+ * is then available to be inspected by the application at the NC during or
+ * after the {@link INCBootstrap#start()} call.
+ *
+ * @param state
+ * The distributed state
+ */
public void setDistributedState(Serializable state);
+ /**
+ * A factory class specific to this application that may accept incoming
+ * {@link JobSpecification} and produce modified {@link JobSpecification}
+ * that is executed on the cluster. If a {@link IJobSpecificationFactory} is
+ * not set, the incoming {@link JobSpecification} is executed unmodified.
+ *
+ * @param jobSpecFactory
+ * - The Job Specification Factory.
+ */
public void setJobSpecificationFactory(IJobSpecificationFactory jobSpecFactory);
+ /**
+ * A listener that listens to Job Lifecycle events at the Cluster
+ * Controller.
+ *
+ * @param jobLifecycleListener
+ */
public void addJobLifecycleListener(IJobLifecycleListener jobLifecycleListener);
-
+
+ /**
+ * Get the Cluster Controller Context.
+ *
+ * @return The Cluster Controller Context.
+ */
public ICCContext getCCContext();
}
\ No newline at end of file
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCBootstrap.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCBootstrap.java
index 3acbe5e..e3906ea 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCBootstrap.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/ICCBootstrap.java
@@ -1,5 +1,19 @@
package edu.uci.ics.hyracks.api.application;
+/**
+ * Implemented by the bootstrap class of the application that will manage its
+ * life cycle at the Cluster Controller.
+ *
+ * @author vinayakb
+ *
+ */
public interface ICCBootstrap extends IBootstrap {
+ /**
+ * Called by the infrastructure to set the CC Application Context for the
+ * application. The infrastructure makes this call prior to calling start().
+ *
+ * @param appCtx
+ * - The CC application context
+ */
public void setApplicationContext(ICCApplicationContext appCtx);
}
\ No newline at end of file
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCApplicationContext.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCApplicationContext.java
index eed5bb3..24a598b 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCApplicationContext.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCApplicationContext.java
@@ -14,18 +14,43 @@
*/
package edu.uci.ics.hyracks.api.application;
-import java.io.Serializable;
-
import edu.uci.ics.hyracks.api.context.IHyracksRootContext;
+/**
+ * Application Context at the Node Controller for an application.
+ *
+ * @author vinayakb
+ *
+ */
public interface INCApplicationContext extends IApplicationContext {
+ /**
+ * Gets the node Id of the Node Congtroller.
+ *
+ * @return the Node Id.
+ */
public String getNodeId();
+ /**
+ * Get the Hyracks Root Context.
+ *
+ * @return The Hyracks Root Context
+ */
public IHyracksRootContext getRootContext();
- public void setDistributedState(Serializable state);
-
+ /**
+ * Set an object that can be later retrieved by the
+ * {@link #getApplicationObject()} call.
+ *
+ * @param object
+ * Application Object
+ */
public void setApplicationObject(Object object);
+ /**
+ * Get the application object previously set by the
+ * {@link #setApplicationObject(Object)} call.
+ *
+ * @return Application Object
+ */
public Object getApplicationObject();
}
\ No newline at end of file
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCBootstrap.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCBootstrap.java
index 4aa1ac3..300f7c7 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCBootstrap.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/application/INCBootstrap.java
@@ -1,5 +1,19 @@
package edu.uci.ics.hyracks.api.application;
+/**
+ * Implemented by the bootstrap class of the application that will manage its
+ * life cycle at a Node Controller.
+ *
+ * @author vinayakb
+ *
+ */
public interface INCBootstrap extends IBootstrap {
+ /**
+ * Called by the infrastructure to set the NC Application Context for the
+ * application. The infrastructure makes this call prior to calling start().
+ *
+ * @param appCtx
+ * - The NC application context
+ */
public void setApplicationContext(INCApplicationContext appCtx);
}
\ No newline at end of file
diff --git a/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/job/manager/events/ApplicationStartEvent.java b/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/job/manager/events/ApplicationStartEvent.java
index ab05d0f..0ea8579 100644
--- a/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/job/manager/events/ApplicationStartEvent.java
+++ b/hyracks-control-cc/src/main/java/edu/uci/ics/hyracks/control/cc/job/manager/events/ApplicationStartEvent.java
@@ -48,7 +48,7 @@
try {
appCtx.initializeClassPath();
appCtx.initialize();
- final byte[] distributedState = JavaSerializationUtils.serialize(appCtx.getDestributedState());
+ final byte[] distributedState = JavaSerializationUtils.serialize(appCtx.getDistributedState());
final boolean deployHar = appCtx.containsHar();
List<RemoteOp<Void>> opList = new ArrayList<RemoteOp<Void>>();
for (final String nodeId : ccs.getNodeMap().keySet()) {
diff --git a/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/application/ApplicationContext.java b/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/application/ApplicationContext.java
index c02c7ad..d2a06be 100644
--- a/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/application/ApplicationContext.java
+++ b/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/application/ApplicationContext.java
@@ -195,7 +195,7 @@
}
@Override
- public Serializable getDestributedState() {
+ public Serializable getDistributedState() {
return distributedState;
}
diff --git a/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/application/NCApplicationContext.java b/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/application/NCApplicationContext.java
index 06f4212..1121c6c 100644
--- a/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/application/NCApplicationContext.java
+++ b/hyracks-control-nc/src/main/java/edu/uci/ics/hyracks/control/nc/application/NCApplicationContext.java
@@ -26,7 +26,6 @@
return nodeId;
}
- @Override
public void setDistributedState(Serializable state) {
distributedState = state;
}
diff --git a/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/test/support/TestNCApplicationContext.java b/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/test/support/TestNCApplicationContext.java
index 295a428..1b95ccb 100644
--- a/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/test/support/TestNCApplicationContext.java
+++ b/hyracks-test-support/src/main/java/edu/uci/ics/hyracks/test/support/TestNCApplicationContext.java
@@ -42,7 +42,7 @@
}
@Override
- public Serializable getDestributedState() {
+ public Serializable getDistributedState() {
return distributedState;
}
@@ -52,11 +52,6 @@
}
@Override
- public void setDistributedState(Serializable state) {
- distributedState = state;
- }
-
- @Override
public void setApplicationObject(Object object) {
this.appObject = object;
}