Make `RootedPath` implement `SkyKey`, and make it the key type for `FileStateValue`.
By doing this, we no longer need the `FileState.Key` wrapper around `RootedPath`. The prior https://github.com/bazelbuild/bazel/commit/ab31f74f509c2af593b783e86d76c8b6188c9aaa already reduced the shallow heap size of that wrapper from 24 bytes to 16 bytes, but "0 bytes" is better. Kudos to janakr@ for the suggestion.
To achieve this refactor and still maintain readability, I introduced a `FileStateKey` interface so that it will be obvious to a caller of `FileStateValue#key` that the returned type is a `SkyKey` whose `#argument` returns `RootedPath`. I then made one slight improvement to one part of the codebase (no need to make an intermediate collection to transform some `RootedPath` instances to some `SkyKey` instances), but there may be other improvements along these lines we can make in the future.
PiperOrigin-RevId: 428094803
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 c0155de..166484f 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
@@ -64,6 +64,7 @@
import com.google.devtools.build.lib.util.io.TimestampGranularityMonitor;
import com.google.devtools.build.lib.vfs.BatchStat;
import com.google.devtools.build.lib.vfs.DigestHashFunction;
+import com.google.devtools.build.lib.vfs.FileStateKey;
import com.google.devtools.build.lib.vfs.FileStatus;
import com.google.devtools.build.lib.vfs.FileStatusWithDigest;
import com.google.devtools.build.lib.vfs.FileStatusWithDigestAdapter;
@@ -282,7 +283,7 @@
ExternalFilesHelper externalFilesHelper = ExternalFilesHelper.createForTesting(
pkgLocator, ExternalFileAction.DEPEND_ON_EXTERNAL_PKG_FOR_EXTERNAL_REPO_PATHS, directories);
skyFunctions.put(
- FileStateValue.FILE_STATE,
+ FileStateKey.FILE_STATE,
new FileStateFunction(
Suppliers.ofInstance(new TimestampGranularityMonitor(BlazeClock.instance())),
SyscallCache.NO_CACHE,