本文整理汇总了Python中pilot.coordination.redis_adaptor.RedisCoordinationAdaptor.add_pd方法的典型用法代码示例。如果您正苦于以下问题:Python RedisCoordinationAdaptor.add_pd方法的具体用法?Python RedisCoordinationAdaptor.add_pd怎么用?Python RedisCoordinationAdaptor.add_pd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pilot.coordination.redis_adaptor.RedisCoordinationAdaptor
的用法示例。
在下文中一共展示了RedisCoordinationAdaptor.add_pd方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_pilot
# 需要导入模块: from pilot.coordination.redis_adaptor import RedisCoordinationAdaptor [as 别名]
# 或者: from pilot.coordination.redis_adaptor.RedisCoordinationAdaptor import add_pd [as 别名]
def create_pilot(self, pilot_data_description):
""" Create a PilotData
Keyword arguments:
pilot_data_description -- PilotData Description::
{
'service_url': "ssh://<hostname>/base-url/",
'size': "1000"
}
Return value:
A PilotData object
"""
pd = PilotData(pilot_data_service=self, pilot_data_description=pilot_data_description)
self.pilot_data[pd.id] = pd
# store pilot data in central data space
CoordinationAdaptor.add_pd(self.url, pd)
return pd
示例2: __init__
# 需要导入模块: from pilot.coordination.redis_adaptor import RedisCoordinationAdaptor [as 别名]
# 或者: from pilot.coordination.redis_adaptor.RedisCoordinationAdaptor import add_pd [as 别名]
def __init__(self, pilot_data_service=None, pilot_data_description=None, pd_url=None):
"""
Initialize PilotData at given service url::
ssh://<hostname>
gsissh://<hostname>
go://<hostname>
gs://google.com
s3://aws.amazon.com
In the future more SAGA/Bliss URL schemes/adaptors are supported.
"""
self.id = None
self.url = pd_url
self.pilot_data_description = None
self.pilot_data_service = pilot_data_service
self.service_url = None
self.size = None
self.data_unit_urls = []
self.security_context = None
if pd_url == None and pilot_data_service != None: # new pd
self.id = self.PD_ID_PREFIX + str(uuid.uuid1())
self.pilot_data_description = pilot_data_description
self.url = CoordinationAdaptor.add_pd(
CoordinationAdaptor.get_base_url(application_id) + ":" + pilot_data_service.id, self
)
elif pd_url != None:
logger.warn("Reconnect to PilotData: %s" % pd_url)
dictionary = CoordinationAdaptor.get_pd(pd_url)
if dictionary.has_key("security_context"):
self.security_context = dictionary["security_context"]
pd_dict = eval(dictionary["pilot_data"])
for i in pd_dict:
self.__setattr__(i, pd_dict[i])
# A Pilot Data does not hold a direct reference to a Data Unit (only URL refs are stored)
self.data_unit_urls = eval(dictionary["data_unit_urls"])
self.__initialize_pilot_data()
CoordinationAdaptor.update_pd(self)