Interface KeyResolver<AID extends AggregateId>

  • Type Parameters:
    AID - Aggregate ID type / 集約IDの型
    All Known Implementing Classes:
    DefaultKeyResolver

    public interface KeyResolver<AID extends AggregateId>
    This is an interface for resolving partition keys and sort keys from aggregate IDs. / 集約IDからパーティションキーとソートキーを解決するためのインターフェース。
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String resolvePartitionKey​(AID aggregateId, long shardCount)
      Resolves the partition key from the aggregate id.
      java.lang.String resolveSortKey​(AID aggregateId, long sequenceNumber)
      Resolves the sort key from the aggregate id and sequence number.
    • Method Detail

      • resolvePartitionKey

        @Nonnull
        java.lang.String resolvePartitionKey​(@Nonnull
                                             AID aggregateId,
                                             long shardCount)
        Resolves the partition key from the aggregate id. / 集約IDからパーティションキーを解決します。
        Parameters:
        aggregateId - aggregate id / 集約ID
        shardCount - shard count / シャード数
        Returns:
        partition key / パーティションキー
      • resolveSortKey

        @Nonnull
        java.lang.String resolveSortKey​(@Nonnull
                                        AID aggregateId,
                                        long sequenceNumber)
        Resolves the sort key from the aggregate id and sequence number. / 集約IDとシーケンス番号からソートキーを解決します。
        Parameters:
        aggregateId - aggregate id / 集約ID
        sequenceNumber - sequence number / シーケンス番号
        Returns:
        sort key / ソートキー