class_docstr: Read-through / write-through cache for MLMD executions.
docstr: Writes execution to MLMD and updates cache.
docstr_tok: ["Writes","execution","to","MLMD","and","updates","cache","."]
code: def put_execution(
      self,
      mlmd_handle: metadata.Metadata,
      execution: metadata_store_pb2.Execution,
      field_mask_paths: Optional[list[str]] = None,
  ) -> None:
      """Writes execution to MLMD and updates cache."""
      mlmd_handle.store.put_executions([execution], field_mask_paths)
      # The execution is fetched from MLMD again to ensure that the in-memory
      # value of `last_update_time_since_epoch` of the execution is same as the
      # one stored in MLMD.
      [execution] = mlmd_handle.store.get_executions_by_id(
          [execution.id]
      )
      with self._lock:
          self._cache[execution.id] = execution
  
imports: import collections
  import contextlib
  import copy
  import threading
  import typing
  from typing import Callable, Iterator, MutableMapping, Optional
  import cachetools
  from tfx.orchestration import metadata
  from google.protobuf.internal import containers
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling the _ExecutionCache obj's underlying member method code with example usage: obj.put_execution(mlmd_handle, execution, field_mask_paths) without return types