From 6e72f78e1c2e573787ec862e671f3b3b4c33dc96 Mon Sep 17 00:00:00 2001 From: kush Date: Tue, 18 Jul 2017 01:26:22 +0200 Subject: Small changes to skyframe package. PiperOrigin-RevId: 162288376 --- .../devtools/build/skyframe/ConstantVersion.java | 26 ++++++++++++++++++++++ .../devtools/build/skyframe/InMemoryGraph.java | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/google/devtools/build/skyframe/ConstantVersion.java (limited to 'src/main/java/com/google') diff --git a/src/main/java/com/google/devtools/build/skyframe/ConstantVersion.java b/src/main/java/com/google/devtools/build/skyframe/ConstantVersion.java new file mode 100644 index 0000000000..792f167a6f --- /dev/null +++ b/src/main/java/com/google/devtools/build/skyframe/ConstantVersion.java @@ -0,0 +1,26 @@ +// Copyright 2017 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +package com.google.devtools.build.skyframe; + +/** Use when only a single evaluation of the graph with a single constant version is expected. */ +public class ConstantVersion implements Version { + public static final ConstantVersion INSTANCE = new ConstantVersion(); + + private ConstantVersion() {} + + @Override + public boolean atMost(Version other) { + return this.equals(other); + } +} diff --git a/src/main/java/com/google/devtools/build/skyframe/InMemoryGraph.java b/src/main/java/com/google/devtools/build/skyframe/InMemoryGraph.java index 82ddb17f76..267ae7805b 100644 --- a/src/main/java/com/google/devtools/build/skyframe/InMemoryGraph.java +++ b/src/main/java/com/google/devtools/build/skyframe/InMemoryGraph.java @@ -17,7 +17,7 @@ import java.util.Map; import javax.annotation.Nullable; /** {@link ProcessableGraph} that exposes the contents of the entire graph. */ -interface InMemoryGraph extends ProcessableGraph { +public interface InMemoryGraph extends ProcessableGraph { @Override Map createIfAbsentBatch( @Nullable SkyKey requestor, Reason reason, Iterable keys); -- cgit v1.2.3