You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@edgent.apache.org by vd...@apache.org on 2016/05/11 16:43:47 UTC

incubator-quarks git commit: Remove JobMXBean.State and JobMXBean.Health

Repository: incubator-quarks
Updated Branches:
  refs/heads/master 27d9c53ee -> db196c185


Remove JobMXBean.State and JobMXBean.Health


Project: http://git-wip-us.apache.org/repos/asf/incubator-quarks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quarks/commit/db196c18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quarks/tree/db196c18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quarks/diff/db196c18

Branch: refs/heads/master
Commit: db196c18530cbcc2f70c7e8fe1837db9b9ea8e36
Parents: 27d9c53
Author: Victor Dogaru <vd...@apache.org>
Authored: Tue May 10 11:55:27 2016 -0700
Committer: Victor Dogaru <vd...@apache.org>
Committed: Wed May 11 09:00:53 2016 -0700

----------------------------------------------------------------------
 .../java/quarks/execution/mbeans/JobMXBean.java | 64 +++-----------------
 .../runtime/etiao/mbeans/EtiaoJobBean.java      | 14 +++--
 2 files changed, 15 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/db196c18/api/execution/src/main/java/quarks/execution/mbeans/JobMXBean.java
----------------------------------------------------------------------
diff --git a/api/execution/src/main/java/quarks/execution/mbeans/JobMXBean.java b/api/execution/src/main/java/quarks/execution/mbeans/JobMXBean.java
index 7386537..40e099f 100644
--- a/api/execution/src/main/java/quarks/execution/mbeans/JobMXBean.java
+++ b/api/execution/src/main/java/quarks/execution/mbeans/JobMXBean.java
@@ -18,8 +18,11 @@ under the License.
 */
 package quarks.execution.mbeans;
 
+
+import quarks.execution.Job;
 import quarks.execution.Job.Action;
 
+
 /**
  * Control interface for a job.
  */
@@ -31,59 +34,6 @@ public interface JobMXBean {
     String TYPE = "job";
 
     /**
-     * Enumeration for the current status of the job.
-     */
-    enum State {  
-        /** Initial state, the graph nodes are not yet initialized. */
-        CONSTRUCTED, 
-        /** All the graph nodes have been initialized. */
-        INITIALIZED,
-        /** All the graph nodes are processing data. */
-        RUNNING,
-        /** All the graph nodes are paused. */
-        PAUSED, 
-        /** All the graph nodes are closed. */
-        CLOSED;
-    }
-    
-    /**
-     * Enumeration for the current job health indicator.
-     */
-    enum Health {  
-        /** 
-         * All graph nodes in the job are healthy.
-         */
-        HEALTHY,
-        /** 
-         * The execution of at least one graph node in the job has stopped
-         * because of an abnormal condition.
-         */
-        UNHEALTHY;
-        
-        /**
-         * Converts from a string representation of a job health to the corresponding enumeration value.
-         * 
-         * @param health specifies a job health string value.
-         * 
-         * @return the corresponding {@code Health} enumeration value.
-         * 
-         * @throws IllegalArgumentException if the input string does not map to an enumeration value.
-         * @throws NullPointerException if the input value is null.
-         */
-        static public Health fromString(String health) {
-            if (health ==  null) {
-                throw new NullPointerException("health");  
-            }
-            for (Health value : Health.values()) {
-                if (value.name().equals(health)) {
-                    return value;
-                }
-            }
-            throw new IllegalArgumentException(health);
-        }
-    }
-
-    /**
      * Returns the identifier of the job.
      * 
      * @return the job identifier.
@@ -102,7 +52,7 @@ public interface JobMXBean {
      *
      * @return the current state.
      */
-    State getCurrentState();
+    Job.State getCurrentState();
 
     /**
      * Retrieves the next execution state when the job makes a state 
@@ -110,14 +60,14 @@ public interface JobMXBean {
      *
      * @return the destination state while in a state transition.
      */
-    State getNextState();
+    Job.State getNextState();
 
     /**
      * Returns the summarized health indicator of the job.  
      * 
      * @return the summarized Job health.
      */
-    Health getHealth();
+    Job.Health getHealth();
 
     /**
      * Returns the last error message caught by the current job execution.  
@@ -152,7 +102,7 @@ public interface JobMXBean {
      * @return a JSON-formatted string representing the running graph. 
      */
     String graphSnapshot();
-    
+
     /**
      * Initiates an execution state change.
      * 

http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/db196c18/runtime/etiao/src/main/java/quarks/runtime/etiao/mbeans/EtiaoJobBean.java
----------------------------------------------------------------------
diff --git a/runtime/etiao/src/main/java/quarks/runtime/etiao/mbeans/EtiaoJobBean.java b/runtime/etiao/src/main/java/quarks/runtime/etiao/mbeans/EtiaoJobBean.java
index 4e66d1d..2fa89cf 100644
--- a/runtime/etiao/src/main/java/quarks/runtime/etiao/mbeans/EtiaoJobBean.java
+++ b/runtime/etiao/src/main/java/quarks/runtime/etiao/mbeans/EtiaoJobBean.java
@@ -21,6 +21,7 @@ package quarks.runtime.etiao.mbeans;
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 
+import quarks.execution.Job;
 import quarks.execution.Job.Action;
 import quarks.execution.mbeans.JobMXBean;
 import quarks.runtime.etiao.EtiaoJob;
@@ -46,13 +47,13 @@ public class EtiaoJobBean implements JobMXBean {
     }
 
     @Override
-    public State getCurrentState() {
-        return State.valueOf(job.getCurrentState().name());
+    public Job.State getCurrentState() {
+        return job.getCurrentState();
     }
 
     @Override
-    public State getNextState() {
-        return State.valueOf(job.getNextState().name());
+    public Job.State getNextState() {
+        return job.getNextState();
     }
 
     @Override
@@ -62,14 +63,15 @@ public class EtiaoJobBean implements JobMXBean {
     }
 
     @Override
-    public Health getHealth() {
-        return Health.fromString(job.getHealth().name());
+    public Job.Health getHealth() {
+        return job.getHealth();
     }
 
     @Override
     public String getLastError() {
         return job.getLastError();
     }
+
     @Override
     public void stateChange(Action action) {
         job.stateChange(action);