doanduyhai / Achilles

An advanced Java Object Mapper/Query DSL generator for Cassandra
http://achilles.archinnov.info
Apache License 2.0
241 stars 92 forks source link

get total number of pages #322

Closed fortm closed 6 years ago

fortm commented 6 years ago

Using withFetchSize, withPagingState and getListWithStats, it is possible to implement pagination using achilles. But to display total number of pages, so that on client side we can show - Showing page 2 of 10 ( in this case total pages =10 ) - does getListWithStats also expose that metric ?

doanduyhai commented 6 years ago

It is just technically impossible to have the total page count. We're using a distributed system and there is no lock on the database so basically new data can come in while you're iterating through the pages.