I paginate through a large collection of data (circa 500 000 000 rows) using PagingState, and do some business intelligence during this process. To be able to resume the process I created this table...
/**
* This table stores temporary paging state
*/
CREATE TABLE IF NOT EXISTS lp_operations.paging_state (
id text, // ID of process
pos bigint, // current position
page text, // paging state
info text, // info json
finished tinyint, // finished
PRIMARY KEY (id)
) WITH default_time_to_live = 28800; // 8 hours
..in which i store current page (string representation of PagingState) and JSON meta data associated with calculation.
Questions
No, Cassandra Driver's Paging State will not Expire.
Because Every time you query with paging state, cassandra actually execute your query every time. It don't store your result. Paging State just tell cassandra from which index the driver want the data .
Due to internal implementation details, PagingState instances are not portable across native protocol versions. This could become a problem in the following scenario:
you upgrade your server stack to use the driver 2.1.x and Cassandra 2.1.x, so you’re now using protocol v3;
the user tries to reload their bookmark, but the paging state was serialized with protocol v2, so trying to reuse it will fail.
Source : http://docs.datastax.com/en/developer/java-driver/3.2/manual/paging/