def __init__(self, cds_url=None): """ Create a Work Data Service object. Keyword arguments: cds_url -- Reconnect to an existing WDS (optional). """ # Pilot Data self.data_units={} self.pilot_data_services=[] # Pilot Job self.compute_units={} self.pilot_job_services=[] if cds_url == None: self.id=self.CDS_ID_PREFIX + str(uuid.uuid1()) application_url = CoordinationAdaptor.get_base_url(pilot.application_id) self.url = CoordinationAdaptor.add_cds(application_url, self) else: self.id = self.__get_cds_id(cds_url) self.url = cds_url # Background Thread for scheduling self.scheduler = Scheduler() self.cu_queue = Queue.Queue() self.du_queue = Queue.Queue() self.stop=threading.Event() self.scheduler_thread=threading.Thread(target=self._scheduler_thread) self.scheduler_thread.start()