Author: degenaro
Date: Thu Jun 11 14:54:32 2015
New Revision: 1684911

URL: http://svn.apache.org/r1684911
Log:
UIMA-4458 DUCC Job Driver (JD) is too verbose when config'd at debug level

Added:
    
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionProcessBlacklist.java
   (with props)
Modified:
    
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/blacklist/JobProcessBlacklist.java
    
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/WiFsm.java
    
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/mh/RemoteWorkerProcess.java

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/blacklist/JobProcessBlacklist.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/blacklist/JobProcessBlacklist.java?rev=1684911&r1=1684910&r2=1684911&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/blacklist/JobProcessBlacklist.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/blacklist/JobProcessBlacklist.java
 Thu Jun 11 14:54:32 2015
@@ -81,7 +81,7 @@ public class JobProcessBlacklist {
                                
mb.append(Standardize.Label.pid.get()+rwp.getPid());
                                
mb.append(Standardize.Label.size.get()+map.size());
                                mb.append(Standardize.Label.value.get()+retVal);
-                               logger.debug(location, ILogger.null_id, 
mb.toString());
+                               logger.trace(location, ILogger.null_id, 
mb.toString());
                        }
                }
                return retVal;

Added: 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionProcessBlacklist.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionProcessBlacklist.java?rev=1684911&view=auto
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionProcessBlacklist.java
 (added)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionProcessBlacklist.java
 Thu Jun 11 14:54:32 2015
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+package org.apache.uima.ducc.container.jd.fsm.wi;
+
+import org.apache.uima.ducc.container.common.MessageBuffer;
+import org.apache.uima.ducc.container.common.fsm.iface.IAction;
+import org.apache.uima.ducc.container.common.logger.IComponent;
+import org.apache.uima.ducc.container.common.logger.ILogger;
+import org.apache.uima.ducc.container.common.logger.Logger;
+import org.apache.uima.ducc.container.jd.blacklist.JobProcessBlacklist;
+import org.apache.uima.ducc.container.jd.log.LoggerHelper;
+import org.apache.uima.ducc.container.jd.mh.RemoteWorkerProcess;
+import org.apache.uima.ducc.container.jd.mh.iface.remote.IRemoteWorkerThread;
+
+public class ActionProcessBlacklist extends Action implements IAction {
+
+       private static Logger logger = 
Logger.getLogger(ActionProcessBlacklist.class, IComponent.Id.JD.name());
+       
+       @Override
+       public String getName() {
+               return ActionProcessBlacklist.class.getName();
+       }
+       
+       @Override
+       public void engage(Object objectData) {
+               String location = "engage";
+               logger.trace(location, ILogger.null_id, "");
+               IActionData actionData = (IActionData) objectData;
+               try {
+                       if(actionData != null) {
+                               IRemoteWorkerThread rwt = 
actionData.getRemoteWorkerThread();
+                               if(rwt != null) {
+                                       RemoteWorkerProcess rwp = new 
RemoteWorkerProcess(rwt);
+                                       JobProcessBlacklist jobProcessBlacklist 
= JobProcessBlacklist.getInstance();
+                                       jobProcessBlacklist.add(rwp);
+                               }
+                               else {
+                                       MessageBuffer mb = 
LoggerHelper.getMessageBuffer(actionData);
+                                       mb.append("No remote worker process 
entry found for processing");
+                                       logger.info(location, ILogger.null_id, 
mb.toString());
+                               }
+                       }
+                       else {
+                               MessageBuffer mb = 
LoggerHelper.getMessageBuffer(actionData);
+                               mb.append("No action data found for 
processing");
+                               logger.warn(location, ILogger.null_id, 
mb.toString());
+                       }
+               }
+               catch(Exception e) {
+                       logger.error(location, ILogger.null_id, e);
+               }
+       }
+}

Propchange: 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionProcessBlacklist.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/ActionProcessBlacklist.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/WiFsm.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/WiFsm.java?rev=1684911&r1=1684910&r2=1684911&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/WiFsm.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/fsm/wi/WiFsm.java
 Thu Jun 11 14:54:32 2015
@@ -65,6 +65,7 @@ public class WiFsm extends Fsm {
        public static IAction ActionAckRedux                    = new 
ActionAckRedux();
        public static IAction ActionEnd                                 = new 
ActionEnd();
        
+       public static IAction ActionProcessBlacklist    = new 
ActionProcessBlacklist();
        public static IAction ActionProcessFailure              = new 
ActionProcessFailure();
        public static IAction ActionProcessPreempt              = new 
ActionProcessPreempt();
        public static IAction ActionProcessVolunteered  = new 
ActionProcessVolunteered();
@@ -104,8 +105,8 @@ public class WiFsm extends Fsm {
                add(Start, Ack_Request, ActionError, Start);
                add(Start, End_Request, ActionError, Start);
                add(Start, Process_Preempt, ActionIgnore, Start);
-               add(Start, Process_Volunteered, ActionIgnore, Start);
-               add(Start, Process_Failure, ActionIgnore, Start);
+               add(Start, Process_Volunteered, ActionProcessBlacklist, Start);
+               add(Start, Process_Failure, ActionProcessBlacklist, Start);
                add(Start, Ack_Timer_Pop, ActionIgnore, Start);
                add(Start, End_Timer_Pop, ActionIgnore, Start);
                add(Start, Investment_Reset, ActionIgnore, Start);

Modified: 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/mh/RemoteWorkerProcess.java
URL: 
http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/mh/RemoteWorkerProcess.java?rev=1684911&r1=1684910&r2=1684911&view=diff
==============================================================================
--- 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/mh/RemoteWorkerProcess.java
 (original)
+++ 
uima/sandbox/uima-ducc/trunk/uima-ducc-container/src/main/java/org/apache/uima/ducc/container/jd/mh/RemoteWorkerProcess.java
 Thu Jun 11 14:54:32 2015
@@ -36,6 +36,23 @@ public class RemoteWorkerProcess impleme
        private String pidName = null;
        private int pid = 0;
        
+       public static RemoteWorkerProcess factory(String nodeName, String 
nodeAddress, String pidName, String pid) {
+               String location = "factory";
+               RemoteWorkerProcess rwp = null;
+               try {
+                       rwp = new RemoteWorkerProcess(
+                                       nodeName,
+                                       nodeAddress,
+                                       pidName,
+                                       Integer.parseInt(pid)
+                                       );
+               }
+               catch(Exception e) {
+                       logger.trace(location, ILogger.null_id, e);
+               }
+               return rwp;
+       }
+       
        public RemoteWorkerProcess(IMetaCasRequester metaCasRequester) {
                setNodeName(metaCasRequester.getRequesterNodeName());
                setNodeAddress(metaCasRequester.getRequesterAddress());


Reply via email to