You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2016/12/15 14:47:00 UTC
svn commit: r1774481 - in /uima/uima-ducc/trunk/src/main/admin: check_ducc
ducc_util.py
Author: degenaro
Date: Thu Dec 15 14:47:00 2016
New Revision: 1774481
URL: http://svn.apache.org/viewvc?rev=1774481&view=rev
Log:
UIMA-5193 DUCC failover support (static)
- enhance ducc_util.py with new verify_head_failover_configuration()
- enhance check_ducc -c to employ verify_head_failover_configuration()
check_ducc will complain if head node and configured failover node(s) are in incompatible node pools
Modified:
uima/uima-ducc/trunk/src/main/admin/check_ducc
uima/uima-ducc/trunk/src/main/admin/ducc_util.py
Modified: uima/uima-ducc/trunk/src/main/admin/check_ducc
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/check_ducc?rev=1774481&r1=1774480&r2=1774481&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/check_ducc (original)
+++ uima/uima-ducc/trunk/src/main/admin/check_ducc Thu Dec 15 14:47:00 2016
@@ -334,6 +334,11 @@ class CheckDucc(DuccUtil):
else:
print "NOTOK: Errors in class or node configuration."
+ if self.verify_head_failover_configuration():
+ print "OK: Failover configuration checked"
+ else:
+ print "NOTOK: Errors in failover configuration."
+
return
# checking starts here
Modified: uima/uima-ducc/trunk/src/main/admin/ducc_util.py
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/ducc_util.py?rev=1774481&r1=1774480&r2=1774481&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/ducc_util.py (original)
+++ uima/uima-ducc/trunk/src/main/admin/ducc_util.py Thu Dec 15 14:47:00 2016
@@ -1010,6 +1010,33 @@ class DuccUtil(DuccBase):
#print 'status: '+str(status)
return result
+ def verify_head_failover_configuration(self):
+ rc = 0
+ failover_nodes = self.ducc_properties.get('ducc.head.failover')
+ message = "OK: Head node failover not configured."
+ if(failover_nodes != None):
+ failover_nodes = failover_nodes.strip()
+ if(len(failover_nodes) >= 0):
+ nodes = failover_nodes.split()
+ head_node = self.ducc_properties.get('ducc.head')
+ head_pool = self.get_nodepool(head_node)
+ mismatch = False
+ for node in nodes:
+ node_pool = self.get_nodepool(node,'<None>')
+ if( head_pool != node_pool):
+ if(not mismatch):
+ message = 'OK: Head failover node '+head_node+' in node pool '+head_pool
+ print message
+ message = 'NOTOK: Head failover node '+node+' in node pool '+node_pool
+ print message
+ mismatch = True
+ if mismatch:
+ message = "NOTOK: Head failover nodepools incorrectly configured."
+ else:
+ message = "OK: Head failover nodepools correctly configured."
+ print message
+ return (rc == 0)
+
def disable_threading(self):
global use_threading
use_threading = False