示例#1
0
 protected BuildingState(boolean isChanged, GroupedList<SkyKey> lastBuildDirectDeps) {
   this.lastBuildDirectDeps = lastBuildDirectDeps;
   Preconditions.checkState(
       isChanged || !this.lastBuildDirectDeps.isEmpty(),
       "%s is being marked dirty, not changed, but has no children that could have dirtied it",
       this);
   dirtyState = isChanged ? DirtyState.NEEDS_REBUILDING : DirtyState.CHECK_DEPENDENCIES;
   // We need to iterate through the deps to see if they have changed, or to remove them if one
   // has. Initialize the iterator.
   dirtyDirectDepIterator = lastBuildDirectDeps.iterator();
 }
示例#2
0
 /**
  * Removes a set of deps from the set of known direct deps. This is complicated by the need to
  * maintain the group data. If we remove a dep that ended a group, then its predecessor's group
  * data must be changed to indicate that it now ends the group.
  *
  * @see NodeEntry#removeUnfinishedDeps
  */
 void removeDirectDeps(Set<SkyKey> unfinishedDeps) {
   directDeps.remove(unfinishedDeps);
 }
示例#3
0
 /**
  * Returns the direct deps found so far on this build. Should only be called before the node has
  * finished building.
  *
  * @see NodeEntry#getTemporaryDirectDeps()
  */
 Set<SkyKey> getDirectDepsForBuild() {
   return directDeps.toSet();
 }
示例#4
0
 void addDirectDeps(GroupedListHelper<SkyKey> depsThisRun) {
   directDeps.append(depsThisRun);
 }
示例#5
0
 boolean noDepsLastBuild() {
   return lastBuildDirectDeps.isEmpty();
 }
示例#6
0
 /**
  * Returns true if the deps requested during this evaluation are exactly those requested the last
  * time this node was built, in the same order.
  */
 boolean depsUnchangedFromLastBuild() {
   checkFinishedBuildingWhenAboutToSetValue();
   return lastBuildDirectDeps.equals(directDeps);
 }
示例#7
0
 /**
  * Returns true if {@code newValue}.equals the value from the last time this node was built, and
  * the deps requested during this evaluation are exactly those requested the last time this node
  * was built, in the same order. Should only be used by {@link NodeEntry#setValue}.
  */
 boolean unchangedFromLastBuild(SkyValue newValue) {
   checkFinishedBuildingWhenAboutToSetValue();
   return getLastBuildValue().equals(newValue) && lastBuildDirectDeps.equals(directDeps);
 }
示例#8
0
 /** Returns whether all known children of this node have signaled that they are done. */
 boolean isReady() {
   int directDepsSize = directDeps.size();
   Preconditions.checkState(signaledDeps <= directDepsSize, "%s %s", directDepsSize, this);
   return signaledDeps == directDepsSize;
 }
示例#9
0
 /**
  * Remove all elements of toRemove from this list. It is a fatal error if any elements of
  * toRemove are not present. Takes time proportional to the size of the list, so should not be
  * called often.
  */
 public void remove(Set<E> toRemove) {
   groupedList = GroupedList.remove(groupedList, toRemove);
   int oldSize = size();
   elements.removeAll(toRemove);
   Preconditions.checkState(oldSize == size() + toRemove.size(), "%s %s", toRemove, this);
 }