def __init__(self, wds_url=None): """ Create a Work Data Service object. Keyword arguments: wds_url -- Reconnect to an existing WDS (optional). """ # Pilot Data self.pilot_data={} self.pilot_store_services=[] # Pilot Job self.pilot_job_services=[] self.work_units={} if wds_url == None: self.id=self.WDS_ID_PREFIX + str(uuid.uuid1()) application_url = CoordinationAdaptor.get_base_url(bigdata.application_id) self.url = CoordinationAdaptor.add_wds(application_url, self) else: self.id = self.__get_wds_id(wds_url) self.url = wds_url # Background Thread for scheduling self.scheduler = Scheduler() self.wu_queue = Queue.Queue() self.pd_queue = Queue.Queue() self.stop=threading.Event() self.scheduler_thread=threading.Thread(target=self._scheduler_thread) self.scheduler_thread.start()