forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce --experimental_parallel_aquery_output.
This flag would enable blaze to process the analysis graph in parallel while constructing an aquery result, instead of sequentially. The implementation follows a producer-consumer pattern to reduce the impact of the IO bottleneck. PiperOrigin-RevId: 518804027 Change-Id: I912a0170767c1a3a0184bbd024d48b037ec7de19
- Loading branch information
1 parent
70ce837
commit 6a17457
Showing
8 changed files
with
388 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...a/com/google/devtools/build/lib/skyframe/actiongraph/v2/AqueryConsumingOutputHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2023 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.lib.skyframe.actiongraph.v2; | ||
|
||
/** AqueryOutputHandler that receives and consumes tasks via a work queue. */ | ||
public interface AqueryConsumingOutputHandler extends AqueryOutputHandler { | ||
|
||
void startConsumer(); | ||
|
||
void stopConsumer(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/com/google/devtools/build/lib/skyframe/actiongraph/v2/PrintTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Copyright 2023 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.lib.skyframe.actiongraph.v2; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import com.google.protobuf.Message; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* Represent a task to be consumed by a {@link AqueryConsumingOutputHandler}. | ||
* | ||
* <p>We have separate Proto/TextProto subclasses to reduce some memory waste: we'll never need both | ||
* the fieldNumber and the messageLabel in a PrintTask. | ||
*/ | ||
@SuppressWarnings("InterfaceWithOnlyStatics") | ||
public interface PrintTask { | ||
|
||
/** A task for the proto format. */ | ||
@AutoValue | ||
abstract class ProtoPrintTask implements PrintTask { | ||
@Nullable | ||
abstract Message message(); | ||
|
||
abstract int fieldNumber(); | ||
|
||
public static ProtoPrintTask create(Message message, int fieldNumber) { | ||
return new AutoValue_PrintTask_ProtoPrintTask(message, fieldNumber); | ||
} | ||
} | ||
|
||
/** A task for the textproto format. */ | ||
@AutoValue | ||
abstract class TextProtoPrintTask implements PrintTask { | ||
@Nullable | ||
abstract Message message(); | ||
|
||
abstract String messageLabel(); | ||
|
||
public static TextProtoPrintTask create(Message message, String messageLabel) { | ||
return new AutoValue_PrintTask_TextProtoPrintTask(message, messageLabel); | ||
} | ||
} | ||
} |
Oops, something went wrong.