Skip to content

Commit

Permalink
Update visibility of fields and methods in SkyframeExecutor and `Se…
Browse files Browse the repository at this point in the history
…quencedSkyframeExecutor`

PiperOrigin-RevId: 554547633
Change-Id: I3625f3d2b76bcaad040b1ba01c2b44e6ef5902d4
  • Loading branch information
Googler authored and copybara-github committed Aug 7, 2023
1 parent dcaa59e commit d175f08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,7 @@ protected void onPkgLocatorChange(PathPackageLocator oldLocator, PathPackageLoca
invalidate(SkyFunctionName.functionIsIn(PACKAGE_LOCATOR_DEPENDENT_VALUES));
}

@Override
protected void invalidate(Predicate<SkyKey> pred) {
void invalidate(Predicate<SkyKey> pred) {
recordingDiffer.invalidate(Iterables.filter(memoizingEvaluator.getValues().keySet(), pred));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,13 @@
*/
public abstract class SkyframeExecutor implements WalkableGraphFactory {
private static final GoogleLogger logger = GoogleLogger.forEnclosingClass();

protected MemoizingEvaluator memoizingEvaluator;
protected final EmittedEventState emittedEventState = new EmittedEventState();
protected final PackageFactory pkgFactory;
private final WorkspaceStatusAction.Factory workspaceStatusActionFactory;
protected final FileSystem fileSystem;
protected final BlazeDirectories directories;
protected final ExternalFilesHelper externalFilesHelper;
final ExternalFilesHelper externalFilesHelper;
protected final BugReporter bugReporter;

/**
Expand All @@ -298,7 +297,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
private final FilesMetricConsumer outputArtifactsFromActionCache = new FilesMetricConsumer();
private final FilesMetricConsumer topLevelArtifactsMetric = new FilesMetricConsumer();

@Nullable protected OutputService outputService;
@Nullable OutputService outputService;

// TODO(bazel-team): Figure out how to handle value builders that block internally. Blocking
// operations may need to be handled in another (bigger?) thread pool. Also, we should detect
Expand Down Expand Up @@ -332,17 +331,17 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {

// AtomicReferences are used here as mutable boxes shared with value builders.
private final AtomicBoolean showLoadingProgress = new AtomicBoolean();
protected final AtomicReference<PathPackageLocator> pkgLocator = new AtomicReference<>();
protected final AtomicReference<ImmutableSet<PackageIdentifier>> deletedPackages =
private final AtomicReference<PathPackageLocator> pkgLocator = new AtomicReference<>();
final AtomicReference<ImmutableSet<PackageIdentifier>> deletedPackages =
new AtomicReference<>(ImmutableSet.of());
private final AtomicReference<EventBus> eventBus = new AtomicReference<>();
protected final AtomicReference<TimestampGranularityMonitor> tsgm = new AtomicReference<>();
protected final AtomicReference<Map<String, String>> clientEnv = new AtomicReference<>();
final AtomicReference<TimestampGranularityMonitor> tsgm = new AtomicReference<>();
private final AtomicReference<Map<String, String>> clientEnv = new AtomicReference<>();

private final ArtifactFactory artifactFactory;
private final ActionKeyContext actionKeyContext;

protected boolean active = true;
boolean active = true;
private final SkyframePackageManager packageManager;
private final QueryTransitivePackagePreloader queryTransitivePackagePreloader;

Expand All @@ -355,7 +354,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {
private ActionExecutionFunction actionExecutionFunction;
private BuildDriverFunction buildDriverFunction;
private GlobFunction globFunction;
protected SkyframeProgressReceiver progressReceiver;
SkyframeProgressReceiver progressReceiver;
private CyclesReporter cyclesReporter = null;

@VisibleForTesting boolean lastAnalysisDiscarded = false;
Expand All @@ -371,8 +370,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {

private final ImmutableMap<SkyFunctionName, SkyFunction> extraSkyFunctions;

protected SkyframeIncrementalBuildMonitor incrementalBuildMonitor =
new SkyframeIncrementalBuildMonitor();
SkyframeIncrementalBuildMonitor incrementalBuildMonitor = new SkyframeIncrementalBuildMonitor();

private final SkyFunction ignoredPackagePrefixesFunction;

Expand Down Expand Up @@ -447,7 +445,7 @@ public abstract class SkyframeExecutor implements WalkableGraphFactory {

protected Duration sourceDiffCheckingDuration = Duration.ofSeconds(-1L);

class PathResolverFactoryImpl implements PathResolverFactory {
final class PathResolverFactoryImpl implements PathResolverFactory {
@Override
public boolean shouldCreatePathResolverForArtifactValues() {
return outputService != null && outputService.supportsPathResolverForArtifactValues();
Expand Down Expand Up @@ -1326,8 +1324,6 @@ public AtomicReference<PathPackageLocator> getPackageLocator() {
return pkgLocator;
}

protected abstract void invalidate(Predicate<SkyKey> pred);

protected Differencer.Diff getDiff(
TimestampGranularityMonitor tsgm,
ModifiedFileSet modifiedFileSet,
Expand Down Expand Up @@ -2239,11 +2235,6 @@ public Optional<UniverseScope> maybeGetHardcodedUniverseScope() {
return Optional.empty();
}

@ForOverride
protected SkyKey getUniverseKey(Collection<String> patterns, PathFragment offset) {
return PrepareDepsOfPatternsValue.key(ImmutableList.copyOf(patterns), offset);
}

/** Returns the generating action of a given artifact ({@code null} if it's a source artifact). */
@Nullable
private ActionAnalysisMetadata getGeneratingAction(
Expand Down Expand Up @@ -2802,9 +2793,10 @@ protected class SkyframeProgressReceiver implements EvaluationProgressReceiver {
* cache because of --discard_analysis_cache flag. For that case we want to keep the legacy data
* but get rid of the Skyframe data.
*/
protected boolean ignoreInvalidations = false;
boolean ignoreInvalidations = false;

/** This receiver is only needed for execution, so it is null otherwise. */
@Nullable EvaluationProgressReceiver executionProgressReceiver = null;
@Nullable private EvaluationProgressReceiver executionProgressReceiver = null;

/**
* As the ActionLookupValues are marked done in the graph, put it in the map. This map will be
Expand Down Expand Up @@ -3689,11 +3681,6 @@ public ConfiguredRuleClassProvider getRuleClassProviderForTesting() {
return ruleClassProvider;
}

@VisibleForTesting
public PackageFactory getPackageFactoryForTesting() {
return pkgFactory;
}

@VisibleForTesting
public PackageSettings getPackageSettingsForTesting() {
return pkgFactory.getPackageSettingsForTesting();
Expand Down

0 comments on commit d175f08

Please sign in to comment.