diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java b/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java index 06bb34475a3ff2..180913062e5e45 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/FilesystemValueChecker.java @@ -342,11 +342,7 @@ && shouldCheckFile(knownModifiedOutputFiles, artifact)) { List artifacts = ImmutableList.copyOf(fileToKeyAndValue.keySet()); List stats; try { - stats = - batchStatter.batchStat( - /* includeDigest= */ true, - /* includeLinks= */ true, - Artifact.asPathFragments(artifacts)); + stats = batchStatter.batchStat(Artifact.asPathFragments(artifacts)); } catch (IOException e) { logger.atWarning().withCause(e).log( "Unable to process batch stat, falling back to individual stats"); diff --git a/src/main/java/com/google/devtools/build/lib/vfs/BatchStat.java b/src/main/java/com/google/devtools/build/lib/vfs/BatchStat.java index 73289b8a1f0a26..e82cdfbc525d50 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/BatchStat.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/BatchStat.java @@ -22,16 +22,14 @@ public interface BatchStat { /** - * @param includeDigest whether to include a file digest in the return values. - * @param includeLinks whether to include a symlink stat in the return values. - * @param paths The input paths to stat(), relative to the exec root. - * @return an array list of FileStatusWithDigest in the same order as the input. May - * contain null values. - * @throws IOException on unexpected failure. + * Calls stat() on a set of paths. + * + * @param paths The input paths to stat(), relative to the exec root. Symlinks are not followed. + * @return A list of {@link FileStatusWithDigest} in the same order as the input. If a path does + * not exist, {@code null} is returned in the corresponding position. + * @throws IOException on I/O errors. * @throws InterruptedException on interrupt. */ - public List batchStat(boolean includeDigest, - boolean includeLinks, - Iterable paths) + public List batchStat(Iterable paths) throws IOException, InterruptedException; } diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java index 4018da2adb6acf..68ac6d09266674 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/FilesystemValueCheckerTest.java @@ -260,7 +260,7 @@ BatchStat getBatchStat(FileSystem fileSystem) { ENABLED { @Override BatchStat getBatchStat(FileSystem fileSystem) { - return (useDigest, includeLinks, paths) -> { + return (paths) -> { List stats = new ArrayList<>(); for (PathFragment pathFrag : paths) { stats.add( @@ -1228,8 +1228,7 @@ public void testDirtyActionsBatchStat() throws Exception { checkDirtyActions( new BatchStat() { @Override - public List batchStat( - boolean useDigest, boolean includeLinks, Iterable paths) + public List batchStat(Iterable paths) throws IOException { List stats = new ArrayList<>(); for (PathFragment pathFrag : paths) { @@ -1249,8 +1248,7 @@ public void testDirtyActionsBatchStatWithDigest() throws Exception { checkDirtyActions( new BatchStat() { @Override - public List batchStat( - boolean useDigest, boolean includeLinks, Iterable paths) + public List batchStat(Iterable paths) throws IOException { List stats = new ArrayList<>(); for (PathFragment pathFrag : paths) { @@ -1269,8 +1267,7 @@ public void testDirtyActionsBatchStatFallback() throws Exception { checkDirtyActions( new BatchStat() { @Override - public List batchStat( - boolean useDigest, boolean includeLinks, Iterable paths) + public List batchStat(Iterable paths) throws IOException { throw new IOException("try again"); }