Class IndexedDocument

  • All Implemented Interfaces:
    Iterable<DocumentEntry>

    public final class IndexedDocument
    extends Object
    implements Iterable<DocumentEntry>
    This class indexes a MsgPack document from the given buffer by doing an initial parsing and caching the offsets for each key-value pair. When iterating, it will then only iterate over these pairs and access them directly via the buffer.

    This class is meant to be mutable and reusable - this means that the expected usage is to index the document and read it/iterate over it BEFORE indexing a new document again.

    Similarly, the iterator will reuse and mutate the same DocumentEntry instance on each Iterator.next() call, meaning that if you want to collect entries you should clone them before calling Iterator.next() again.

    • Constructor Detail

      • IndexedDocument

        public IndexedDocument()
      • IndexedDocument

        public IndexedDocument​(MsgPackReader reader)
    • Method Detail

      • index

        public void index​(org.agrona.DirectBuffer document)
      • iterator

        public io.camunda.zeebe.engine.state.variable.DocumentEntryIterator iterator()
        Specified by:
        iterator in interface Iterable<DocumentEntry>
      • isEmpty

        public boolean isEmpty()