Is there possible to store and transform into a String, a base64 or anything that I can return in JSON, to populate the object in another execution.
I found this example, but I’m not getting how to convert and decovert the ByteBuffer.
ResultSet rs = session.execute("your query");
ByteBuffer pagingState = rs.getExecutionInfo().getPagingState();
// Finish processing the current page
while (rs.getAvailableWithoutFetching() > 0) {
Row row = rs.one();
// process the row
}
// Later:
SimpleStatement statement =
SimpleStatement.builder("your query").setPagingState(pagingState).build();
session.execute(statement);
I have clients with milions of registers, which I need to paginate my queries, what I need is return in json an indicator that must have more registries, and the next request, the client send me this indicator, if there anyway to use number page, for example the client inform me the limit of registries in 1000 and want the 5º page I think it will be the best for the user experience.
If there is another way to paginate the ScyllaDB Query in different executions, I appreciate if somebody can share.