Author: mona
Date: Thu May 9 22:22:54 2013
New Revision: 1480814
URL: http://svn.apache.org/r1480814
Log:
OOZIE-1303 CLI API for Bulk Monitoring (mona)
Modified:
oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
oozie/trunk/client/src/main/java/org/apache/oozie/client/rest/JsonToBean.java
oozie/trunk/client/src/test/java/org/apache/oozie/client/rest/TestJsonToBean.java
oozie/trunk/core/src/main/java/org/apache/oozie/BundleJobBean.java
oozie/trunk/core/src/main/java/org/apache/oozie/client/rest/BulkResponseImpl.java
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkJPAExecutor.java
oozie/trunk/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
oozie/trunk/docs/src/site/twiki/DG_CommandLineTool.twiki
oozie/trunk/release-log.txt
Modified: oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
--- oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java
(original)
+++ oozie/trunk/client/src/main/java/org/apache/oozie/cli/OozieCLI.java Thu May
9 22:22:54 2013
@@ -1112,7 +1112,7 @@ public class OozieCLI {
private static final String WORKFLOW_ACTION_FORMATTER =
"%-78s%-10s%-23s%-11s%-10s";
private static final String COORD_ACTION_FORMATTER =
"%-43s%-10s%-37s%-10s%-21s%-21s";
- private static final String BULK_RESPONSE_FORMATTER =
"%-41s%-41s%-37s%-37s%-13s%-21s%-24s";
+ private static final String BULK_RESPONSE_FORMATTER =
"%-13s%-38s%-13s%-41s%-10s%-38s%-21s%-38s";
private void printJob(WorkflowJob job, String timeZoneId, boolean verbose)
throws IOException {
System.out.println("Job ID : " + maskIfNull(job.getId()));
@@ -1199,7 +1199,7 @@ public class OozieCLI {
try {
if (bulkFilterString != null) {
- printBulkJobs(wc.getBulkInfo(bulkFilterString, start, len),
timeZoneId);
+ printBulkJobs(wc.getBulkInfo(bulkFilterString, start, len),
timeZoneId, commandLine.hasOption(VERBOSE_OPTION));
}
else if (jobtype.toLowerCase().contains("wf")) {
printJobs(wc.getJobsInfo(filter, start, len), timeZoneId,
commandLine.hasOption(VERBOSE_OPTION));
@@ -1263,17 +1263,40 @@ public class OozieCLI {
}
}
- private void printBulkJobs(List<BulkResponse> jobs, String timeZoneId)
throws IOException {
+ private void printBulkJobs(List<BulkResponse> jobs, String timeZoneId,
boolean verbose) throws IOException {
if (jobs != null && jobs.size() > 0) {
- System.out.println(String.format(BULK_RESPONSE_FORMATTER, "Bundle
Name", "Coordinator Name",
- "Coord Action ID", "External ID", "Status", "Created
Time", "Error Message"));
-
for (BulkResponse response : jobs) {
- System.out.println(String.format(BULK_RESPONSE_FORMATTER,
maskIfNull((response.getBundle()).getAppName()),
- maskIfNull((response.getCoordinator()).getAppName()),
maskIfNull((response.getAction()).getId()),
- maskIfNull((response.getAction()).getExternalId()),
(response.getAction()).getStatus(),
- maskDate((response.getAction()).getCreatedTime(),
timeZoneId, false), (response.getAction()).getErrorMessage()));
- System.out.println(RULER);
+ BundleJob bundle = response.getBundle();
+ CoordinatorJob coord = response.getCoordinator();
+ CoordinatorAction action = response.getAction();
+ if (verbose) {
+ System.out.println();
+ System.out.println("Bundle Name : " +
maskIfNull(bundle.getAppName()));
+
+ System.out.println(RULER);
+
+ System.out.println("Bundle ID : " +
maskIfNull(bundle.getId()));
+ System.out.println("Coordinator Name : " +
maskIfNull(coord.getAppName()));
+ System.out.println("Coord Action ID : " +
maskIfNull(action.getId()));
+ System.out.println("Action Status : " +
action.getStatus());
+ System.out.println("External ID : " +
maskIfNull(action.getExternalId()));
+ System.out.println("Created Time : " +
maskDate(action.getCreatedTime(), timeZoneId, false));
+ System.out.println("User : " +
maskIfNull(bundle.getUser()));
+ System.out.println("Error Message : " +
maskIfNull(action.getErrorMessage()));
+ System.out.println(RULER);
+ }
+ else {
+ System.out.println(String.format(BULK_RESPONSE_FORMATTER,
"Bundle Name", "Bundle ID", "Coord Name",
+ "Coord Action ID", "Status", "External ID",
"Created Time", "Error Message"));
+ System.out.println(RULER);
+ System.out
+ .println(String.format(BULK_RESPONSE_FORMATTER,
maskIfNull(bundle.getAppName()),
+ maskIfNull(bundle.getId()),
maskIfNull(coord.getAppName()),
+ maskIfNull(action.getId()),
action.getStatus(), maskIfNull(action.getExternalId()),
+ maskDate(action.getCreatedTime(),
timeZoneId, false),
+ maskIfNull(action.getErrorMessage())));
+ System.out.println(RULER);
+ }
}
}
else {
Modified:
oozie/trunk/client/src/main/java/org/apache/oozie/client/rest/JsonToBean.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/client/src/main/java/org/apache/oozie/client/rest/JsonToBean.java?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
---
oozie/trunk/client/src/main/java/org/apache/oozie/client/rest/JsonToBean.java
(original)
+++
oozie/trunk/client/src/main/java/org/apache/oozie/client/rest/JsonToBean.java
Thu May 9 22:22:54 2013
@@ -38,7 +38,6 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
@@ -48,6 +47,7 @@ import java.util.Set;
* <p/>
* It uses JDK dynamic proxy to create bean instances.
*/
+@SuppressWarnings("rawtypes")
public class JsonToBean {
private static class Property {
@@ -182,9 +182,9 @@ public class JsonToBean {
BUNDLE_JOB.put("getCoordinators",new
Property(JsonTags.BUNDLE_COORDINATOR_JOBS, CoordinatorJob.class, true));
BUNDLE_JOB.put("toString", new Property(JsonTags.TO_STRING,
String.class));
- BULK_RESPONSE.put("getBundle", new
Property(JsonTags.BULK_RESPONSE_BUNDLE, BundleJob.class, true));
- BULK_RESPONSE.put("getCoordinator", new
Property(JsonTags.BULK_RESPONSE_COORDINATOR, CoordinatorJob.class, true));
- BULK_RESPONSE.put("getAction", new
Property(JsonTags.BULK_RESPONSE_ACTION, CoordinatorAction.class, true));
+ BULK_RESPONSE.put("getBundle", new
Property(JsonTags.BULK_RESPONSE_BUNDLE, BundleJob.class, false));
+ BULK_RESPONSE.put("getCoordinator", new
Property(JsonTags.BULK_RESPONSE_COORDINATOR, CoordinatorJob.class, false));
+ BULK_RESPONSE.put("getAction", new
Property(JsonTags.BULK_RESPONSE_ACTION, CoordinatorAction.class, false));
JMS_CONNECTION_INFO.put("getTopicPatternProperties", new
Property(JsonTags.JMS_TOPIC_PATTERN, Properties.class));
JMS_CONNECTION_INFO.put("getJNDIProperties", new
Property(JsonTags.JMS_JNDI_PROPERTIES, Properties.class));
@@ -225,7 +225,6 @@ public class JsonToBean {
else if (prop.type == CoordinatorJob.class) {
return createCoordinatorJobList((JSONArray)
json.get(prop.label));
}
-
else {
throw new RuntimeException("Unsupported list type : " +
prop.type.getSimpleName());
}
@@ -264,6 +263,15 @@ public class JsonToBean {
}
return props;
}
+ else if (type == CoordinatorJob.class) {
+ return createCoordinatorJob((JSONObject) obj);
+ }
+ else if (type == CoordinatorAction.class) {
+ return createCoordinatorAction((JSONObject) obj);
+ }
+ else if (type == BundleJob.class) {
+ return createBundleJob((JSONObject) obj);
+ }
else {
throw new RuntimeException("Unsupported type : " +
type.getSimpleName());
}
@@ -431,6 +439,18 @@ public class JsonToBean {
}
/**
+ * Creates a Bulk response object from a JSON object.
+ *
+ * @param json json object.
+ * @return a Bulk response object populated with the JSON object values.
+ */
+ public static BulkResponse createBulkResponse(JSONObject json) {
+ return (BulkResponse)
Proxy.newProxyInstance(JsonToBean.class.getClassLoader(),
+ new
Class[]{BulkResponse.class},
+ new
JsonInvocationHandler(BULK_RESPONSE, json));
+ }
+
+ /**
* Creates a list of bulk response beans from a JSON array.
*
* @param json json array.
@@ -439,11 +459,9 @@ public class JsonToBean {
public static List<BulkResponse> createBulkResponseList(JSONArray json) {
List<BulkResponse> list = new ArrayList<BulkResponse>();
for (Object obj : json) {
- BulkResponse bulkObj = (BulkResponse) Proxy.newProxyInstance
- (JsonToBean.class.getClassLoader(), new
Class[]{BulkResponse.class},
- new JsonInvocationHandler(BULK_RESPONSE, (JSONObject)
obj));
- list.add(bulkObj);
+ list.add(createBulkResponse((JSONObject) obj));
}
return list;
}
+
}
Modified:
oozie/trunk/client/src/test/java/org/apache/oozie/client/rest/TestJsonToBean.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/client/src/test/java/org/apache/oozie/client/rest/TestJsonToBean.java?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
---
oozie/trunk/client/src/test/java/org/apache/oozie/client/rest/TestJsonToBean.java
(original)
+++
oozie/trunk/client/src/test/java/org/apache/oozie/client/rest/TestJsonToBean.java
Thu May 9 22:22:54 2013
@@ -17,11 +17,16 @@
*/
package org.apache.oozie.client.rest;
+import java.util.List;
+import java.util.Properties;
+
import junit.framework.TestCase;
+
+import org.apache.oozie.client.BulkResponse;
+import org.apache.oozie.client.BundleJob;
import org.apache.oozie.client.CoordinatorAction;
import org.apache.oozie.client.CoordinatorJob;
import org.apache.oozie.client.JMSConnectionInfo;
-import org.apache.oozie.client.JMSConnectionInfoWrapper;
import org.apache.oozie.client.WorkflowAction;
import org.apache.oozie.client.WorkflowJob;
import org.apache.oozie.client.event.Event;
@@ -29,9 +34,6 @@ import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
-import java.util.List;
-import java.util.Properties;
-
public class TestJsonToBean extends TestCase {
static String CREATED_TIME = "Thu, 01 Jan 2009 00:00:00 GMT";
@@ -347,4 +349,85 @@ public class TestJsonToBean extends Test
}
+ @SuppressWarnings("unchecked")
+ private JSONObject createJsonBulkResponse() {
+ JSONObject bulk = new JSONObject();
+ JSONObject bundle = new JSONObject();
+ JSONObject coord = createJsonCoordinatorJob();
+ JSONObject action = createJsonCoordinatorAction();
+
+ bundle.put(JsonTags.BUNDLE_JOB_NAME, "bundle-app");
+ bundle.put(JsonTags.BUNDLE_JOB_ID, "bundle-id");
+ bundle.put(JsonTags.BUNDLE_JOB_STATUS,
BundleJob.Status.RUNNING.name());
+ coord.put(JsonTags.COORDINATOR_JOB_NAME, "coord-app");
+ coord.put(JsonTags.COORDINATOR_JOB_STATUS,
CoordinatorJob.Status.SUSPENDED.name());
+ action.put(JsonTags.COORDINATOR_ACTION_ID, "action-id");
+ action.put(JsonTags.COORDINATOR_JOB_ID, "coord-id");
+ action.put(JsonTags.COORDINATOR_ACTION_NUMBER, (long)1);
+ action.put(JsonTags.COORDINATOR_ACTION_EXTERNALID,
"action-externalId");
+ action.put(JsonTags.COORDINATOR_ACTION_STATUS,
CoordinatorAction.Status.FAILED.name());
+ action.put(JsonTags.COORDINATOR_ACTION_EXTERNAL_STATUS,
"action-externalStatus");
+ action.put(JsonTags.COORDINATOR_ACTION_ERROR_CODE, "action-errorCode");
+ action.put(JsonTags.COORDINATOR_ACTION_ERROR_MESSAGE,
"action-errorMessage");
+ action.put(JsonTags.COORDINATOR_ACTION_CREATED_TIME, CREATED_TIME);
+ action.put(JsonTags.COORDINATOR_ACTION_NOMINAL_TIME, NOMINAL_TIME);
+ action.put(JsonTags.COORDINATOR_ACTION_MISSING_DEPS,
"action-missingDeps");
+
+ bulk.put(JsonTags.BULK_RESPONSE_BUNDLE, bundle);
+ bulk.put(JsonTags.BULK_RESPONSE_COORDINATOR, coord);
+ bulk.put(JsonTags.BULK_RESPONSE_ACTION, action);
+ return bulk;
+ }
+
+ @SuppressWarnings("unchecked")
+ private JSONArray createJsonBulkResponseList() {
+ JSONObject json1 = createJsonBulkResponse();
+ JSONObject coord1 = (JSONObject)
json1.get(JsonTags.BULK_RESPONSE_COORDINATOR);
+ coord1.put(JsonTags.COORDINATOR_JOB_ID, "cj1");
+ JSONObject json2 = createJsonBulkResponse();
+ JSONObject coord2 = (JSONObject)
json2.get(JsonTags.BULK_RESPONSE_COORDINATOR);
+ coord2.put(JsonTags.COORDINATOR_JOB_ID, "cj2");
+ JSONArray array = new JSONArray();
+ array.add(json1);
+ array.add(json2);
+ return array;
+ }
+
+ public void testParseBulkResponse() {
+ JSONObject json = createJsonBulkResponse();
+
+ BundleJob bulkBundle = JsonToBean.createBundleJob((JSONObject)
json.get(JsonTags.BULK_RESPONSE_BUNDLE));
+ CoordinatorJob bulkCoord =
JsonToBean.createCoordinatorJob((JSONObject)
json.get(JsonTags.BULK_RESPONSE_COORDINATOR));
+ CoordinatorAction bulkAction =
JsonToBean.createCoordinatorAction((JSONObject)
json.get(JsonTags.BULK_RESPONSE_ACTION));
+
+ assertNotNull(bulkBundle);
+ assertNotNull(bulkCoord);
+ assertNotNull(bulkAction);
+ assertEquals("bundle-app", bulkBundle.getAppName());
+ assertEquals("bundle-id", bulkBundle.getId());
+ assertEquals(BundleJob.Status.RUNNING, bulkBundle.getStatus());
+ assertEquals("coord-app", bulkCoord.getAppName());
+ assertEquals(CoordinatorJob.Status.SUSPENDED, bulkCoord.getStatus());
+ assertEquals("action-id", bulkAction.getId());
+ assertEquals("coord-id", bulkAction.getJobId());
+ assertEquals(1, bulkAction.getActionNumber());
+ assertEquals("action-externalId", bulkAction.getExternalId());
+ assertEquals(CoordinatorAction.Status.FAILED, bulkAction.getStatus());
+ assertEquals("action-externalStatus", bulkAction.getExternalStatus());
+ assertEquals("action-errorCode", bulkAction.getErrorCode());
+ assertEquals("action-errorMessage", bulkAction.getErrorMessage());
+ assertEquals(JsonUtils.parseDateRfc822(CREATED_TIME),
bulkAction.getCreatedTime());
+ assertEquals(JsonUtils.parseDateRfc822(NOMINAL_TIME),
bulkAction.getNominalTime());
+ assertEquals("action-missingDeps",
bulkAction.getMissingDependencies());
+ }
+
+ public void testParseBulkResponseList() {
+ JSONArray array = createJsonBulkResponseList();
+ List<BulkResponse> list = JsonToBean.createBulkResponseList(array);
+
+ assertEquals(2, list.size());
+ assertEquals("cj1", list.get(0).getCoordinator().getId());
+ assertEquals("cj2", list.get(1).getCoordinator().getId());
+ }
+
}
Modified: oozie/trunk/core/src/main/java/org/apache/oozie/BundleJobBean.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/BundleJobBean.java?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
--- oozie/trunk/core/src/main/java/org/apache/oozie/BundleJobBean.java
(original)
+++ oozie/trunk/core/src/main/java/org/apache/oozie/BundleJobBean.java Thu May
9 22:22:54 2013
@@ -68,7 +68,7 @@ import org.apache.openjpa.persistence.jd
@NamedQuery(name = "GET_COMPLETED_BUNDLE_JOBS_OLDER_THAN", query =
"select w.id from BundleJobBean w where ( w.status = 'SUCCEEDED' OR w.status =
'FAILED' OR w.status = 'KILLED' OR w.status = 'DONEWITHERROR') AND
w.lastModifiedTimestamp <= :lastModTime order by w.lastModifiedTimestamp"),
- @NamedQuery(name = "BULK_MONITOR_BUNDLE_QUERY", query = "SELECT b.id,
b.status FROM BundleJobBean b WHERE b.appName = :appName"),
+ @NamedQuery(name = "BULK_MONITOR_BUNDLE_QUERY", query = "SELECT b.id,
b.status, b.user FROM BundleJobBean b WHERE b.appName = :appName"),
// Join query
@NamedQuery(name = "BULK_MONITOR_ACTIONS_QUERY", query = "SELECT a.id,
a.actionNumber, a.errorCode, a.errorMessage, a.externalId, " +
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/client/rest/BulkResponseImpl.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/client/rest/BulkResponseImpl.java?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
---
oozie/trunk/core/src/main/java/org/apache/oozie/client/rest/BulkResponseImpl.java
(original)
+++
oozie/trunk/core/src/main/java/org/apache/oozie/client/rest/BulkResponseImpl.java
Thu May 9 22:22:54 2013
@@ -80,25 +80,6 @@ public class BulkResponseImpl implements
json.put(JsonTags.BULK_RESPONSE_COORDINATOR,
coordinator.toJSONObject());
json.put(JsonTags.BULK_RESPONSE_ACTION, action.toJSONObject());
- json.put(JsonTags.BUNDLE_JOB_NAME, bundle.getAppName());
- json.put(JsonTags.BUNDLE_JOB_ID, bundle.getId());
- json.put(JsonTags.BUNDLE_JOB_STATUS, bundle.getStatus().toString());
-
- json.put(JsonTags.COORDINATOR_JOB_NAME, coordinator.getAppName());
- json.put(JsonTags.COORDINATOR_JOB_STATUS,
coordinator.getStatus().toString());
-
- json.put(JsonTags.COORDINATOR_ACTION_ID, action.getId());
- json.put(JsonTags.COORDINATOR_JOB_ID, action.getJobId());
- json.put(JsonTags.COORDINATOR_ACTION_NUMBER, action.getActionNumber());
- json.put(JsonTags.COORDINATOR_ACTION_EXTERNALID,
action.getExternalId());
- json.put(JsonTags.COORDINATOR_ACTION_STATUS,
action.getStatus().toString());
- json.put(JsonTags.COORDINATOR_ACTION_EXTERNAL_STATUS,
action.getExternalStatus());
- json.put(JsonTags.COORDINATOR_ACTION_ERROR_CODE,
action.getErrorCode());
- json.put(JsonTags.COORDINATOR_ACTION_ERROR_MESSAGE,
action.getErrorMessage());
- json.put(JsonTags.COORDINATOR_ACTION_CREATED_TIME,
action.getCreatedTime().toString());
- json.put(JsonTags.COORDINATOR_ACTION_NOMINAL_TIME,
action.getNominalTime().toString());
- json.put(JsonTags.COORDINATOR_ACTION_MISSING_DEPS,
action.getMissingDependencies());
-
return json;
}
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkJPAExecutor.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkJPAExecutor.java?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
---
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkJPAExecutor.java
(original)
+++
oozie/trunk/core/src/main/java/org/apache/oozie/executor/jpa/BulkJPAExecutor.java
Thu May 9 22:22:54 2013
@@ -294,6 +294,9 @@ public class BulkJPAExecutor implements
if (barr[1] != null) {
bean.setStatus(BundleJob.Status.valueOf((String) barr[1]));
}
+ if (barr[2] != null) {
+ bean.setUser((String) barr[2]);
+ }
return bean;
}
Modified:
oozie/trunk/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
URL:
http://svn.apache.org/viewvc/oozie/trunk/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
--- oozie/trunk/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
(original)
+++ oozie/trunk/core/src/main/java/org/apache/oozie/servlet/V1JobsServlet.java
Thu May 9 22:22:54 2013
@@ -43,7 +43,6 @@ import org.apache.oozie.WorkflowJobBean;
import org.apache.oozie.WorkflowsInfo;
import org.apache.oozie.cli.OozieCLI;
import org.apache.oozie.client.OozieClient;
-import org.apache.oozie.client.XOozieClient;
import org.apache.oozie.client.rest.BulkResponseImpl;
import org.apache.oozie.client.rest.JsonTags;
import org.apache.oozie.client.rest.RestConstants;
@@ -416,9 +415,9 @@ public class V1JobsServlet extends BaseJ
BundleEngine bundleEngine =
Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
getAuthToken(request));
BulkResponseInfo bulkResponse =
bundleEngine.getBulkJobs(bulkFilter, start, len);
- List<BulkResponseImpl> jsonResponse = bulkResponse.getResponses();
+ List<BulkResponseImpl> responsesToJson =
bulkResponse.getResponses();
- json.put(JsonTags.BULK_RESPONSES,
BulkResponseImpl.toJSONArray(jsonResponse, timeZoneId));
+ json.put(JsonTags.BULK_RESPONSES,
BulkResponseImpl.toJSONArray(responsesToJson, timeZoneId));
json.put(JsonTags.BULK_RESPONSE_TOTAL, bulkResponse.getTotal());
json.put(JsonTags.BULK_RESPONSE_OFFSET, bulkResponse.getStart());
json.put(JsonTags.BULK_RESPONSE_LEN, bulkResponse.getLen());
Modified: oozie/trunk/docs/src/site/twiki/DG_CommandLineTool.twiki
URL:
http://svn.apache.org/viewvc/oozie/trunk/docs/src/site/twiki/DG_CommandLineTool.twiki?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
--- oozie/trunk/docs/src/site/twiki/DG_CommandLineTool.twiki (original)
+++ oozie/trunk/docs/src/site/twiki/DG_CommandLineTool.twiki Thu May 9
22:22:54 2013
@@ -617,17 +617,79 @@ Example:
<verbatim>
$ oozie jobs -oozie http://localhost:11000/oozie -jobtype bundle
Job ID Bundle Name Status Kickoff
Created User Group
-------------------------------------------------------------------------------------------------------------------------------------
+.------------------------------------------------------------------------------------------------------------------------------------
0000027-110322105610515-oozie-chao-B BUNDLE-TEST RUNNING 2012-01-15
00:24 2011-03-22 18:07 joe users
-------------------------------------------------------------------------------------------------------------------------------------
+.------------------------------------------------------------------------------------------------------------------------------------
0000001-110322105610515-oozie-chao-B BUNDLE-TEST RUNNING 2012-01-15
00:24 2011-03-22 18:06 joe users
-------------------------------------------------------------------------------------------------------------------------------------
+.------------------------------------------------------------------------------------------------------------------------------------
0000000-110322105610515-oozie-chao-B BUNDLE-TEST
DONEWITHERROR2012-01-15 00:24 2011-03-22 17:58 joe users
-------------------------------------------------------------------------------------------------------------------------------------
+.------------------------------------------------------------------------------------------------------------------------------------
</verbatim>
The =jobtype= option specified the job type to display, default value is 'wf'.
To see the bundle jobs, value is 'bundle'.
+---+++ Bulk monitoring for jobs launched via Bundles
+
+* This command-line query helps to directly query for a bulk of jobs using a
set of rich filters.
+The jobs need to have a parent *Bundle*, and this performs a deep query to
provide results about all the workflows that satisfy your filters.
+These results display relevant job-ids, app-names, and error message (if any)
and are most helpful when you need to monitor a bulk of jobs and get a gist,
+while avoiding typing multiple queries.
+
+This feature is only supported in Oozie 3.3 or later.
+
+Example 1:
+
+<verbatim>
+$ oozie jobs -oozie http://localhost:11000/oozie -bulk bundle=bundle-app-1
+.
+Bundle Name Bundle ID Coord Name Coord Action ID
External ID Status
Created Time Error Message
+.-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+bundle-app-1 0000000-130408151805946-oozie-chit-B coord-1
0000001-130408151805946-oozie-chit-C@1 0000002-130408151805946-oozie-chit-W
KILLED 2013-04-08 22:20 GMT null
+.-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+</verbatim>
+
+Example 2: This example illustrates giving multiple arguments and -verbose
option.
+
+_NOTE: The filter string after -bulk should be enclosed within quotes_
+
+<verbatim>
+.
+$ oozie jobs -oozie http://localhost:11000/oozie -bulk
'bundle=bundle-app-2;actionstatus=SUCCEEDED' -verbose
+.
+Bundle Name : bundle-app-2
+.------------------------------------------------------------------------------------------------------------------------------------
+Bundle ID : 0000000-130422184245158-oozie-chit-B
+Coordinator Name : coord-1
+Coord Action ID : 0000001-130422184245158-oozie-chit-C@1
+Action Status : SUCCEEDED
+External ID : 0000002-130422184245158-oozie-chit-W
+Created Time : 2013-04-23 01:43 GMT
+User : user_xyz
+Error Message : -
+.------------------------------------------------------------------------------------------------------------------------------------
+</verbatim>
+
+You can type 'help' to view usage for the CLI options and filters available.
Namely:
+
+ * bundle: Bundle app-name (mandatory)
+ * coordinators: multiple, comma-separated Coordinator app-names. By
default, if none specified, all coordinators pertaining to the bundle are
included
+ * actionstatus: status of jobs (default job-type is coordinator action aka
workflow job) you wish to filter on. Default value is (KILLED,FAILED)
+ * startcreatedtime/endcreatedtime: specify boundaries for the created-time.
Only jobs created within this window are included.
+ * startscheduledtime/endscheduledtime: specify boundaries for the
nominal-time. Only jobs scheduled to run within this window are included.
+
+<verbatim>
+$ oozie jobs <OPTIONS> : jobs status
+ -bulk <arg> key-value pairs to filter bulk jobs
response. e.g.
+
bundle=<B>\;coordinators=<C>\;actionstatus=<S>\;
+ startcreatedtime=<SC>\;endcreatedtime=<EC>\;
+
startscheduledtime=<SS>\;endscheduledtime=<ES>\;
+ coordinators and actionstatus can be
multiple comma
+ separated values. "bundle" and
"coordinators" are 'names' of those jobs.
+ Bundle name is mandatory, other params are
optional
+</verbatim>
+
+Similar to the usual jobs filter, different filter arguments here should be
separated by semicolon (;).
+
---++ Admin Operations
---+++ Checking the Status of the Oozie System
Modified: oozie/trunk/release-log.txt
URL:
http://svn.apache.org/viewvc/oozie/trunk/release-log.txt?rev=1480814&r1=1480813&r2=1480814&view=diff
==============================================================================
--- oozie/trunk/release-log.txt (original)
+++ oozie/trunk/release-log.txt Thu May 9 22:22:54 2013
@@ -1,5 +1,6 @@
-- Oozie 4.1.0 release (trunk - unreleased)
+OOZIE-1303 CLI API for Bulk Monitoring (mona)
OOZIE-611 distcp action does not have documentation (rkanter)
OOZIE-1318 Action Main classes should be overridable via action configuration
settings (rkanter)
OOZIE-1347 Additions to JMS topic API (virag)