Skip to content

Commit 871b552

Browse files
lberkiramil-bitrise
authored andcommitted
Remove OutputMetadataStore.getTreeArtifactChildren().
It was only a thin wrapper around .getTreeArtifactValue(). RELNOTES: None. PiperOrigin-RevId: 690648081 Change-Id: I4b84ebc1a381ca8298dff2652ec60e00911294e0
1 parent 4ccd23a commit 871b552

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

src/main/java/com/google/devtools/build/lib/exec/StandaloneTestStrategy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,8 @@ private TestAttemptResult runTestAttempt(
759759
ImmutableSet<? extends ActionInput> expandedCoverageDir =
760760
actionExecutionContext
761761
.getOutputMetadataStore()
762-
.getTreeArtifactChildren(
763-
(SpecialArtifact) testAction.getCoverageDirectoryTreeArtifact());
762+
.getTreeArtifactValue((SpecialArtifact) testAction.getCoverageDirectoryTreeArtifact())
763+
.getChildren();
764764
ImmutableSet<ActionInput> coverageSpawnMetadata =
765765
ImmutableSet.<ActionInput>builder()
766766
.addAll(expandedCoverageDir)

src/main/java/com/google/devtools/build/lib/remote/AbstractActionInputPrefetcher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,8 @@ public void finalizeAction(Action action, OutputMetadataStore outputMetadataStor
670670
}
671671

672672
if (output.isTreeArtifact()) {
673-
var children = outputMetadataStore.getTreeArtifactChildren((SpecialArtifact) output);
673+
var children =
674+
outputMetadataStore.getTreeArtifactValue((SpecialArtifact) output).getChildren();
674675
for (var file : children) {
675676
if (remoteOutputChecker.shouldDownloadOutput(file)) {
676677
outputsToDownload.add(file);

src/main/java/com/google/devtools/build/lib/remote/BazelOutputService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ public void finalizeAction(Action action, OutputMetadataStore outputMetadataStor
373373

374374
if (output.isTreeArtifact()) {
375375
// TODO(chiwang): Use TreeArtifactLocator
376-
var children = outputMetadataStore.getTreeArtifactChildren((SpecialArtifact) output);
376+
var children =
377+
outputMetadataStore.getTreeArtifactValue((SpecialArtifact) output).getChildren();
377378
for (var child : children) {
378379
addArtifact(outputMetadataStore, execRoot, outputPath, request, child);
379380
}

src/test/java/com/google/devtools/build/lib/skyframe/ActionOutputMetadataStoreTest.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public void createsTreeArtifactValueFromFilesystem() throws Exception {
259259
assertThat(tree.getMetadata()).isEqualTo(treeMetadata);
260260
assertThat(tree.getChildValues())
261261
.containsExactly(child1, child1Metadata, child2, child2Metadata);
262-
assertThat(store.getTreeArtifactChildren(treeArtifact)).isEqualTo(tree.getChildren());
262+
assertThat(store.getTreeArtifactValue(treeArtifact)).isEqualTo(tree);
263263
assertThat(store.getAllArtifactData()).isEmpty();
264264
assertThat(chmodCalls).isEmpty();
265265
}
@@ -390,7 +390,7 @@ public void injectRemoteTreeArtifactMetadata() throws Exception {
390390
assertThat(store.getAllTreeArtifactData().get(treeArtifact)).isEqualTo(tree);
391391
assertThat(chmodCalls).isEmpty();
392392

393-
assertThat(store.getTreeArtifactChildren(treeArtifact)).isEqualTo(tree.getChildren());
393+
assertThat(store.getTreeArtifactValue(treeArtifact)).isEqualTo(tree);
394394

395395
// Make sure that all children are transferred properly into the ActionExecutionValue. If any
396396
// child is missing, getExistingFileArtifactValue will throw.
@@ -699,7 +699,7 @@ public void outputTreeArtifactNotPreviouslyInjectedInExecutionMode() throws Exce
699699
assertThat(tree.getMetadata()).isEqualTo(treeMetadata);
700700
assertThat(tree.getChildValues())
701701
.containsExactly(child1, child1Metadata, child2, child2Metadata);
702-
assertThat(store.getTreeArtifactChildren(treeArtifact)).isEqualTo(tree.getChildren());
702+
assertThat(store.getTreeArtifactValue(treeArtifact)).isEqualTo(tree);
703703
assertThat(store.getAllArtifactData()).isEmpty();
704704
assertThat(chmodCalls)
705705
.containsExactly(
@@ -713,15 +713,6 @@ public void outputTreeArtifactNotPreviouslyInjectedInExecutionMode() throws Exce
713713
0555);
714714
}
715715

716-
@Test
717-
public void getTreeArtifactChildren_noData_returnsEmptySet() {
718-
SpecialArtifact treeArtifact =
719-
ActionsTestUtil.createTreeArtifactWithGeneratingAction(
720-
outputRoot, PathFragment.create("tree"));
721-
ActionOutputMetadataStore store = createStore(/* outputs= */ ImmutableSet.of(treeArtifact));
722-
assertThat(store.getTreeArtifactChildren(treeArtifact)).isEmpty();
723-
}
724-
725716
@Test
726717
public void enteringExecutionModeClearsCachedOutputs() throws Exception {
727718
Artifact artifact =

0 commit comments

Comments
 (0)