def _load_version(cls, unpickler, version): """ An abstract function to implement save for the object in consideration. Parameters ---------- pickler : A GLUnpickler archive. """ # Load the dump. obj = unpickler.load() # Construct a new object. new_job = Job(obj.name, stages=obj._stages, final_stage=obj._final_stage, environment=obj.environment, _exec_dir=obj._exec_dir, _task_output_paths=obj._task_output_paths, _job_type = obj._job_type) new = cls(new_job, obj.app_id) cls._resolve_backward_compatibility(version, new._get_version()) lst = ['_exec_dir', '_final_stage', '_pid', '_task_output_paths', '_status', '_task_status', '_typename', 'environment', '_metrics', 'name', '_num_tasks', '_packages', '_stages', '_app_state', '_end_time', '_start_time', '_yarn_AM_state', 'app_id', '_yarn_start_time', '_yarn_end_time'] # Now copy over the useful parts of the dump. _internal_utils.copy_attributes(new, obj, lst) return new
def _load_version(cls, unpickler, version): obj = unpickler.load() new = cls(obj.ec2_config, obj.s3_state_path, obj.name, obj.num_hosts, obj.additional_packages, obj.idle_shutdown_timeout) lst = ['cluster_controller'] _internal_utils.copy_attributes(new, obj, lst) return new
def _load_version(cls, unpickler, version): """ An abstract function to implement save for the object in consideration. Parameters ---------- pickler : A GLUnpickler archive. """ # Load the dump. obj = unpickler.load() # Construct a new object. _data = obj._data new = cls(_data['code'], obj.name, _data['description']) assert obj._get_version() <= new._get_version() # Now copy over the useful parts of the dump. lst = ['_data', '_modified_since_last_saved', '_typename', 'name'] _internal_utils.copy_attributes(new, obj, lst) return new
def _load_version(cls, unpickler, version): """ An abstract function to implement save for the object in consideration. Parameters ---------- pickler : A GLUnpickler file handle. version : Version number. """ # Load the dump. obj = unpickler.load() # Construct a new object. new = cls(obj.name, session_aware = False) assert obj._get_version() <= new._get_version() # Now copy over the useful parts of the dump. lst = ['_env_type'] _internal_utils.copy_attributes(new, obj, lst) return new