Exposing PagingState to client code

Description

Would it be possible to expose the PagingState to client code so the client code can paginate statelessly?

Environment

None

Pull Requests

None

Activity

Show:
Olivier Michallat
November 28, 2014, 10:57 AM

Yes, we've had this in mind for a while. I'm raising the ranking on this ticket.

Sylvain Lebresne
November 28, 2014, 11:55 AM

For the record, I'll note that this should be done with some amount of care: if the paging state of the protocol is sent with a query that differs from the original query it was created with, the behavior is completely undefined as far as Cassandra is concerned (ranging for crashing server side to returning random data). So I wouldn't expose "just" the PagingState of the protocol. Instead we should probably expose an object that groups both the protocol paging state and the initial query (plus it's potential bound values). Or, alternatively, we only include a sha1/md5 of said query/bound values and the use has to provide it back to continue paging (and we simply check it provided the proper request).

Andy Tolbert
March 25, 2015, 8:03 PM

Validated against newkek/JAVA-550 PR that PagingState may be reused if and only if it is used for a Statement that is equivalent to the one that produced the ResultSet the PagingState was generated off of.

Fixed

Assignee

Andy Tolbert

Reporter

Drew Kutcharian

Labels

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Major
Configure