blob: 92c6325c212bac191df99eae15ac41469023f69b [file] [log] [blame]
Philipp Wollermann49c20aa2016-08-25 12:59:52 +00001// Copyright 2016 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.
ulfjack5b99e502017-07-20 22:22:36 +020014package com.google.devtools.build.lib.actions;
Philipp Wollermann49c20aa2016-08-25 12:59:52 +000015
16/** Prefetches files to local disk. */
17public interface ActionInputPrefetcher {
Ulf Adamsd5500a22016-11-16 09:54:55 +000018 public static final ActionInputPrefetcher NONE =
19 new ActionInputPrefetcher() {
20 @Override
Ulf Adamscffde1b2017-01-18 14:32:14 +000021 public void prefetchFiles(Iterable<? extends ActionInput> input) {
Ulf Adamsd5500a22016-11-16 09:54:55 +000022 // Do nothing.
23 }
24 };
Philipp Wollermann49c20aa2016-08-25 12:59:52 +000025
26 /**
Ulf Adamscffde1b2017-01-18 14:32:14 +000027 * Initiates best-effort prefetching of all given inputs. This should not block.
Philipp Wollermann49c20aa2016-08-25 12:59:52 +000028 *
Ulf Adamscffde1b2017-01-18 14:32:14 +000029 * <p>For any path not under this prefetcher's control, the call should be a no-op.
Philipp Wollermann49c20aa2016-08-25 12:59:52 +000030 */
Ulf Adamscffde1b2017-01-18 14:32:14 +000031 void prefetchFiles(Iterable<? extends ActionInput> input);
Philipp Wollermann49c20aa2016-08-25 12:59:52 +000032}