You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2013/05/28 18:47:09 UTC
svn commit: r1487001 - in /uima/sandbox/uima-ducc/trunk: ./
uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/
Author: challngr
Date: Tue May 28 16:47:09 2013
New Revision: 1487001
URL: http://svn.apache.org/r1487001
Log:
Add more javadoc to public classes.
Modified:
uima/sandbox/uima-ducc/trunk/javadoc.xml
uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccJobCancel.java
uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationCancel.java
uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationSubmit.java
Modified: uima/sandbox/uima-ducc/trunk/javadoc.xml
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/javadoc.xml?rev=1487001&r1=1487000&r2=1487001&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/javadoc.xml (original)
+++ uima/sandbox/uima-ducc/trunk/javadoc.xml Tue May 28 16:47:09 2013
@@ -56,6 +56,9 @@
<fileset dir="uima-ducc-cli/src/main/java">
<include name="**/DuccJobSubmit.java" />
+ <include name="**/DuccJobCancel.java" />
+ <include name="**/DuccReservationCancel.java" />
+ <include name="**/DuccReservationSubmit.java" />
<include name="**/DuccServiceApi.java" />
<include name="**/IDuccCallback.java" />
<include name="**/CliBase.java" />
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccJobCancel.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccJobCancel.java?rev=1487001&r1=1487000&r2=1487001&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccJobCancel.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccJobCancel.java Tue May 28 16:47:09 2013
@@ -52,12 +52,20 @@ public class DuccJobCancel
};
+ /**
+ * @param args Array of string arguments as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_CANCEL">DUCC CLI reference.</a>
+ */
public DuccJobCancel(String [] args)
throws Exception
{
init(this.getClass().getName(), opts, args, jobRequestProperties, or_host, or_port, "or", null);
}
+ /**
+ * @param args List of string arguments as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_CANCEL">DUCC CLI reference.</a>
+ */
public DuccJobCancel(List<String> args)
throws Exception
{
@@ -65,6 +73,10 @@ public class DuccJobCancel
init(this.getClass().getName(), opts, arg_array, jobRequestProperties, or_host, or_port, "or", null);
}
+ /**
+ * @param props Properties file of arguments, as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_CANCEL">DUCC CLI reference.</a>
+ */
public DuccJobCancel(Properties props)
throws Exception
{
@@ -75,15 +87,33 @@ public class DuccJobCancel
init(this.getClass().getName(), opts, null, jobRequestProperties, or_host, or_port, "or", null, null);
}
+ /**
+ * If a specific process, rather than the entire job, is canceled. this returns the canceled
+ * DUCC id of the process, as confirmation.
+ *
+ * @return The DUCC numeric id of the canceled process.
+ */
public long getCanceledPid()
{
return canceledPid;
}
+
+ /**
+ * Return the DUCC Orchestrator message, if any, pertaining to the cancelation.
+ *
+ * @return Return any message associated with the cancelation.
+ */
public String getResponseMessage()
{
return responseMessage;
}
+ /**
+ * Execute collects the parameters for job cancelation and sends them to the DUCC Orchestrator
+ * to effect the cancelation.
+ *
+ * @return True if the orchestrator accepts the job cancelation.
+ */
public boolean execute()
throws Exception
{
@@ -118,6 +148,10 @@ public class DuccJobCancel
return rc;
}
+ /**
+ * Main method, as used by the executable jar or direct java invocation.
+ * @param args arguments as described in the <a href="/doc/duccbook.html#DUCC_CLI_CANCEL">DUCC CLI reference.</a>
+ */
public static void main(String[] args) {
try {
DuccJobCancel djc = new DuccJobCancel(args);
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationCancel.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationCancel.java?rev=1487001&r1=1487000&r2=1487001&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationCancel.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationCancel.java Tue May 28 16:47:09 2013
@@ -49,13 +49,20 @@ public class DuccReservationCancel
UiOption.RoleAdministrator,
};
-
+ /**
+ * @param args Array of string arguments as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_UNRESERVE">DUCC CLI reference.</a>
+ */
public DuccReservationCancel(String [] args)
throws Exception
{
init(this.getClass().getName(), opts, args, requestProperties, or_host, or_port, "or");
}
+ /**
+ * @param args List of string arguments as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_UNRESERVE">DUCC CLI reference.</a>
+ */
public DuccReservationCancel(List<String> args)
throws Exception
{
@@ -63,6 +70,10 @@ public class DuccReservationCancel
init(this.getClass().getName(), opts, arg_array, requestProperties, or_host, or_port, "or");
}
+ /**
+ * @param props Properties file of arguments, as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_UNRESERVE">DUCC CLI reference.</a>
+ */
public DuccReservationCancel(Properties props)
throws Exception
{
@@ -73,11 +84,22 @@ public class DuccReservationCancel
init(this.getClass().getName(), opts, null, requestProperties, or_host, or_port, "or");
}
+ /**
+ * Return the DUCC Orchestrator message, if any, pertaining to the cancelation.
+ *
+ * @return Return any message associated with the cancelation.
+ */
public String getResponseMessage()
{
return responseMessage;
}
+ /**
+ * Execute collects the parameters for reservation cancelation and sends them to the DUCC Orchestrator
+ * to effect the cancelation.
+ *
+ * @return True if the orchestrator accepts the reservation cancelation.
+ */
public boolean execute()
throws Exception
{
@@ -101,6 +123,10 @@ public class DuccReservationCancel
return rc;
}
+ /**
+ * Main method, as used by the executable jar or direct java invocation.
+ * @param args arguments as described in the <a href="/doc/duccbook.html#DUCC_CLI_UNRESERVE">DUCC CLI reference.</a>
+ */
public static void main(String[] args) {
try {
DuccReservationCancel dsc = new DuccReservationCancel(args);
Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationSubmit.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationSubmit.java?rev=1487001&r1=1487000&r2=1487001&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationSubmit.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-cli/src/main/java/org/apache/uima/ducc/cli/DuccReservationSubmit.java Tue May 28 16:47:09 2013
@@ -40,19 +40,31 @@ public class DuccReservationSubmit
private String nodeList = "";
- public DuccReservationSubmit(ArrayList<String> args)
+ /**
+ * @param args Array of string arguments as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_RESERVE">DUCC CLI reference.</a>
+ */
+ public DuccReservationSubmit(String[] args)
throws Exception
{
- String[] arg_array = args.toArray(new String[args.size()]);
- init(this.getClass().getName(), opts, arg_array, requestProperties, or_host, or_port, "or");
+ init(this.getClass().getName(), opts, args, requestProperties, or_host, or_port, "or");
}
- public DuccReservationSubmit(String[] args)
+ /**
+ * @param args List of string arguments as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_RESERVE">DUCC CLI reference.</a>
+ */
+ public DuccReservationSubmit(ArrayList<String> args)
throws Exception
{
- init(this.getClass().getName(), opts, args, requestProperties, or_host, or_port, "or");
+ String[] arg_array = args.toArray(new String[args.size()]);
+ init(this.getClass().getName(), opts, arg_array, requestProperties, or_host, or_port, "or");
}
+ /**
+ * @param props Properties file of arguments, as described in the
+ * <a href="/doc/duccbook.html#DUCC_CLI_RESERVE">DUCC CLI reference.</a>
+ */
public DuccReservationSubmit(Properties props)
throws Exception
{
@@ -101,6 +113,15 @@ public class DuccReservationSubmit
// .withLongOpt(DuccUiConstants.name_specification).create());
// }
+
+ /**
+ * Execute collects the parameters for the reservation and sends them to the DUCC Orchestrator
+ * to schedule the reservation. This method blocks until either the reservation is
+ * granted, or it fails. Failure is always do to lack of resources, in some form or another.
+ * Reservations are granted all-or-nothing: you get everything you ask for, or you get nothing.
+ *
+ * @return True if the DUCC grants the reservation.
+ */
public boolean execute()
{
if ( ! requestProperties.containsKey(UiOption.NumberOfInstances.pname()) ) {
@@ -131,17 +152,29 @@ public class DuccReservationSubmit
return rc;
}
-
+ /**
+ * If the reservation is granted, this method returns the set of hosts containing the reservation.
+ * @return String array of hosts where the reservation is granted.
+ */
public String[] getHosts()
{
return this.nodeList.split("\\s");
}
+ /**
+ * If the reservation is granted, this method returns the set of hosts containing the reservation as
+ * a single blank-delimeted string.
+ * @return Blank-delimeted string of hosts where the reservation is granted.
+ */
public String getHostsAsString()
{
return nodeList;
}
+ /**
+ * Main method, as used by the executable jar or direct java invocation.
+ * @param args arguments as described in the <a href="/doc/duccbook.html#DUCC_CLI_RESERVE">DUCC CLI reference.</a>
+ */
public static void main(String[] args) {
try {
// Instantiate the object with args similar to the CLI, or a pre-built properties file