def getPushURL(hostId, gateway = None):
"""
Construct the push url based on the hostId in the cluster
hostId: the host (e.g. 192.168.1.1:7777) that will receive the file
gateway: a list of gateway hosts separated by comma
The sequence of this list is from target to source
e.g. if the dataflow is like: source --> A --> B --> C --> target
then, the gateway list should be ordered as: C,B,A
"""
if (gateway):
gateways = gateway.split(',')
gurl = 'http://%s/QARCHIVE' % hostId
for gw in gateways:
gurl = 'http://%s/PARCHIVE?nexturl=%s' % (gw, urllib2.quote(gurl))
#return 'http://%s/PARCHIVE?nexturl=http://%s/QAPLUS' % (gateway, hostId)
return gurl
else:
return 'http://%s/QARCHIVE' % hostId
评论列表
文章目录