@@ -79,49 +79,39 @@ public SkyValue createNewValue(
79
79
}
80
80
}
81
81
82
- /** Checks dirtiness of filesystem keys in the graph. */
83
- public static class BasicFilesystemDirtinessChecker extends SkyValueDirtinessChecker {
84
- private final FileDirtinessChecker fdc = new FileDirtinessChecker ();
85
- private final DirectoryDirtinessChecker ddc = new DirectoryDirtinessChecker ();
86
- private final UnionDirtinessChecker checker =
87
- new UnionDirtinessChecker (ImmutableList .of (fdc , ddc ));
88
-
89
- @ Override
90
- public boolean applies (SkyKey skyKey ) {
91
- return fdc .applies (skyKey ) || ddc .applies (skyKey );
92
- }
93
-
94
- @ Override
95
- @ Nullable
96
- public SkyValue createNewValue (
97
- SkyKey key , SyscallCache syscallCache , @ Nullable TimestampGranularityMonitor tsgm ) {
98
- return checker .createNewValue (key , syscallCache , tsgm );
99
- }
100
- }
101
-
102
- static final class MissingDiffDirtinessChecker extends BasicFilesystemDirtinessChecker {
82
+ static final class MissingDiffDirtinessChecker extends SkyValueDirtinessChecker {
103
83
private final Set <Root > missingDiffPackageRoots ;
84
+ private final UnionDirtinessChecker checker = createBasicFilesystemDirtinessChecker ();
104
85
105
86
MissingDiffDirtinessChecker (Set <Root > missingDiffPackageRoots ) {
106
87
this .missingDiffPackageRoots = missingDiffPackageRoots ;
107
88
}
108
89
109
90
@ Override
110
91
public boolean applies (SkyKey key ) {
111
- return super .applies (key )
92
+ return checker .applies (key )
112
93
&& missingDiffPackageRoots .contains (((RootedPath ) key .argument ()).getRoot ());
113
94
}
95
+
96
+ @ Nullable
97
+ @ Override
98
+ public SkyValue createNewValue (
99
+ SkyKey key , SyscallCache syscallCache , @ Nullable TimestampGranularityMonitor tsgm ) {
100
+ return checker .createNewValue (key , syscallCache , tsgm );
101
+ }
114
102
}
115
103
116
104
/**
117
105
* Serves for tracking whether there are external and output files {@see ExternalFilesKnowledge}.
118
106
* Filtering of files, for which the new values should not be injected into evaluator, is done in
119
107
* SequencedSkyframeExecutor.handleChangedFiles().
120
108
*/
121
- static final class ExternalDirtinessChecker extends BasicFilesystemDirtinessChecker {
109
+ static final class ExternalDirtinessChecker extends SkyValueDirtinessChecker {
122
110
private final ExternalFilesHelper externalFilesHelper ;
123
111
private final EnumSet <FileType > fileTypesToCheck ;
124
112
113
+ private final UnionDirtinessChecker checker = createBasicFilesystemDirtinessChecker ();
114
+
125
115
ExternalDirtinessChecker (ExternalFilesHelper externalFilesHelper ,
126
116
EnumSet <FileType > fileTypesToCheck ) {
127
117
this .externalFilesHelper = externalFilesHelper ;
@@ -130,7 +120,7 @@ static final class ExternalDirtinessChecker extends BasicFilesystemDirtinessChec
130
120
131
121
@ Override
132
122
public boolean applies (SkyKey key ) {
133
- if (!super .applies (key )) {
123
+ if (!checker .applies (key )) {
134
124
return false ;
135
125
}
136
126
FileType fileType = externalFilesHelper .getAndNoteFileType ((RootedPath ) key .argument ());
@@ -153,7 +143,7 @@ public SkyValueDirtinessChecker.DirtyResult check(
153
143
FileType fileType = externalFilesHelper .getAndNoteFileType ((RootedPath ) skyKey .argument ());
154
144
boolean cacheable = isCacheableType (fileType );
155
145
SkyValue newValue =
156
- super .createNewValue (skyKey , cacheable ? syscallCache : SyscallCache .NO_CACHE , tsgm );
146
+ checker .createNewValue (skyKey , cacheable ? syscallCache : SyscallCache .NO_CACHE , tsgm );
157
147
if (Objects .equal (newValue , oldValue )) {
158
148
return SkyValueDirtinessChecker .DirtyResult .notDirty ();
159
149
}
@@ -180,6 +170,11 @@ private static boolean isCacheableType(FileType fileType) {
180
170
}
181
171
}
182
172
173
+ static UnionDirtinessChecker createBasicFilesystemDirtinessChecker () {
174
+ return new UnionDirtinessChecker (
175
+ ImmutableList .of (new FileDirtinessChecker (), new DirectoryDirtinessChecker ()));
176
+ }
177
+
183
178
/** {@link SkyValueDirtinessChecker} that encompasses a union of other dirtiness checkers. */
184
179
public static final class UnionDirtinessChecker extends SkyValueDirtinessChecker {
185
180
private final Iterable <SkyValueDirtinessChecker > dirtinessCheckers ;
0 commit comments