public class TimeseriesTableOptions extends Object implements Jsonizable
TTL: TimeToLive的缩写, TableStore支持数据自动过期, TimeToLive即为数据的存活时间.
服务端根据当前时间, 每列每个版本的版本号, 表的TTL设置决定该列该版本是否过期, 过期的数据会自动清理.构造器和说明 |
---|
TimeseriesTableOptions()
构造TableOptions对象。
|
TimeseriesTableOptions(int timeToLive)
构造TableOptions对象。
|
限定符和类型 | 方法和说明 |
---|---|
int |
getTimeToLive()
获取TTL时间,单位为秒。
|
boolean |
hasSetTimeToLive()
查询是否调用
setTimeToLive(int) 设置了TTL。 |
String |
jsonize() |
void |
jsonize(StringBuilder sb,
String newline) |
protected boolean |
jsonizeFields(StringBuilder sb,
boolean firstItem) |
void |
setTimeToLive(int timeToLive)
设置表数据的TTL时间,单位为秒。
|
String |
toString()
获取最大版本数。
|
public TimeseriesTableOptions()
public TimeseriesTableOptions(int timeToLive)
timeToLive
- TTL时间public int getTimeToLive()
IllegalStateException
- 若没有配置该参数public void setTimeToLive(int timeToLive)
timeToLive
- TTL时间,单位为秒public boolean hasSetTimeToLive()
setTimeToLive(int)
设置了TTL。public String toString()
toString
在类中 Object
IllegalStateException
- 若没有配置该参数public String jsonize()
jsonize
在接口中 Jsonizable
public void jsonize(StringBuilder sb, String newline)
jsonize
在接口中 Jsonizable
protected boolean jsonizeFields(StringBuilder sb, boolean firstItem)
Copyright © 2021. All Rights Reserved.