示例#1
0
 def __init__(self, pilot_store_service=None, pilot_store_description=None, ps_url=None):    
     """ 
         Initialize PilotStore at given service url:
         
         ssh://<hostname>
         gsissh://<hostname>
         
         Currently only ssh schemes are supported. In the future all 
         SAGA URL schemes/adaptors should be supported.        
     """ 
     self.id = None
     self.url = None
     self.pilot_store_description = None
     self.service_url=None
     self.size = None
     self.pilot_store_description = None
     self.pilot_data={}
     
     if ps_url==None and pilot_store_service!=None:      # new ps          
         self.id = self.PS_ID_PREFIX+str(uuid.uuid1())
         self.pilot_store_description = pilot_store_description
         self.url = CoordinationAdaptor.add_ps(CoordinationAdaptor.get_base_url(bigdata.application_id)+"/"+pilot_store_service.id, self)
     elif ps_url != None:
         logger.warn("Reconnect to PilotStore: %s"%ps_url)
         dictionary = CoordinationAdaptor.get_ps(ps_url)
         ps_dict = dictionary["pilot_store"]
         for i in ps_dict:
             self.__setattr__(i, ps_dict[i])
                     
     self.initialize_pilot_store()
示例#2
0
    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()
示例#3
0
    def __init__(self, pss_url=None):
        """ Create a PilotStoreService

            Keyword arguments:
            pss_id -- restore from pss_id
        """        
        self.pilot_stores={}
        
        if pss_url == None:
            self.id = self.PSS_ID_PREFIX + str(uuid.uuid1())
            application_url = CoordinationAdaptor.get_base_url(bigdata.application_id)
            self.url = CoordinationAdaptor.add_pss(application_url, self)
        else:
            self.id = self.__get_pss_id(pss_url)