public DataSet lookupDataSet(DataSetLookup lookup) {
String uuid = lookup.getDataSetUUID();
if (StringUtils.isEmpty(uuid)) return null;
// Get the target data set
DataSetIndex dataSetIndex = dataSetOpEngine.getIndexRegistry().get(uuid);
if (dataSetIndex == null) return null;
DataSet dataSet = dataSetIndex.getDataSet();
// Apply the list of operations specified (if any).
if (!lookup.getOperationList().isEmpty()) {
dataSet = dataSetOpEngine.execute(dataSetIndex.getDataSet(), lookup.getOperationList());
}
// Trim the data set as requested.
dataSet = dataSet.trim(lookup.getRowOffset(), lookup.getNumberOfRows());
return dataSet;