Class IndexedDocument
- java.lang.Object
-
- io.camunda.zeebe.engine.state.variable.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 eachIterator.next()
call, meaning that if you want to collect entries you should clone them before callingIterator.next()
again.
-
-
Constructor Summary
Constructors Constructor Description IndexedDocument()
IndexedDocument(MsgPackReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
index(org.agrona.DirectBuffer document)
boolean
isEmpty()
io.camunda.zeebe.engine.state.variable.DocumentEntryIterator
iterator()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
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 interfaceIterable<DocumentEntry>
-
isEmpty
public boolean isEmpty()
-
-