Class OffsetMapCodecManager<K,V>

java.lang.Object
io.confluent.parallelconsumer.offsets.OffsetMapCodecManager<K,V>

public class OffsetMapCodecManager<K,V> extends Object
Uses multiple encodings to compare, when decided, can refactor other options out for analysis only - encodeOffsetsCompressed(long, io.confluent.parallelconsumer.state.PartitionState<K, V>)

TODO: consider IO exception management - question sneaky throws usage?

TODO: enforce max uncommitted < encoding length (Short.MAX)

Bitset serialisation format:

  • byte1: magic
  • byte2-3: Short: bitset size
  • byte4-n: serialised BitSet
  • Field Details

    • METADATA_DATA_SIZE_RESOURCE_LOCK

      public static final String METADATA_DATA_SIZE_RESOURCE_LOCK
      Used to prevent tests running in parallel that depends on setting static state in this class. Manipulation of static state in tests needs to be removed to this isn't necessary.

      todo remove static state manipulation from tests (make non static)

      See Also:
    • DefaultMaxMetadataSize

      public static int DefaultMaxMetadataSize
      Maximum size of the commit offset metadata
      See Also:
    • CHARSET_TO_USE

      public static final Charset CHARSET_TO_USE
    • forcedCodec

      public static Optional<OffsetEncoding> forcedCodec
      Forces the use of a specific codec, instead of choosing the most efficient one. Useful for testing.
  • Constructor Details

    • OffsetMapCodecManager

      public OffsetMapCodecManager(org.apache.kafka.clients.consumer.Consumer<K,V> consumer)
  • Method Details