Implements an in-memory action Cache
- class buildgrid.server.actioncache.instance.ActionCache(cache: ActionCacheABC)
- SERVICE_NAME: ClassVar[str] = 'build.bazel.remote.execution.v2.ActionCache'
The expected FULL_NAME of the Service which will wrap this instance. This value should be declared on the class of any Instance implementations.
- setup_grpc() None
A method called when the Service is being attached to a grpc server.
This method may be overriden if extra setup is required.
- start() None
A method called when the grpc service is starting.
This method may be overriden if startup logic is required.
- stop() None
A method called when the grpc service is shutting down.
This method may be overriden if shutdown logic is required.
- property allow_updates: bool
- hash_type() int
- set_instance_name(instance_name: str) None
Set the instance name associated with this instance. This method may be overriden if extra referencing is required.
instance_name (str) – The new instance’s name.
AssertionError – if the instance is already registered.
- get_action_result(action_digest: Digest) ActionResult
Retrieves the cached result for an Action.
If there is no cached result found, returns None.
action_digest (Digest) – The digest of the Action to retrieve the cached result of.
- update_action_result(action_digest: Digest, action_result: ActionResult) None
Stores a result for an Action in the cache.
If the result has a non-zero exit code and cache_failed_actions is False for this cache, the result is not cached.
action_digest (Digest) – The digest of the Action whose result is being cached.
action_result (ActionResult) – The result to cache for the given Action digest.