Skip to content

Commit

Permalink
Some improvements to analyzeDepsDoneness.
Browse files Browse the repository at this point in the history
* Document what the parameters are and when it is called.
* Tighten the type of `deps` from `Collection` to `List`.

PiperOrigin-RevId: 583141189
Change-Id: I672aee8a71fc9df27532f2eb74934fe3db0b6371
  • Loading branch information
justinhorvitz authored and pull[bot] committed Dec 4, 2023
1 parent 572c1b8 commit 4146027
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -201,7 +202,7 @@ private InMemoryNodeEntry createIfAbsent(SkyKey skyKey) {
}

@Override
public DepsReport analyzeDepsDoneness(SkyKey parent, Collection<SkyKey> deps) {
public DepsReport analyzeDepsDoneness(SkyKey parent, List<SkyKey> deps) {
return DepsReport.NO_INFORMATION;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.google.devtools.build.lib.supplier.InterruptibleSupplier;
import com.google.devtools.build.lib.supplier.MemoizingInterruptibleSupplier;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.Collection;
import java.util.List;
import javax.annotation.Nullable;

/**
Expand Down Expand Up @@ -77,9 +77,14 @@ default InterruptibleSupplier<NodeBatch> createIfAbsentBatchAsync(
* have not been recomputed since the last computation of {@code parent}. When determining if
* {@code parent} needs to be re-evaluated, this may be used to avoid unnecessary graph accesses.
*
* <p>Returns deps that may have new values since the node of {@code parent} was last computed,
* and therefore which may force re-evaluation of the node of {@code parent}.
* <p>If this graph partakes in the optional optimization, returns deps that may have new values
* since the node of {@code parent} was last computed, and therefore which may force re-evaluation
* of the node of {@code parent}. Otherwise, returns {@link DepsReport#NO_INFORMATION}.
*
* @param parent the key in {@link NodeEntry.LifecycleState#CHECK_DEPENDENCIES}
* @param deps the {@linkplain NodeEntry#getNextDirtyDirectDeps next dirty dep group} of {@code
* parent}; only called when all previous dep groups were clean, so it is known that {@code
* deps} are still dependencies of {@code parent} on the incremental build
*/
DepsReport analyzeDepsDoneness(SkyKey parent, Collection<SkyKey> deps)
throws InterruptedException;
DepsReport analyzeDepsDoneness(SkyKey parent, List<SkyKey> deps) throws InterruptedException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.skyframe.NodeEntry.DirtyType;
import com.google.errorprone.annotations.ForOverride;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -132,7 +131,7 @@ public ImmutableSet<SkyKey> prefetchDeps(
}

@Override
public DepsReport analyzeDepsDoneness(SkyKey parent, Collection<SkyKey> deps)
public DepsReport analyzeDepsDoneness(SkyKey parent, List<SkyKey> deps)
throws InterruptedException {
return delegate.analyzeDepsDoneness(parent, deps);
}
Expand Down

0 comments on commit 4146027

Please sign in to comment.