use of org.apache.cassandra.service.pager.PagingState in project cassandra by apache.
the class Util method makeSomePagingState.
public static PagingState makeSomePagingState(ProtocolVersion protocolVersion) {
TableMetadata metadata = TableMetadata.builder("ks", "tbl").addPartitionKeyColumn("k", AsciiType.instance).addClusteringColumn("c1", AsciiType.instance).addClusteringColumn("c2", Int32Type.instance).addRegularColumn("myCol", AsciiType.instance).build();
ByteBuffer pk = ByteBufferUtil.bytes("someKey");
ColumnMetadata def = metadata.getColumn(new ColumnIdentifier("myCol", false));
Clustering c = Clustering.make(ByteBufferUtil.bytes("c1"), ByteBufferUtil.bytes(42));
Row row = BTreeRow.singleCellRow(c, BufferCell.live(def, 0, ByteBufferUtil.EMPTY_BYTE_BUFFER));
PagingState.RowMark mark = PagingState.RowMark.create(metadata, row, protocolVersion);
return new PagingState(pk, mark, 10, 0);
}
Aggregations