Skip to content

Commit

Permalink
Expose the maxTransitiveSourceVersion from SkyFunctionEnvironment.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 442796485
  • Loading branch information
Googler authored and copybara-github committed Apr 19, 2022
1 parent 8be663d commit cc89e16
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,10 @@ public boolean restartPermitted() {
public <T extends SkyKeyComputeState> T getState(Supplier<T> stateSupplier) {
return delegate.getState(stateSupplier);
}

@Override
@Nullable
public Version getMaxTransitiveSourceVersionSoFar() {
return delegate.getMaxTransitiveSourceVersionSoFar();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import com.google.devtools.build.skyframe.ValueOrUntypedException;
import com.google.devtools.build.skyframe.Version;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
import javax.annotation.Nullable;

/**
* A {@link SkyFunction.Environment} backed by a {@link SkyframeExecutor} that can be used to
Expand Down Expand Up @@ -101,4 +103,10 @@ public boolean restartPermitted() {
public <T extends SkyKeyComputeState> T getState(Supplier<T> stateSupplier) {
return stateSupplier.get();
}

@Override
@Nullable
public Version getMaxTransitiveSourceVersionSoFar() {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,10 @@ public <T extends SkyKeyComputeState> T getState(Supplier<T> stateSupplier) {
interface Informee {
void inform() throws InterruptedException;
}

@Override
@Nullable
public Version getMaxTransitiveSourceVersionSoFar() {
return delegate.getMaxTransitiveSourceVersionSoFar();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,10 @@ public boolean restartPermitted() {
public <T extends SkyKeyComputeState> T getState(Supplier<T> stateSupplier) {
return delegate.getState(stateSupplier);
}

@Override
@Nullable
public Version getMaxTransitiveSourceVersionSoFar() {
return delegate.getMaxTransitiveSourceVersionSoFar();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -409,5 +409,14 @@ interface SkyKeyComputeState {}
* {@link #compute} call.
*/
<T extends SkyKeyComputeState> T getState(Supplier<T> stateSupplier);

/**
* Returns the max transitive source version of a {@link NodeEntry}.
*
* <p>This value might not consider all deps' source versions if called before all deps have
* been requested or if {@link #valuesMissing()} returns true.
*/
@Nullable
Version getMaxTransitiveSourceVersionSoFar();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -994,4 +994,10 @@ ImmutableList<SkyKey> getDepKeys() {
return depKeys;
}
}

@Override
@Nullable
public Version getMaxTransitiveSourceVersionSoFar() {
return maxTransitiveSourceVersion;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
import com.google.devtools.build.skyframe.SkyKey;
import com.google.devtools.build.skyframe.SkyValue;
import com.google.devtools.build.skyframe.ValueOrUntypedException;
import com.google.devtools.build.skyframe.Version;
import com.google.protobuf.ByteString;
import java.io.IOException;
import java.io.OutputStream;
Expand Down Expand Up @@ -399,6 +400,12 @@ public boolean restartPermitted() {
public <T extends SkyKeyComputeState> T getState(Supplier<T> stateSupplier) {
return stateSupplier.get();
}

@Override
@Nullable
public Version getMaxTransitiveSourceVersionSoFar() {
throw new UnsupportedOperationException();
}
}

@SerializationConstant
Expand Down

0 comments on commit cc89e16

Please sign in to comment.