Skip to content

Commit

Permalink
Add keepttl opt (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyang8094 committed Aug 16, 2021
1 parent ae696e5 commit 47eb28d
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 94 deletions.
46 changes: 23 additions & 23 deletions CMDDOC-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
语法及复杂度:


> EXHSET <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [NX/XX] [VER/ABS version]
> EXHSET <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [NX/XX] [VER/ABS version] [KEEPTTL]
> 时间复杂度:O(1)

Expand All @@ -25,13 +25,13 @@
> key: 用于查找该TairHash的键
> field: TairHash中的一个元素
> value: TairHash中的一个元素对应的值
> EX: 指定field的相对过期时间,单位为秒,为0表示不过期
> EXAT: 指定field的绝对过期时间,单位为秒,为0表示不过期
> PX: 指定field的相对过期时间,单位为毫秒,为0表示不过期
> PXAT: 指定field的绝对过期时间,单位为毫秒 ,为0表示不过期
> EX: 指定field的相对过期时间,单位为秒,0表示立刻过期
> EXAT: 指定field的绝对过期时间,单位为秒,0表示立刻过期
> PX: 指定field的相对过期时间,单位为毫秒,0表示立刻过期
> PXAT: 指定field的绝对过期时间,单位为毫秒 ,0表示立刻过期
> NX/XX: NX表示当要插入的field不存在的时候才允许插入,XX表示只有当field存在的时候才允许插入
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号
> KEEPTTL: 当未指定EX/EXAT/PX/PXAT时保留field的过期时间
返回值:

Expand Down Expand Up @@ -133,7 +133,7 @@

> key: 用于查找该TairHash的键
> field: TairHash中的一个元素
> milliseconds-timestamp: 以毫秒为单位的时间戳
> milliseconds-timestamp: 以毫秒为单位的时间戳,0表示立刻过期
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号

Expand Down Expand Up @@ -168,7 +168,7 @@

> key: 用于查找该TairHash的键
> field: TairHash中的一个元素
> milliseconds: 以毫秒为单位的过期时间
> milliseconds: 以毫秒为单位的过期时间,0表示立刻过期
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号

Expand Down Expand Up @@ -201,7 +201,7 @@

> key: 用于查找该TairHash的键
> field: TairHash中的一个元素
> timestamp: 以秒为单位的时间戳
> timestamp: 以秒为单位的时间戳,0表示立刻过期
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号

Expand Down Expand Up @@ -237,7 +237,7 @@

> key: 用于查找该TairHash的键
> field: TairHash中的一个元素
> seconds: 以秒为单位的过期时间
> seconds: 以秒为单位的过期时间,0表示立刻过期
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号

Expand Down Expand Up @@ -392,7 +392,7 @@
语法及复杂度:


> EXHINCRBY <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] 
> EXHINCRBY <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] [KEEPTTL]
> [MIN minval] [MAX maxval]
> 时间复杂度:O(1)
Expand All @@ -412,12 +412,12 @@
> key: 用于查找该TairHash的键
> field: TairHash中的一个元素
> value: field对应的值
> EX: 指定field的相对过期时间,单位为秒 ,为0表示不过期
> EXAT: 指定field的绝对过期时间,单位为秒 ,为0表示不过期
> PX: 指定field的相对过期时间,单位为毫秒,为0表示不过期
> PXAT: 指定field的绝对过期时间,单位为毫秒,为0表示不过期
> EX: 指定field的相对过期时间,单位为秒 ,0表示立刻过期
> EXAT: 指定field的绝对过期时间,单位为秒 ,0表示立刻过期
> PX: 指定field的相对过期时间,单位为毫秒,0表示立刻过期
> PXAT: 指定field的绝对过期时间,单位为毫秒,0表示立刻过期
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号
> KEEPTTL: 当未指定EX/EXAT/PX/PXAT时保留field的过期时间
返回值:

Expand All @@ -433,7 +433,7 @@
语法及复杂度:


> EXHINCRBYFLOAT <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] [MIN minval] [MAX maxval]
> EXHINCRBYFLOAT <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] [MIN minval] [MAX maxval] [KEEPTTL]
> 时间复杂度:O(1)

Expand All @@ -452,12 +452,12 @@
> key: 用于查找该TairHash的键
> field: TairHash中的一个元素
> value: field对应的值
> EX: 指定field的相对过期时间,单位为秒,为0表示不过期
> EXAT: 指定field的绝对过期时间,单位为秒,为0表示不过期
> PX: 指定field的相对过期时间,单位为毫秒,为0表示不过期
> PXAT: 指定field的绝对过期时间,单位为毫秒,为0表示不过期
> EX: 指定field的相对过期时间,单位为秒,0表示立刻过期
> EXAT: 指定field的绝对过期时间,单位为秒,0表示立刻过期
> PX: 指定field的相对过期时间,单位为毫秒,0表示立刻过期
> PXAT: 指定field的绝对过期时间,单位为毫秒,0表示立刻过期
> VER/ABS: VER表示只有指定的版本和field当前的版本一致时才允许设置,如果VER指定的版本为0则表示不进行版本检查,ABS表示无论field当前的版本是多少都强制设置并修改版本号
> KEEPTTL: 当未指定EX/EXAT/PX/PXAT时保留field的过期时间
返回值:

Expand Down
44 changes: 23 additions & 21 deletions CMDDOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Grammar and complexity:


> EXHSET <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [NX/XX] [VER/ABS version]
> EXHSET <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [NX/XX] [VER/ABS version] [KEEPTTL]
> time complexity:O(1)
Command Description:
Expand All @@ -18,13 +18,13 @@ parameter:
> key: The key used to find the TairHash
> field: An element in TairHash
> value: The value corresponding to an element in TairHash
> EX: The relative expiration time of the specified field, in seconds, 0 means no expiration
> EXAT: Specify the absolute expiration time of the field, in seconds, 0 means no expiration
> PX: The relative expiration time of the specified field, in milliseconds, 0 means no expiration
> PXAT: Specify the absolute expiration time of the field, in milliseconds, 0 means no expiration
> EX: The relative expiration time of the specified field, in seconds, 0 means expire immediately
> EXAT: Specify the absolute expiration time of the field, in seconds, 0 means expire immediately
> PX: The relative expiration time of the specified field, in milliseconds, 0 means expire immediately
> PXAT: Specify the absolute expiration time of the field, in milliseconds, 0 means expire immediately
> NX/XX: NX means inserting is allowed only when the field to be inserted does not exist, XX means inserting is allowed only when the field exists
> VER/ABS: VER means that the setting is allowed only when the specified version is consistent with the current version of the field. If the version specified by VER is 0, it means that no version check will be performed. ABS means that the version number is forced to be set and modified regardless of the current version of the field.
> KEEPTTL: Retain the time to live associated with the field. KEEPTTL cannot be used together with EX/EXAT/PX/PXAT
Return:

Expand Down Expand Up @@ -120,7 +120,7 @@ Parameter:

> key: The key used to find the TairHash
> field: An element in TairHash
> milliseconds-timestamp: Timestamp in milliseconds
> milliseconds-timestamp: Timestamp in milliseconds, 0 means expire immediately
> VER/ABS: VER means that the setting is allowed only when the specified version is consistent with the current version of the field. If the version specified by VER is 0, it means that no version check will be performed. ABS means that the version number is forced to be set and modified regardless of the current version of the field.

Expand Down Expand Up @@ -155,7 +155,7 @@ Parameter:

> key: The key used to find the TairHash
> field: An element in TairHash
> milliseconds: Expiration time in milliseconds
> milliseconds: Expiration time in milliseconds, 0 means expire immediately
> VER/ABS: VER means that the setting is allowed only when the specified version is consistent with the current version of the field. If the version specified by VER is 0, it means that no version check will be performed. ABS means that the version number is forced to be set and modified regardless of the current version of the field.

Expand Down Expand Up @@ -190,7 +190,7 @@ Parameter:

> key: The key used to find the TairHash
> field: An element in TairHash
> timestamp: Timestamp in seconds
> timestamp: Timestamp in seconds,0 means expire immediately
> VER/ABS: VER means that the setting is allowed only when the specified version is consistent with the current version of the field. If the version specified by VER is 0, it means that no version check will be performed. ABS means that the version number is forced to be set and modified regardless of the current version of the field.

Expand Down Expand Up @@ -226,7 +226,7 @@ Parameter:

> key: The key used to find the TairHash
> field: An element in TairHash
> timestamp: Timestamp in seconds
> timestamp: Timestamp in seconds, 0 means expire immediately
> VER/ABS: VER means that the setting is allowed only when the specified version is consistent with the current version of the field. If the version specified by VER is 0, it means that no version check will be performed. ABS means that the version number is forced to be set and modified regardless of the current version of the field.

Expand Down Expand Up @@ -377,7 +377,7 @@ Return:
Grammar and complexity:


> EXHINCRBY <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] 
> EXHINCRBY <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] [KEEPTTL]
> [MIN minval] [MAX maxval]
> time complexity:O(1)
Expand All @@ -397,11 +397,13 @@ Parameter:
> key: The key used to find the TairHash
> field: An element in TairHash
> value: The value to be increased
> EX: The relative expiration time of the specified field, in seconds, 0 means no expiration
> EXAT: Specify the absolute expiration time of the field, in seconds, 0 means no expiration
> PX: The relative expiration time of the specified field, in milliseconds, 0 means no expiration
> PXAT: Specify the absolute expiration time of the field, in milliseconds, 0 means no expiration
> EX: The relative expiration time of the specified field, in seconds, 0 means expire immediately
> EXAT: Specify the absolute expiration time of the field, in seconds, 0 means expire immediately
> PX: The relative expiration time of the specified field, in milliseconds, 0 means expire immediately
> PXAT: Specify the absolute expiration time of the field, in milliseconds, 0 means expire immediately
> VER/ABS: VER means that the setting is allowed only when the specified version is consistent with the current version of the field. If the version specified by VER is 0, it means that no version check will be performed. ABS means that the version number is forced to be set and modified regardless of the current version of the field.
> KEEPTTL: Retain the time to live associated with the field. KEEPTTL cannot be used together with EX/EXAT/PX/PXAT

Return:

Expand All @@ -417,7 +419,7 @@ Return:
Grammar and complexity:


> EXHINCRBYFLOAT <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] [MIN minval] [MAX maxval]
> EXHINCRBYFLOAT <key> <field> <value> [EX time] [EXAT time] [PX time] [PXAT time] [VER/ABS version] [MIN minval] [MAX maxval] [KEEPTTL]
> time complexity:O(1)

Expand All @@ -436,12 +438,12 @@ Parameter:
> key: The key used to find the TairHash
> field: An element in TairHash
> value: The value to be increased
> EX: The relative expiration time of the specified field, in seconds, 0 means no expiration
> EXAT: Specify the absolute expiration time of the field, in seconds, 0 means no expiration
> PX: The relative expiration time of the specified field, in milliseconds, 0 means no expiration
> PXAT: Specify the absolute expiration time of the field, in milliseconds, 0 means no expiration
> EX: The relative expiration time of the specified field, in seconds, 0 means expire immediately
> EXAT: Specify the absolute expiration time of the field, in seconds, 0 means expire immediately
> PX: The relative expiration time of the specified field, in milliseconds, 0 means expire immediately
> PXAT: Specify the absolute expiration time of the field, in milliseconds, 0 means expire immediately
> VER/ABS: VER means that the setting is allowed only when the specified version is consistent with the current version of the field. If the version specified by VER is 0, it means that no version check will be performed. ABS means that the version number is forced to be set and modified regardless of the current version of the field.
> KEEPTTL: Retain the time to live associated with the field. KEEPTTL cannot be used together with EX/EXAT/PX/PXAT
Return:

Expand Down
Loading

0 comments on commit 47eb28d

Please sign in to comment.