Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/323.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 卡桑德拉:一个页面存在多长时间?_Java_Cassandra_Paging_Cassandra 3.0 - Fatal编程技术网

Java 卡桑德拉:一个页面存在多长时间?

Java 卡桑德拉:一个页面存在多长时间?,java,cassandra,paging,cassandra-3.0,Java,Cassandra,Paging,Cassandra 3.0,我通过使用收集了大量数据(大约50万行),并在此过程中进行了一些商业智能。为了能够恢复我创建此表的过程 /** * This table stores temporary paging state */ CREATE TABLE IF NOT EXISTS lp_operations.paging_state ( id text, // ID of process pos bigint, // current position p

我通过使用收集了大量数据(大约50万行),并在此过程中进行了一些商业智能。为了能够恢复我创建此表的过程

/**
 * This table stores temporary paging state
 */
 CREATE TABLE IF NOT EXISTS lp_operations.paging_state (
     id text,          // ID of process
     pos bigint,       // current position
     page text,        // paging state
     info text,        // info json
     finished tinyint, // finished
     PRIMARY KEY (id)
 ) WITH default_time_to_live = 28800; // 8 hours
..其中我存储了当前页面(PagingState的字符串表示)和与计算相关的JSON元数据

问题

  • “页面”索引能否在Cassandra中过期
  • 它存在多长时间(默认情况下)

否,Cassandra驱动程序的分页状态不会过期。

因为每次使用分页状态进行查询时,cassandra实际上每次都执行查询。它不会存储您的结果。分页状态只是告诉cassandra驱动程序需要哪个索引中的数据

由于内部实现的详细信息,PagingState实例不能跨本机协议版本移植。在以下情况下,这可能会成为一个问题:

  • 您正在使用驱动程序2.0.x和Cassandra 2.0.x,因此使用本机协议v2
  • 用户将指向包含序列化分页状态的web服务的链接作为书签
  • 升级服务器堆栈以使用驱动程序2.1.x和Cassandra 2.1.x,因此现在使用的是协议v3

  • 用户尝试重新加载书签,但分页状态已使用协议v2序列化,因此尝试重新使用它将失败


来源:

谢谢,这是我想知道的,也是我想听到的:)