Load the object from a JSON file.
(self)
| 53 | return f"redundant_expert: dump expert workload result in {cost_time} us" |
| 54 | |
| 55 | def load(self): |
| 56 | """Load the object from a JSON file.""" |
| 57 | if not os.path.exists(self.meta_file_name): |
| 58 | return {}, f"redundant_expert: file {self.meta_file_name} is not exists" |
| 59 | try: |
| 60 | with open(self.meta_file_name, "r") as fin: |
| 61 | meta = json.load(fin) |
| 62 | self.__dict__.update(meta) |
| 63 | return self.__json__(), "ok" |
| 64 | except Exception as e: |
| 65 | return {}, f"redundant_expert: load file {self.meta_file_name} failed, {e}" |
| 66 | |
| 67 | |
| 68 | def init_eplb_signals(config: FDConfig, ipc_signal_suffix): |