Skip to content

feat: introduce calculation of the bucket id

This change introduces Picodata ShardingKey instance as a container for a distributed key for a specific table in Picodata cluster.

  1. PicodataShardingKey implements java.sql.ShardingKey, which is created through PicodataShardingKeyBuilder that implements java.sql.ShardingKeyBuilder.
  2. PicodataBaseDatasource now overrides createShardingKeyBuilder() which returns PicodataShardingKeyBuilder.
  3. This sharding key is passed to PicodataBucketIdCalculator, which returns unsigned bucket-id value. Under the hood it encodes each key part into MessagePack value according to the rules.

Not all types are supported so far. Message pack encoding is implemented only for the below list of Java types:

  • UUID
  • String
  • Integer
  • Short
  • Long
  • Double
  • Float
  • Byte
  • Boolean

Closes #40

Edited by Boris Sinyapkin

Merge request reports

Loading