def get_completed_ref(self): completed_ref = self.output_ctx.get_completed_ref() if isinstance(completed_ref, SW2_ConcreteReference) and self.make_local_sweetheart: completed_ref = SW2_SweetheartReference.from_concrete( completed_ref, get_own_netloc()) return completed_ref
def publish_fetched_ref(self, fetch): completed_ref = fetch.get_completed_ref() if completed_ref is None: ciel.log("Cancelling async fetch %s (chunk %d)" % (fetch.ref.id, fetch.chunk_size), "EXEC", logging.DEBUG) else: if fetch.make_sweetheart: completed_ref = SW2_SweetheartReference.from_concrete(completed_ref, get_own_netloc()) self.task_record.publish_ref(completed_ref)
def publish_fetched_ref(self, fetch): completed_ref = fetch.get_completed_ref() if completed_ref is None: ciel.log( "Cancelling async fetch %s (chunk %d)" % (fetch.ref.id, fetch.chunk_size), "EXEC", logging.DEBUG) else: if fetch.make_sweetheart: completed_ref = SW2_SweetheartReference.from_concrete( completed_ref, get_own_netloc()) self.task_record.publish_ref(completed_ref)
def open_ref(self, ref, accept_string=False, make_sweetheart=False): """Fetches a reference if it is available, and returns a filename for reading it. Options to do with eagerness, streaming, etc. If reference is unavailable, raises a ReferenceUnavailableException.""" ref = self.task_record.retrieve_ref(ref) if not accept_string: ctx = retrieve_filename_for_ref(ref, self.task_record, return_ctx=True) else: ctx = retrieve_file_or_string_for_ref(ref, self.task_record) if ctx.completed_ref is not None: if make_sweetheart: ctx.completed_ref = SW2_SweetheartReference.from_concrete(ctx.completed_ref, get_own_netloc()) self.task_record.publish_ref(ctx.completed_ref) return ctx.to_safe_dict()
def open_ref(self, ref, accept_string=False, make_sweetheart=False): """Fetches a reference if it is available, and returns a filename for reading it. Options to do with eagerness, streaming, etc. If reference is unavailable, raises a ReferenceUnavailableException.""" ref = self.task_record.retrieve_ref(ref) if not accept_string: ctx = retrieve_filename_for_ref(ref, self.task_record, return_ctx=True) else: ctx = retrieve_file_or_string_for_ref(ref, self.task_record) if ctx.completed_ref is not None: if make_sweetheart: ctx.completed_ref = SW2_SweetheartReference.from_concrete( ctx.completed_ref, get_own_netloc()) self.task_record.publish_ref(ctx.completed_ref) return ctx.to_safe_dict()
def get_completed_ref(self): completed_ref = self.output_ctx.get_completed_ref() if isinstance(completed_ref, SW2_ConcreteReference) and self.make_local_sweetheart: completed_ref = SW2_SweetheartReference.from_concrete(completed_ref, get_own_netloc()) return completed_ref