ShardingAlgorithm

全限定类名

org.apache.shardingsphere.sharding.spi.ShardingAlgorithm

定义

分片算法

已知实现

配置标识自动分片算法详细说明全限定类名
MODY基于取模的分片算法org.apache.shardingsphere.sharding.algorithm.sharding.mod.ModShardingAlgorithm
HASH_MODY基于哈希取模的分片算法org.apache.shardingsphere.sharding.algorithm.sharding.mod.HashModShardingAlgorithm
BOUNDARY_RANGEY基于分片边界的范围分片算法org.apache.shardingsphere.sharding.algorithm.sharding.range.BoundaryBasedRangeShardingAlgorithm
VOLUME_RANGEY基于分片容量的范围分片算法org.apache.shardingsphere.sharding.algorithm.sharding.range.VolumeBasedRangeShardingAlgorithm
AUTO_INTERVALY基于可变时间范围的分片算法org.apache.shardingsphere.sharding.algorithm.sharding.datetime.AutoIntervalShardingAlgorithm
INTERVALN基于固定时间范围的分片算法org.apache.shardingsphere.sharding.algorithm.sharding.datetime.IntervalShardingAlgorithm
CLASS_BASEDN基于自定义类的分片算法org.apache.shardingsphere.sharding.algorithm.sharding.classbased.ClassBasedShardingAlgorithm
INLINEN基于行表达式的分片算法org.apache.shardingsphere.sharding.algorithm.sharding.inline.InlineShardingAlgorithm
COMPLEX_INLINEN基于行表达式的复合分片算法org.apache.shardingsphere.sharding.algorithm.sharding.complex.ComplexInlineShardingAlgorithm
HINT_INLINEN基于行表达式的 Hint 分片算法org.apache.shardingsphere.sharding.algorithm.sharding.hint.HintInlineShardingAlgorithm
COSID_MODN基于 CosId 的取模分片算法org.apache.shardingsphere.sharding.cosid.algorithm.sharding.mod.CosIdModShardingAlgorithm
COSID_INTERVALN基于 CosId 的固定时间范围的分片算法org.apache.shardingsphere.sharding.cosid.algorithm.sharding.interval.CosIdIntervalShardingAlgorithm
COSID_INTERVAL_SNOWFLAKEN基于 CosId 的雪花ID固定时间范围的分片算法org.apache.shardingsphere.sharding.cosid.algorithm.sharding.interval.CosIdSnowflakeIntervalShardingAlgorithm

KeyGenerateAlgorithm

全限定类名

org.apache.shardingsphere.sharding.spi.KeyGenerateAlgorithm

定义

分布式主键生成算法

已知实现

配置标识详细说明全限定类名
SNOWFLAKE基于雪花算法的分布式主键生成算法org.apache.shardingsphere.sharding.algorithm.keygen.SnowflakeKeyGenerateAlgorithm
UUID基于 UUID 的分布式主键生成算法org.apache.shardingsphere.sharding.algorithm.keygen.UUIDKeyGenerateAlgorithm
NANOID基于 NanoId 的分布式主键生成算法org.apache.shardingsphere.sharding.nanoid.algorithm.keygen.NanoIdKeyGenerateAlgorithm
COSID基于 CosId 的分布式主键生成算法org.apache.shardingsphere.sharding.cosid.algorithm.keygen.CosIdKeyGenerateAlgorithm
COSID_SNOWFLAKE基于 CosId 的雪花算法分布式主键生成算法org.apache.shardingsphere.sharding.cosid.algorithm.keygen.CosIdSnowflakeKeyGenerateAlgorithm

ShardingAuditAlgorithm

全限定类名

org.apache.shardingsphere.sharding.spi.ShardingAuditAlgorithm

定义

分片审计算法

已知实现

配置标识详细说明全限定类名
DML_SHARDING_CONDITIONS禁止不带分片键的DML审计算法org.apache.shardingsphere.sharding.algorithm.audit.DMLShardingConditionsShardingAuditAlgorithm

DatetimeService

全限定类名

org.apache.shardingsphere.infra.datetime.DatetimeService

定义

获取当前时间进行路由

已知实现

配置标识详细说明全限定类名
DatabaseDatetimeService从数据库中获取当前时间进行路由org.apache.shardingsphere.datetime.database.DatabaseDatetimeService
SystemDatetime从应用系统时间中获取当前时间进行路由org.apache.shardingsphere.datetime.system.SystemDatetimeService