Can anyone explain what a page state is on Cassandra?

Viewed 1325

I am trying to implement paginated REST API backed by Cassandra. I found that the Cassandra driver has a pagination feature (http://docs.datastax.com/en/developer/java-driver/3.3/manual/paging/). I did a simple experiment with this feature, and it seems to work.

By setting proper page size and page state, even if the server (web server, not Cassandra server) is restarted, I can still get the correct page. Also, it seems that the driver sends this page state and page size together with its statement to Cassandra server. How did this stuff work? It looks mysterious to me.

1 Answers

Page state holds the last read partition and last read row. Everything is sorted so it can just seek to that partition/row and continue reading from there. This gives ability to walk through things but not do things like offset selects.

Related