基于cassandra的web应用程序中的分页 [英] pagination in cassandra based web application

查看:285
本文介绍了基于cassandra的web应用程序中的分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在基于cassandra的web应用程序中进行分页。我在服务器端使用spring MVC,在客户端使用jquery。我尝试了,但没有sutisfied。

How can i do a pagination in cassandra based web application. I am using spring MVC on server side and jquery on client side. I tried this but was not sutisfied.

我的行键是UUIDType,每次我从客户端浏览器发送开始键作为字符串,所以不知道如何将它转换回UUID。

My row key is UUIDType and every time i am sending the start key as string from client browser so dont know how to convert it back to UUID. A simple example will be appriciated.

推荐答案

如果您使用PlayOrm for cassandra,当您查询时会返回一个游标,读取前20个结果并显示它,下一页可以在您的会话中使用相同的光标,并且它在没有重新扫描前20行的情况下在它停止的位置拾取。

If you use PlayOrm for cassandra it returns a cursor when you query and as your first page reads in the first 20 results and displays it, the next page can just use the same cursor in your session and it picks up right where it left off without rescanning the first 20 rows again.

Dean

这篇关于基于cassandra的web应用程序中的分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆