blob: e4ad0ec70413b1bd6220a005af8f3b447bb14355 [file] [log] [blame]
Damien Martin-Guillerezf88f4d82015-09-25 13:56:55 +00001// Copyright 2014 The Bazel Authors. All rights reserved.
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +01002//
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.pkgcache;
15
Ulf Adamsde3e9d52016-02-10 12:07:44 +000016import com.google.common.base.Preconditions;
17import com.google.common.collect.ImmutableSet;
Lukacs Berki6e91eb92015-09-21 09:12:37 +000018import com.google.devtools.build.lib.cmdline.Label;
Klaus Aehlig949b7b52017-02-27 13:56:15 +000019import com.google.devtools.build.lib.events.ExtendedEventHandler;
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010020
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010021/**
22 * This event is fired after the loading phase is complete.
23 */
Klaus Aehlig949b7b52017-02-27 13:56:15 +000024public final class LoadingPhaseCompleteEvent implements ExtendedEventHandler.Postable {
ulfjack84837582018-07-24 05:19:34 -070025 private final ImmutableSet<Label> labels;
26 private final ImmutableSet<Label> filteredLabels;
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010027
28 /**
29 * Construct the event.
30 *
ulfjack84837582018-07-24 05:19:34 -070031 * @param labels the set of active targets that remain
32 * @param filteredLabels the set of filtered targets
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010033 */
ulfjack84837582018-07-24 05:19:34 -070034 public LoadingPhaseCompleteEvent(
35 ImmutableSet<Label> labels,
36 ImmutableSet<Label> filteredLabels) {
37 this.labels = Preconditions.checkNotNull(labels);
38 this.filteredLabels = Preconditions.checkNotNull(filteredLabels);
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010039 }
40
41 /**
42 * @return The set of active target labels remaining, which is a subset of the
43 * targets we attempted to load.
44 */
ulfjack84837582018-07-24 05:19:34 -070045 public ImmutableSet<Label> getLabels() {
46 return labels;
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010047 }
48
49 /**
ulfjack84837582018-07-24 05:19:34 -070050 * @return The set of filtered targets.
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010051 */
ulfjack84837582018-07-24 05:19:34 -070052 public ImmutableSet<Label> getFilteredLabels() {
53 return filteredLabels;
54 }
Han-Wen Nienhuysd08b27f2015-02-25 16:45:20 +010055}