blob: a508e257b8804ba5f709790aa49c79568b88ecdf [file] [log] [blame]
fellyc5c078c2019-07-31 12:05:24 -07001// Copyright 2019 The Bazel Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14package com.google.devtools.build.lib.skyframe;
15
16import com.google.devtools.build.lib.actionsketch.ActionSketch;
17import javax.annotation.Nullable;
18
19/**
20 * A top-down action cache is a cache of {@link ActionSketch} to {@link ActionExecutionValue}.
21 *
22 * <p>Unlike {@link com.google.devtools.build.lib.actions.ActionCacheChecker}, a top-down cache can
23 * cull large subgraphs by computing the transitive cache key (known as the {@link ActionSketch}).
24 */
25public interface TopDownActionCache {
26
27 /** Retrieves the cached value for the given action sketch, or null. */
28 @Nullable
29 ActionExecutionValue get(ActionSketch sketch);
30
31 /** Puts the sketch into the top-down cache. May complete asynchronously. */
32 void put(ActionSketch sketch, ActionExecutionValue value);
33}