Prevent accidental wrong use of OperatorSpillContext
@@ -539,6 +539,13 @@ public class OperatorContext
return reservedBytes - bytesBeingFreed;
}
+ @Override
+ public void close()
+ {
+ // Only products of SpillContext.newLocalSpillContext() should be closed.
+ throw new UnsupportedOperationException(format("%s should not be closed directly", getClass()));
+ }
+
@Override
public String toString()
{
