cassandra中TTL的最大值 [英] Max value for TTL in cassandra
本文介绍了cassandra中TTL的最大值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们可以分配给TTL的最大值是什么?
在Cassandra的Java驱动程序中,TTL设置为int。这是否意味着它仅限于Integer.MAX(2,147,483,647秒)?
解决方案
最大TTL实际上是20年。来自 org.apache.cassandra.db.ExpiringCell
:
公共静态最终整数MAX_TTL = 20 * 365 * 24 * 60 * 60; // 20年以秒为单位
我认为这已在CQL和Thrift查询路径中得到验证。 / p>
What is the maximum value we can assign to TTL ?
In the java driver for cassandra TTL is set as a int. Does that mean it is limited to Integer.MAX (2,147,483,647 secs) ?
解决方案
The maximum TTL is actually 20 years. From org.apache.cassandra.db.ExpiringCell
:
public static final int MAX_TTL = 20 * 365 * 24 * 60 * 60; // 20 years in seconds
I think this is verified along both the CQL and Thrift query paths.
这篇关于cassandra中TTL的最大值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文