this.restartable = restartable;
NodeSequence rows = results.getRows();
if (rows.isEmpty()) {
this.sequence = rows;
} else if (!restartable) {
this.sequence = new SecureSequence(rows, context);
} else {
String workspace = context.getWorkspaceName();
BufferManager bufferMgr = context.getBufferManager();
CachedNodeSupplier nodeCache = results.getCachedNodes();
NodeSequence secureSequence = new SecureSequence(rows, context);
this.sequence = new RestartableSequence(workspace, secureSequence, bufferMgr, nodeCache, numRowsInMemory);
}
assert this.context != null;
assert this.results != null;