public class TableOptions extends Object implements Jsonizable
TTL: Short for TimeToLive. TableStore supports automatic expiration of data; TimeToLive is the duration that data remains valid.
The server determines whether each version of every column has expired based on the current time, the version number of each version of every column, and the table's TTL settings. Expired data will be automatically cleaned up.MaxVersions: The maximum number of versions that TableStore retains for each column in a row. When the number of written versions exceeds MaxVersions, TableStore only keeps the MaxVersions most recent versions with the highest version numbers.
MaxTimeDeviation: The maximum allowable deviation between the version specified when writing data to TableStore and the system time. Data with a deviation greater than MaxTimeDeviation from the system time is not allowed to be written.
| 构造器和说明 |
|---|
TableOptions()
Constructs a TableOptions object.
|
TableOptions(boolean allowUpdate)
Construct a TableOptions object
|
TableOptions(boolean allowUpdate,
boolean updateFullRow)
Construct a TableOptions object.
|
TableOptions(int timeToLive)
Constructs a TableOptions object.
|
TableOptions(int timeToLive,
int maxVersions)
Construct a TableOptions object.
|
TableOptions(int timeToLive,
int maxVersions,
long maxTimeDeviation)
Constructs a TableOptions object.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
getAllowUpdate()
Get whether the data in the table allows Update operations
|
long |
getMaxTimeDeviation()
Get the maximum deviation allowed between the version specified when writing data and the system's current time.
|
int |
getMaxVersions()
Get the maximum number of versions.
|
int |
getTimeToLive()
Get the TTL time, in seconds.
|
boolean |
getUpdateFullRow()
Check if the entire row must be updated together when performing an Update operation.
|
boolean |
hasSetAllowUpdate()
Query whether
setAllowUpdate(boolean) is called to prohibit/allow Update operations on the data in the table |
boolean |
hasSetMaxTimeDeviation()
Query whether
setMaxTimeDeviation(long) has been called to set MaxTimeDeviation. |
boolean |
hasSetMaxVersions()
Query whether
setMaxVersions(int) has been called to set MaxVersions. |
boolean |
hasSetTimeToLive()
Query whether
setTimeToLive(int) has been called to set TTL. |
boolean |
hasSetUpdateFullRow()
Query whether
setUpdateFullRow(boolean) is called to set if the entire row must be updated together when updating data. |
String |
jsonize() |
void |
jsonize(StringBuilder sb,
String newline) |
protected boolean |
jsonizeFields(StringBuilder sb,
boolean firstItem) |
void |
setAllowUpdate(boolean allowUpdate)
Set whether the data in the table allows or prohibits Update operations
|
void |
setMaxTimeDeviation(long maxTimeDeviation)
Set the maximum deviation allowed between the version specified when writing data and the system's current time.
|
void |
setMaxVersions(int maxVersions)
Set the maximum number of versions.
|
void |
setTimeToLive(int timeToLive)
Set the TTL for table data, in seconds.
|
void |
setTimeToLiveInDays(int days)
Set the TTL time for table data
|
void |
setUpdateFullRow(boolean updateFullRow)
Set whether the table must be updated with the entire row during data Update
|
String |
toString() |
public TableOptions()
public TableOptions(int timeToLive)
timeToLive - TTL timepublic TableOptions(int timeToLive,
int maxVersions)
timeToLive - TTL timemaxVersions - Maximum number of versions to retainpublic TableOptions(int timeToLive,
int maxVersions,
long maxTimeDeviation)
timeToLive - Time-to-live (TTL) durationmaxVersions - Maximum number of versions to retainmaxTimeDeviation - Maximum allowable deviation between the specified version being written and the system timepublic TableOptions(boolean allowUpdate)
public TableOptions(boolean allowUpdate,
boolean updateFullRow)
allowUpdate - Whether to allow Update operationsupdateFullRow - Whether the entire row must be updated together during an Update operationpublic int getTimeToLive()
IllegalStateException - if this parameter is not configuredpublic void setTimeToLive(int timeToLive)
timeToLive - TTL time, in secondspublic void setTimeToLiveInDays(int days)
days - TTL time, in dayspublic boolean hasSetTimeToLive()
setTimeToLive(int) has been called to set TTL.public int getMaxVersions()
IllegalStateException - if this parameter is not configuredpublic void setMaxVersions(int maxVersions)
maxVersions - the maximum number of versionspublic boolean hasSetMaxVersions()
setMaxVersions(int) has been called to set MaxVersions.public long getMaxTimeDeviation()
IllegalStateException - If this parameter is not configuredpublic void setMaxTimeDeviation(long maxTimeDeviation)
maxTimeDeviation - Maximum deviation in secondspublic boolean hasSetMaxTimeDeviation()
setMaxTimeDeviation(long) has been called to set MaxTimeDeviation.public void setAllowUpdate(boolean allowUpdate)
allowUpdate - public boolean hasSetAllowUpdate()
setAllowUpdate(boolean) is called to prohibit/allow Update operations on the data in the tablepublic boolean getAllowUpdate()
IllegalStateException - If this parameter is not configuredpublic boolean hasSetUpdateFullRow()
setUpdateFullRow(boolean) is called to set if the entire row must be updated together when updating data.public boolean getUpdateFullRow()
IllegalStateException - If this parameter is not configured.public void setUpdateFullRow(boolean updateFullRow)
updateFullRow - public String jsonize()
jsonize 在接口中 Jsonizablepublic void jsonize(StringBuilder sb, String newline)
jsonize 在接口中 Jsonizableprotected boolean jsonizeFields(StringBuilder sb, boolean firstItem)
Copyright © 2025. All Rights Reserved.