Skip to content

分布式 ID(forge-starter-id)

工程位置:forge-server/forge-framework/forge-starter-parent/forge-starter-id。Maven artifactIdforge-starter-idsrc/main/java 里有 19 个 Java 文件。

引入

xml
<dependency>
    <groupId>com.mdframe.forge</groupId>
    <artifactId>forge-starter-id</artifactId>
</dependency>

自动装配

META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports 登记了:

  • com.mdframe.forge.starter.id.config.IdAutoConfiguration

配置属性

uid.defaultcom.mdframe.forge.starter.id.properties.UidDefaultGeneratorProperties

字段类型类内默认值说明
timeBitsint23
workerBitsint31
seqBitsint9
epochStrString"2021-04-07"

uid.cachecom.mdframe.forge.starter.id.properties.UidCacheGeneratorProperties

字段类型类内默认值说明
timeBitsint30
workerBitsint27
seqBitsint6
epochStrString"2021-04-07"

类内默认值不是官方启动配置。各服务 application.yml 可以覆盖。

源码类型清单

下面只列 forge-starter-id 自己的公开类型。

接口

  • com.mdframe.forge.starter.id.mapper.SysIdSequenceMapper
  • com.mdframe.forge.starter.id.mapper.WorkerNodePOMapper
  • com.mdframe.forge.starter.id.service.IIdService
  • com.mdframe.forge.starter.id.service.ISequenceService
  • com.mdframe.forge.starter.id.service.IWorkNodePOAtomicService

  • FusionDisposableWorkerIdAssigner
  • IWorkNodePOAtomicServiceImpl
  • IdAutoConfiguration
  • IdController
  • IdGeneratorConfiguration
  • IdServerPropertiesProcessor
  • IdServiceImpl
  • SegmentSequenceGenerator
  • SequenceController
  • SequenceServiceImpl
  • SysIdSequence
  • UidCacheGeneratorProperties
  • UidDefaultGeneratorProperties
  • WorkerNodePO

相关文档