javacassandrapaginationcassandra-3.0

Cassandra: How long does a page exist?


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


Solution

  • 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:

    Source : http://docs.datastax.com/en/developer/java-driver/3.2/manual/paging/