Class PartitionedSequentialKey


  • public class PartitionedSequentialKey
    extends java.lang.Object
    A key which contains partition, tstamp and identifier values. This key can be used to track changes being stored in a database. The partition value is used to distribute the keyspace in a partitioned datastore (like Cassandra). This means that jobs needing to scan the keys will need to scan each of the partitions, but this is useful because it's easy to parallelize. The tstamp field is simply the current UTC time. This creates a timeline which can be used to scan records in approximate time-order. Because this is not unique, algorithms such as reconciliation (looking for payloads stored in COS which aren't in the RDBMS) can only checkpoint to the tstamp level, not an individual key. This is OK, because restart from a checkpoint will be rare, and there should be relatively few keys sharing the same tstamp (assuming millisecond accuracy). The identifier is a random UUID and can be assumed to be globally unique.
    • Constructor Detail

      • PartitionedSequentialKey

        protected PartitionedSequentialKey​(int partition,
                                           long tstamp,
                                           java.lang.String resourceType,
                                           java.lang.String logicalId,
                                           int version)
        Protected constructor.
        Parameters:
        partition -
        tstamp -
        identifier -
    • Method Detail

      • getPartition

        public int getPartition()
        Returns:
        the partition
      • getTstamp

        public long getTstamp()
        Returns:
        the tstamp
      • getResourceType

        public java.lang.String getResourceType()
        Returns:
        the resourceType
      • getLogicalId

        public java.lang.String getLogicalId()
        Returns:
        the logicalId
      • getVersion

        public int getVersion()
        Returns:
        the version
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object