Skip to content

Commit

Permalink
Added documentation for Interval Sharding Algorithm's handling of tim…
Browse files Browse the repository at this point in the history
…e zones. (apache#19170)
  • Loading branch information
linghengqian authored Jul 15, 2022
1 parent 457ca74 commit 0fe7f40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ Apache ShardingSphere 内置的标准分片算法实现类包括:

#### 时间范围分片算法

当传入的分片键为 `java.time.Instant` 时存在特例处理,其会携带上系统的时区信息后转化为 `datetime-pattern` 的字符串格式, 再进行下一步分片。
此算法主动忽视了 `datetime-pattern` 的时区信息。
这意味着当 `datetime-lower`, `datetime-upper` 和传入的分片键含有时区信息时,不会因为时区不一致而发生时区转换。
当传入的分片键为 `java.time.Instant` 时存在特例处理,其会携带上系统的时区信息后转化为 `datetime-pattern` 的字符串格式,再进行下一步分片。

类型:INTERVAL

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ Attributes:

#### Interval Sharding Algorithm

This algorithm actively ignores the time zone information of `datetime-pattern`.
This means that when `datetime-lower`, `datetime-upper` and the incoming shard key contain time zone information, time zone conversion will not occur due to time zone inconsistencies.
When the incoming sharding key is `java.time.Instant`, there is a special case, which will carry the time zone information of the system and convert it into the string format of `datetime-pattern`, and then proceed to the next sharding.

Type: INTERVAL
Expand Down

0 comments on commit 0fe7f40

Please sign in to comment.