def createOverlayBridgeData(fileName): overlayBridgeID=getOverlayBridgeID() p = util.Properties() propertiesFile =javaio.FileInputStream(fileName) p.load( propertiesFile) remoteCellName=p.getProperty("cellName") cellAccessPoint=getRemoteCellAccessPoint(remoteCellName,overlayBridgeID) dmgrBootAnchorHost=p.getProperty("dmgrBootAnchorHost") if(dmgrBootAnchorHost!=None and dmgrBootAnchorHost!=""): dmgrBootAnchorPortString=p.getProperty("dmgrBootAnchorPort") dmgrBootAnchorPort=-1 try: dmgrBootAnchorPort=int(dmgrBootAnchorPortString) except(ValueError): print "Skipping entry "+dmgrBootAnchorHost+":"+dmgrBootAnchorPortString+" due to invalid port value" if(dmgrBootAnchorPort>-1): getOverlayEndpoint(cellAccessPoint,dmgrBootAnchorHost,dmgrBootAnchorPort) i=0 while(1): agentBootAnchorHost=p.getProperty("nodeAgentBootAnchorHost."+str(i)) if(agentBootAnchorHost==None or agentBootAnchorHost==""): break agentBootAnchorPortString=p.getProperty("nodeAgentBootAnchorPort."+str(i)) agentBootAnchorPort=-1 try: agentBootAnchorPort=int(agentBootAnchorPortString) except(ValueError): print "Skipping entry "+agentBootAnchorHost+":"+agentBootAnchorPortString+" due to invalid port value" if(agentBootAnchorPort>-1): getOverlayEndpoint(cellAccessPoint,agentBootAnchorHost,agentBootAnchorPort) i=i+1
def removeOverlayBridgeData(fileName): overlayBridgeID=getOverlayBridgeID() p = util.Properties() propertiesFile =javaio.FileInputStream(fileName) p.load( propertiesFile) remoteCellName=p.getProperty("cellName") cellAccessPoint=getRemoteCellAccessPoint(remoteCellName,overlayBridgeID) AdminConfig.remove(cellAccessPoint)
def createOverlayBridgeData(fileName): overlayBridgeID = getOverlayBridgeID() p = util.Properties() propertiesFile = javaio.FileInputStream(fileName) p.load(propertiesFile) remoteCellName = p.getProperty("cellName") # remove exisiting OverlayData associated with the cell - won't throw exception if empty removeOverlayBridgeData(fileName) cellAccessPoint = getRemoteCellAccessPoint(remoteCellName, overlayBridgeID) # do not allow duplicate cells checkForDuplicates(getCellName(), overlayBridgeID) dmgrBootAnchorHost = p.getProperty("dmgrBootAnchorHost") if (dmgrBootAnchorHost != None and dmgrBootAnchorHost != ""): dmgrBootAnchorPortString = p.getProperty("dmgrBootAnchorPort") dmgrBootAnchorPort = -1 try: dmgrBootAnchorPort = int(dmgrBootAnchorPortString) except (ValueError): print "\tSkipping entry " + dmgrBootAnchorHost + ":" + dmgrBootAnchorPortString + " due to invalid port value" if (dmgrBootAnchorPort > -1): getOverlayEndpoint(cellAccessPoint, dmgrBootAnchorHost, dmgrBootAnchorPort) i = 0 while (1): agentBootAnchorHost = p.getProperty("nodeAgentBootAnchorHost." + str(i)) if (agentBootAnchorHost == None or agentBootAnchorHost == ""): break agentBootAnchorPortString = p.getProperty("nodeAgentBootAnchorPort." + str(i)) agentBootAnchorPort = -1 try: agentBootAnchorPort = int(agentBootAnchorPortString) except (ValueError): print "\tSkipping entry " + agentBootAnchorHost + ":" + agentBootAnchorPortString + " due to invalid port value" if (agentBootAnchorPort > -1): getOverlayEndpoint(cellAccessPoint, agentBootAnchorHost, agentBootAnchorPort) i = i + 1
print "Data format: yyyy/MM/dd" sys.exit() tenantCode = sys.argv[1] startDate = sys.argv[2] endDate = sys.argv[3] paramFile = sys.argv[4] minObjectId = globalVars.dateToObjectId(startDate) maxObjectId = globalVars.dateToObjectId(endDate) Pig.registerJar("/usr/hdp/current/phoenix-client/phoenix-client.jar") Pig.registerJar("../lib/yucca-phoenix-pig.jar") try: props = util.Properties() propertiesfis = javaio.FileInputStream("mongo_parameters_prod.txt") props.load(propertiesfis) except: print "Errore leggendo mongo_parameters_prod.txt: ", sys.exc_info()[0] sys.exit(1) mongo1 = props.getProperty('mongoHost') + ":" + props.getProperty( 'mongoPort') + "/DB_SUPPORT" mongo2 = " -u " + props.getProperty('mongoUsr') mongo3 = " -p " + props.getProperty( 'mongoPwd') + ''' --authenticationDatabase admin --quiet --eval "''' callResult = call("mongo " + mongo1 + " " + mongo2 + " " + mongo3 + " var param1='" + tenantCode + "' " + ''' " ../list_tenant_defaults.js > tenant.json''',