def _from_local_file_data(self, run_id, key, io_type, local_file_data): is_complete = self.is_watch_completed(run_id, key) path = ('s3://{}/{}'.format(self._s3_bucket, self._bucket_key(run_id, key, io_type)) if is_complete else local_file_data.path) return ComputeLogFileData( path, local_file_data.data, local_file_data.cursor, local_file_data.size, self.download_url(run_id, key, io_type), )
def _from_local_file_data(self, run_id, key, io_type, local_file_data): is_complete = self.is_watch_completed(run_id, key) path = ( "https://{account}.blob.core.windows.net/{container}/{key}".format( account=self._storage_account, container=self._container, key=self._blob_key(run_id, key, io_type), ) if is_complete else local_file_data.path) return ComputeLogFileData( path, local_file_data.data, local_file_data.cursor, local_file_data.size, self.download_url(run_id, key, io_type), )
def read_logs_file(self, run_id, key, io_type, cursor=0, max_bytes=MAX_BYTES_FILE_READ): return ComputeLogFileData( path="{}.{}".format(key, io_type), data=None, cursor=0, size=0, download_url=None )