Releases: Ahoo-Wang/CosId
Releases · Ahoo-Wang/CosId
v1.7.2
⭐ New Features
- Enhance
SnowflakeIntervalShardingAlgorithm
to supportString
typeshardingValue
. - Enhance
@AsString
to support customtimestampBit
/machineBit
/sequenceBit
.
⭐ 新特性
- 增强
SnowflakeIntervalShardingAlgorithm
支持String
类型的shardingValue
。 - 增强
@AsString
支持自定义timestampBit
/machineBit
/sequenceBit
。
v1.7.0
📔 Documentation
- add document https://cosid.ahoo.me/.
🔨 Refactor
- rename
SmartIntervalShardingAlgorithm
toCosIdIntervalShardingAlgorithm
(Consistent with ShardingSphere) - rename
ModShardingAlgorithm
toCosIdModShardingAlgorithm
(Consistent with ShardingSphere) @Deprecated
DateIntervalShardingAlgorithm
/LocalDateTimeIntervalShardingAlgorithm
/StringIntervalShardingAlgorithm
/TimestampIntervalShardingAlgorithm
/TimestampOfSecondIntervalShardingAlgorithm
, merge toCosIdIntervalShardingAlgorithm
.
📔 文档
- 添加 文档 https://cosid.ahoo.me/.
🔨 重构
- 重命名
SmartIntervalShardingAlgorithm
为CosIdIntervalShardingAlgorithm
(与 ShardingSphere 保持一致) - 重命名
ModShardingAlgorithm
toCosIdModShardingAlgorithm
(与 ShardingSphere 保持一致) @Deprecated
DateIntervalShardingAlgorithm
/LocalDateTimeIntervalShardingAlgorithm
/StringIntervalShardingAlgorithm
/TimestampIntervalShardingAlgorithm
/TimestampOfSecondIntervalShardingAlgorithm
, 合并为CosIdIntervalShardingAlgorithm
.
v1.6.6
New feature
- add
JdbcMachineIdInitializer
. - add
AsStringDeserializer
. - add
AsStringSerializer
. - add
@AsString
.(cosid-jackson)
public class AsStringDto {
@AsString
private Long id;
@AsString(AsString.Type.RADIX)
private Long radixId;
@AsString(value = AsString.Type.RADIX, radixPadStart = true)
private Long radixPadStartId;
@AsString(value = AsString.Type.RADIX, radixPadStart = true, radixCharSize = 10)
private Long radixPadStartCharSize10Id;
@AsString(AsString.Type.FRIENDLY_ID)
private long friendlyId;
// getter / setter
}
Results after serialization
{
"id": "266300479548424192",
"radixId": "JferHIEYZk",
"radixPadStartId": "0JferHIEYZk",
"radixPadStartCharSize10Id": "JferHIEYZk",
"friendlyId": "20211228202301948-0-0"
}
新特性
- 新增
JdbcMachineIdInitializer
。 - 新增
AsStringDeserializer
。 - 新增
AsStringSerializer
. - 新增
@AsString
.(cosid-jackson)
public class AsStringDto {
@AsString
private Long id;
@AsString(AsString.Type.RADIX)
private Long radixId;
@AsString(value = AsString.Type.RADIX, radixPadStart = true)
private Long radixPadStartId;
@AsString(value = AsString.Type.RADIX, radixPadStart = true, radixCharSize = 10)
private Long radixPadStartCharSize10Id;
@AsString(AsString.Type.FRIENDLY_ID)
private long friendlyId;
// getter / setter
}
序列化结果
{
"id": "266300479548424192",
"radixId": "JferHIEYZk",
"radixPadStartId": "0JferHIEYZk",
"radixPadStartCharSize10Id": "JferHIEYZk",
"friendlyId": "20211228202301948-0-0"
}
v1.6.5
New feature
- add
JdbcMachineIdDistributor
to support the use of relational database storage asMachineIdDistributor
. - add
CosIdJdbcMachineIdDistributorAutoConfiguration
.
cosid:
snowflake:
machine:
distributor:
type: jdbc
CosIdKeyGenerateAlgorithm
support generate Key as String.
Bug Fix
- fix
DistributedAtomicNumber
missing check succeeded status.
新特性
- 新增
JdbcMachineIdDistributor
以支持使用关系型数据库存储作为机器号分发器。 - 新增
CosIdJdbcMachineIdDistributorAutoConfiguration
以便集成JdbcMachineIdDistributor
。
cosid:
snowflake:
machine:
distributor:
type: jdbc
CosIdKeyGenerateAlgorithm
支持生成字符串类型的分布式主键。
Bug 修复
- 修复
DistributedAtomicNumber
丢失成功状态检查。
v1.6.1
New feature
- Add
CosIdZookeeperAutoConfiguration
to reduce the complexity when integrating ZooKeeper.
cosid:
zookeeper:
enabled: true
connect-string: localhost:2181
retry:
base-sleep-time-ms: 100
max-retries: 5
max-sleep-ms: 500
block-until-connected-wait: 10s
segment:
distributor:
type: zookeeper
snowflake:
machine:
distributor:
type: zookeeper
新特性
- 新增
CosIdZookeeperAutoConfiguration
以便集成 ZooKeeper 时降低复杂度。
cosid:
zookeeper:
enabled: true
connect-string: localhost:2181
retry:
base-sleep-time-ms: 100
max-retries: 5
max-sleep-ms: 500
block-until-connected-wait: 10s
segment:
distributor:
type: zookeeper
snowflake:
machine:
distributor:
type: zookeeper
v1.6.0
New feature
- add
IdSegmentDistributorFactory
to support flexible replacement ofIdSegmentDistributor
. - add
ZookeeperIdSegmentDistributorFactory
. - add
ZookeeperMachineIdDistributor
to support machine id distribute based on ZooKeeper. #10 - add
CosIdZookeeperSegmentAutoConfiguration
(cosid-spring-boot-starter).
cosid:
segment:
distributor:
type: zookeeper
- add
CosIdZookeeperMachineIdDistributorAutoConfiguration
(cosid-spring-boot-starter).
cosid:
snowflake:
machine:
distributor:
type: zookeeper
Refactor
- add
JdbcIdSegmentDistributorFactory
to adapt toIdSegmentDistributorFactory
. - add
RedisIdSegmentDistributorFactory
to adapt toIdSegmentDistributorFactory
. - add
SpringRedisIdSegmentDistributorFactory
to adapt toIdSegmentDistributorFactory
. - refactor
CosIdJdbcSegmentAutoConfiguration
to adapt toIdSegmentDistributorFactory
to reduce code redundancy. - refactor
CosIdSegmentAutoConfiguration
to adapt toIdSegmentDistributorFactory
to reduce code redundancy. - refactor
CosIdSpringRedisSegmentAutoConfiguration
to adapt toIdSegmentDistributorFactory
to reduce code redundancy. - refactor
CosIdRedisSegmentAutoConfiguration
to adapt toIdSegmentDistributorFactory
to reduce code redundancy.
新特性
- 新增
IdSegmentDistributorFactory
以支持灵活替换IdSegmentDistributor
。 - 新增
ZookeeperIdSegmentDistributorFactory
。 - 新增
ZookeeperMachineIdDistributor
以支持基于ZooKeeper的机器号分配。#10 - 新增
CosIdZookeeperSegmentAutoConfiguration
(cosid-spring-boot-starter)。
cosid:
segment:
distributor:
type: zookeeper
- 新增
CosIdZookeeperMachineIdDistributorAutoConfiguration
(cosid-spring-boot-starter)。
cosid:
snowflake:
machine:
distributor:
type: zookeeper
重构
- 新增
JdbcIdSegmentDistributorFactory
适配IdSegmentDistributorFactory
。 - 新增
RedisIdSegmentDistributorFactory
适配IdSegmentDistributorFactory
。 - 新增
SpringRedisIdSegmentDistributorFactory
适配IdSegmentDistributorFactory
。 - 重构
CosIdJdbcSegmentAutoConfiguration
适配IdSegmentDistributorFactory
降低代码冗余。 - 重构
CosIdSegmentAutoConfiguration
适配IdSegmentDistributorFactory
降低代码冗余。 - 重构
CosIdSpringRedisSegmentAutoConfiguration
适配IdSegmentDistributorFactory
降低代码冗余。 - 重构
CosIdRedisSegmentAutoConfiguration
适配IdSegmentDistributorFactory
降低代码冗余。
v1.5.1
New feature
- add
IdConverter
to support customlong
type ID convert toString
type ID. - add
Radix62IdConverter
to support string type ID compression. and ensure that the strings are in order. (264499621261217792
->JXPU9qorEu
) - add
SnowflakeFriendlyIdConverter
to support SnowflakeId convert tofriendlyId
. (264500352223547392
->20211223210958149-1-0
) - enhance cosid-spring-boot-starter to support
IdConverter
API. #9
short_id:
converter:
prefix: cosid_
type: radix
radix:
char-size: 11
pad-start: false
- add
ZookeeperIdSegmentDistributor
to support ZooKeeper id segment distributor. #10
新特性
- 新增
IdConverter
以支持自定义long
类型ID 转换成String
类型ID. - 新增
Radix62IdConverter
以支持字符串类型ID压缩。并且保证字符串有序。(264499621261217792
->JXPU9qorEu
) - 新增
SnowflakeFriendlyIdConverter
雪花算法ID转换friendlyId
。(264500352223547392
->20211223210958149-1-0
) - 增强 cosid-spring-boot-starter 以支持
IdConverter
API。 #9
short_id:
converter:
prefix: cosid_
type: radix
radix:
char-size: 11
pad-start: false
- 新增
ZookeeperIdSegmentDistributor
以支持 ZooKeeper 号段分发器。 #10
v1.4.14
v1.4.12
- Add some unit tests
- fix
AbstractIntervalShardingAlgorithm.convertRangeShardingValue
bug - api-change:
IntervalTimeline.sharding
An exception is thrown when the sharding value exceeds the range boundary - replace
io.codearte.nexus-staging
toio.github.gradle-nexus.publish-plugin
- update jmhVersion -> 1.33
v1.4.10
- Optimize
ModCycle
- Downgrade dependency
guava
[30.0-jre] -> [29.0-jre] (Consistent with ShardingSphere) - Add
StringIntervalShardingAlgorithm
to support date format of string type - Optimize
SmartIntervalShardingAlgorithm
to support date format of string type - Add
SnowflakeFriendlyIntervalShardingAlgorithm