/** * Returns the key row in this batch at `rowId`. Returned key row is reused across calls. */ @Override public UnsafeRow getKeyRow(int rowId) { assert(rowId >= 0); assert(rowId < numRows); if (keyRowId != rowId) { // if keyRowId == rowId, desired keyRow is already cached long offset = getKeyOffsetForFixedLengthRecords(rowId); keyRow.pointTo(base, offset, klen); // set keyRowId so we can check if desired row is cached keyRowId = rowId; } return keyRow; }
/** * Returns the key row in this batch at `rowId`. Returned key row is reused across calls. */ @Override public UnsafeRow getKeyRow(int rowId) { assert(rowId >= 0); assert(rowId < numRows); if (keyRowId != rowId) { // if keyRowId == rowId, desired keyRow is already cached long offset = getKeyOffsetForFixedLengthRecords(rowId); keyRow.pointTo(base, offset, klen); // set keyRowId so we can check if desired row is cached keyRowId = rowId; } return keyRow; }
/** * Returns the key row in this batch at `rowId`. Returned key row is reused across calls. */ @Override public UnsafeRow getKeyRow(int rowId) { assert(rowId >= 0); assert(rowId < numRows); if (keyRowId != rowId) { // if keyRowId == rowId, desired keyRow is already cached long offset = getKeyOffsetForFixedLengthRecords(rowId); keyRow.pointTo(base, offset, klen); // set keyRowId so we can check if desired row is cached keyRowId = rowId; } return keyRow; }