Make SkyKey an interface, and start the migration of not creating SkyKey wrapper objects: for OwnedArtifacts, which are the most numerous during builds, and for Labels for TransitiveTraversalValues, which are the most numerous during queries.
PiperOrigin-RevId: 154989520
diff --git a/src/test/java/com/google/devtools/build/skyframe/ErrorInfoTest.java b/src/test/java/com/google/devtools/build/skyframe/ErrorInfoTest.java
index 4b04614..e88d73e 100644
--- a/src/test/java/com/google/devtools/build/skyframe/ErrorInfoTest.java
+++ b/src/test/java/com/google/devtools/build/skyframe/ErrorInfoTest.java
@@ -20,13 +20,11 @@
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.skyframe.SkyFunctionException.ReifiedSkyFunctionException;
-
+import java.io.IOException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
-import java.io.IOException;
-
/** Tests for the non-trivial creation logic of {@link ErrorInfo}. */
@RunWith(JUnit4.class)
public class ErrorInfoTest {
@@ -49,7 +47,7 @@
private void runTestFromException(boolean isDirectlyTransient, boolean isTransitivelyTransient) {
Exception exception = new IOException("ehhhhh");
- SkyKey causeOfException = SkyKey.create(SkyFunctionName.create("CAUSE"), 1234);
+ SkyKey causeOfException = LegacySkyKey.create(SkyFunctionName.create("CAUSE"), 1234);
DummySkyFunctionException dummyException =
new DummySkyFunctionException(exception, isDirectlyTransient, /*isCatastrophic=*/ false);
@@ -89,8 +87,8 @@
public void testFromCycle() {
CycleInfo cycle =
new CycleInfo(
- ImmutableList.of(SkyKey.create(SkyFunctionName.create("PATH"), 1234)),
- ImmutableList.of(SkyKey.create(SkyFunctionName.create("CYCLE"), 4321)));
+ ImmutableList.of(LegacySkyKey.create(SkyFunctionName.create("PATH"), 1234)),
+ ImmutableList.of(LegacySkyKey.create(SkyFunctionName.create("CYCLE"), 4321)));
ErrorInfo errorInfo = ErrorInfo.fromCycle(cycle);
@@ -105,12 +103,12 @@
public void testFromChildErrors() {
CycleInfo cycle =
new CycleInfo(
- ImmutableList.of(SkyKey.create(SkyFunctionName.create("PATH"), 1234)),
- ImmutableList.of(SkyKey.create(SkyFunctionName.create("CYCLE"), 4321)));
+ ImmutableList.of(LegacySkyKey.create(SkyFunctionName.create("PATH"), 1234)),
+ ImmutableList.of(LegacySkyKey.create(SkyFunctionName.create("CYCLE"), 4321)));
ErrorInfo cycleErrorInfo = ErrorInfo.fromCycle(cycle);
Exception exception1 = new IOException("ehhhhh");
- SkyKey causeOfException1 = SkyKey.create(SkyFunctionName.create("CAUSE1"), 1234);
+ SkyKey causeOfException1 = LegacySkyKey.create(SkyFunctionName.create("CAUSE1"), 1234);
DummySkyFunctionException dummyException1 =
new DummySkyFunctionException(exception1, /*isTransient=*/ true, /*isCatastrophic=*/ false);
ErrorInfo exceptionErrorInfo1 = ErrorInfo.fromException(
@@ -119,14 +117,14 @@
// N.B this ErrorInfo will be catastrophic.
Exception exception2 = new IOException("blahhhhh");
- SkyKey causeOfException2 = SkyKey.create(SkyFunctionName.create("CAUSE2"), 5678);
+ SkyKey causeOfException2 = LegacySkyKey.create(SkyFunctionName.create("CAUSE2"), 5678);
DummySkyFunctionException dummyException2 =
new DummySkyFunctionException(exception2, /*isTransient=*/ false, /*isCatastrophic=*/ true);
ErrorInfo exceptionErrorInfo2 = ErrorInfo.fromException(
new ReifiedSkyFunctionException(dummyException2, causeOfException2),
/*isTransitivelyTransient=*/ false);
- SkyKey currentKey = SkyKey.create(SkyFunctionName.create("CURRENT"), 9876);
+ SkyKey currentKey = LegacySkyKey.create(SkyFunctionName.create("CURRENT"), 9876);
ErrorInfo errorInfo = ErrorInfo.fromChildErrors(
currentKey, ImmutableList.of(cycleErrorInfo, exceptionErrorInfo1, exceptionErrorInfo2));