Author: degenaro Date: Sat Nov 2 11:06:06 2019 New Revision: 1869292 URL: http://svn.apache.org/viewvc?rev=1869292&view=rev Log: UIMA-6073 DUCC Web Server (WS) should discard "down" machines from machines page
Modified: uima/uima-ducc/trunk/uima-ducc-examples/src/main/scripts/start_sim uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/BasicsHelper.java uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/DnsHelper.java Modified: uima/uima-ducc/trunk/uima-ducc-examples/src/main/scripts/start_sim URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-examples/src/main/scripts/start_sim?rev=1869292&r1=1869291&r2=1869292&view=diff ============================================================================== --- uima/uima-ducc/trunk/uima-ducc-examples/src/main/scripts/start_sim (original) +++ uima/uima-ducc/trunk/uima-ducc-examples/src/main/scripts/start_sim Sat Nov 2 11:06:06 2019 @@ -316,6 +316,8 @@ class StartSim(DuccUtil): if ( len(argv) == 0 ): self.usage(None) + os.environ['DUCC_SIM'] = 'True' + node_config = None components = {} instances = {} Modified: uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/BasicsHelper.java URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/BasicsHelper.java?rev=1869292&r1=1869291&r2=1869292&view=diff ============================================================================== --- uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/BasicsHelper.java (original) +++ uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/BasicsHelper.java Sat Nov 2 11:06:06 2019 @@ -41,4 +41,17 @@ public class BasicsHelper { } return retVal; } + + public static boolean isSim() { + String location = "isSim"; + DuccId jobid = null; + boolean retVal = false; + String ducc_sim_env = System.getenv("DUCC_SIM"); + if(ducc_sim_env != null) { + logger.debug(location, jobid, ducc_sim_env); + Boolean bool = new Boolean(ducc_sim_env); + retVal = bool.booleanValue(); + } + return retVal; + } } Modified: uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/DnsHelper.java URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/DnsHelper.java?rev=1869292&r1=1869291&r2=1869292&view=diff ============================================================================== --- uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/DnsHelper.java (original) +++ uima/uima-ducc/trunk/uima-ducc-web/src/main/java/org/apache/uima/ducc/ws/utils/DnsHelper.java Sat Nov 2 11:06:06 2019 @@ -28,7 +28,7 @@ public class DnsHelper { private static DuccLogger duccLogger = DuccLogger.getLogger(DnsHelper.class); - public static boolean isKnowable() { + private static boolean isKnowable() { String location = "isKnowable"; DuccId jobid = null; boolean retVal = false; @@ -50,7 +50,7 @@ public class DnsHelper { // 0 = unknown // 1 = known - public static int isKnownHost(String hostname) { + private static int isKnownHost(String hostname) { String location = "isKnownHost"; DuccId jobid = null; int retVal = -1; @@ -75,9 +75,14 @@ public class DnsHelper { public static boolean isKnownHost(NodeId nodeId) { boolean retVal = true; - if(nodeId != null) { - if(isKnownHost(nodeId.getLongName()) == 0) { - retVal = false; + if(BasicsHelper.isSim()) { + retVal = true; + } + else { + if(nodeId != null) { + if(isKnownHost(nodeId.getLongName()) == 0) { + retVal = false; + } } } return retVal;