Philipp Wollermann | 49c20aa | 2016-08-25 12:59:52 +0000 | [diff] [blame] | 1 | // 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. |
ulfjack | 5b99e50 | 2017-07-20 22:22:36 +0200 | [diff] [blame] | 14 | package com.google.devtools.build.lib.actions; |
Philipp Wollermann | 49c20aa | 2016-08-25 12:59:52 +0000 | [diff] [blame] | 15 | |
| 16 | /** Prefetches files to local disk. */ |
| 17 | public interface ActionInputPrefetcher { |
Ulf Adams | d5500a2 | 2016-11-16 09:54:55 +0000 | [diff] [blame] | 18 | public static final ActionInputPrefetcher NONE = |
| 19 | new ActionInputPrefetcher() { |
| 20 | @Override |
Ulf Adams | cffde1b | 2017-01-18 14:32:14 +0000 | [diff] [blame] | 21 | public void prefetchFiles(Iterable<? extends ActionInput> input) { |
Ulf Adams | d5500a2 | 2016-11-16 09:54:55 +0000 | [diff] [blame] | 22 | // Do nothing. |
| 23 | } |
| 24 | }; |
Philipp Wollermann | 49c20aa | 2016-08-25 12:59:52 +0000 | [diff] [blame] | 25 | |
| 26 | /** |
Ulf Adams | cffde1b | 2017-01-18 14:32:14 +0000 | [diff] [blame] | 27 | * Initiates best-effort prefetching of all given inputs. This should not block. |
Philipp Wollermann | 49c20aa | 2016-08-25 12:59:52 +0000 | [diff] [blame] | 28 | * |
Ulf Adams | cffde1b | 2017-01-18 14:32:14 +0000 | [diff] [blame] | 29 | * <p>For any path not under this prefetcher's control, the call should be a no-op. |
Philipp Wollermann | 49c20aa | 2016-08-25 12:59:52 +0000 | [diff] [blame] | 30 | */ |
Ulf Adams | cffde1b | 2017-01-18 14:32:14 +0000 | [diff] [blame] | 31 | void prefetchFiles(Iterable<? extends ActionInput> input); |
Philipp Wollermann | 49c20aa | 2016-08-25 12:59:52 +0000 | [diff] [blame] | 32 | } |