private static RawScan mockFullScan(GTInfo gtInfo, KylinConfig kylinConfig) {
final List<Pair<byte[], byte[]>> selectedColumns = Lists.newArrayList();
selectedColumns.add(new Pair<>(FAM, COL_M));
int headerLength = RowConstants.ROWKEY_SHARD_AND_CUBOID_LEN;
int bodyLength = 0;
ImmutableBitSet primaryKey = gtInfo.getPrimaryKey();
for (int i = 0; i < primaryKey.trueBitCount(); i++) {
bodyLength += gtInfo.getCodeSystem().getDimEnc(primaryKey.trueBitAt(i)).getLengthOfEncoding();
}
byte[] start = new byte[headerLength + bodyLength];
BytesUtil.writeShort((short) 0, start, 0, RowConstants.ROWKEY_SHARDID_LEN);
System.arraycopy(Bytes.toBytes(baseCuboid), 0, start, RowConstants.ROWKEY_SHARDID_LEN,
RowConstants.ROWKEY_CUBOIDID_LEN);
byte[] end = new byte[headerLength + bodyLength + 1];
for (int i = 0; i < end.length - 1; i++) {
end[i] = RowConstants.ROWKEY_UPPER_BYTE;
}
BytesUtil.writeShort((short) 0, end, 0, RowConstants.ROWKEY_SHARDID_LEN);
System.arraycopy(Bytes.toBytes(baseCuboid), 0, end, RowConstants.ROWKEY_SHARDID_LEN,
RowConstants.ROWKEY_CUBOIDID_LEN);
List<Pair<byte[], byte[]>> fuzzyKeys = Collections.emptyList();
return new RawScan(start, end, selectedColumns, fuzzyKeys, kylinConfig.getHBaseScanCacheRows(),
kylinConfig.getHBaseScanMaxResultSize());
}