Skip to content

Releases: Ahoo-Wang/CosId

v1.7.2

05 Jan 14:04
Compare
Choose a tag to compare

⭐ New Features

  • Enhance SnowflakeIntervalShardingAlgorithm to support String type shardingValue.
  • Enhance @AsString to support custom timestampBit/machineBit/sequenceBit.

⭐ 新特性

  • 增强 SnowflakeIntervalShardingAlgorithm 支持 String 类型的 shardingValue
  • 增强 @AsString 支持自定义 timestampBit/machineBit/sequenceBit

v1.7.0

03 Jan 05:49
Compare
Choose a tag to compare

📔 Documentation

🔨 Refactor

  • rename SmartIntervalShardingAlgorithm to CosIdIntervalShardingAlgorithm (Consistent with ShardingSphere)
  • rename ModShardingAlgorithm to CosIdModShardingAlgorithm (Consistent with ShardingSphere)
  • @Deprecated DateIntervalShardingAlgorithm/ LocalDateTimeIntervalShardingAlgorithm / StringIntervalShardingAlgorithm / TimestampIntervalShardingAlgorithm / TimestampOfSecondIntervalShardingAlgorithm , merge to CosIdIntervalShardingAlgorithm.

📔 文档

🔨 重构

  • 重命名 SmartIntervalShardingAlgorithmCosIdIntervalShardingAlgorithm (与 ShardingSphere 保持一致)
  • 重命名 ModShardingAlgorithm to CosIdModShardingAlgorithm (与 ShardingSphere 保持一致)
  • @Deprecated DateIntervalShardingAlgorithm/ LocalDateTimeIntervalShardingAlgorithm / StringIntervalShardingAlgorithm / TimestampIntervalShardingAlgorithm / TimestampOfSecondIntervalShardingAlgorithm , 合并为 CosIdIntervalShardingAlgorithm.

v1.6.6

28 Dec 12:28
Compare
Choose a tag to compare

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

27 Dec 13:52
Compare
Choose a tag to compare

New feature

  • add JdbcMachineIdDistributor to support the use of relational database storage as MachineIdDistributor.
  • 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

25 Dec 06:27
Compare
Choose a tag to compare

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

24 Dec 14:34
Compare
Choose a tag to compare

New feature

  • add IdSegmentDistributorFactory to support flexible replacement of IdSegmentDistributor.
  • 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 to IdSegmentDistributorFactory.
  • add RedisIdSegmentDistributorFactory to adapt to IdSegmentDistributorFactory.
  • add SpringRedisIdSegmentDistributorFactory to adapt to IdSegmentDistributorFactory.
  • refactor CosIdJdbcSegmentAutoConfiguration to adapt to IdSegmentDistributorFactory to reduce code redundancy.
  • refactor CosIdSegmentAutoConfiguration to adapt to IdSegmentDistributorFactory to reduce code redundancy.
  • refactor CosIdSpringRedisSegmentAutoConfiguration to adapt to IdSegmentDistributorFactory to reduce code redundancy.
  • refactor CosIdRedisSegmentAutoConfiguration to adapt to IdSegmentDistributorFactory 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

23 Dec 13:18
Compare
Choose a tag to compare

New feature

  • add IdConverter to support custom long type ID convert to String 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 to friendlyId. (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

18 Dec 05:02
Compare
Choose a tag to compare
  • Unified sharding algorithm logical-name-prefix as properties key
  • Unified date format datetime-lower and datetime-upper to yyyy-MM-dd HH:mm:ss (AbstractIntervalShardingAlgorithm).

v1.4.12

16 Dec 11:45
Compare
Choose a tag to compare
  • 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 to io.github.gradle-nexus.publish-plugin
  • update jmhVersion -> 1.33

v1.4.10

14 Dec 14:41
Compare
Choose a tag to compare
  • 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