Class ColumnarContext
java.lang.Object
io.krabka.streams.columnar.ColumnarContext
Collects batches that a columnar processor forwards.
A fresh context is handed to ColumnarProcessor.process(ColumnarContext, VectorSchemaRoot) for every input
batch. Calling forward(VectorSchemaRoot) zero times drops the batch, once
passes one batch downstream, and several times fans the input out into several
downstream batches, delivered in forwarding order.
Example
ColumnarProcessor splitBySize = (context, batch) -> {
context.forward(smallRows(batch));
context.forward(largeRows(batch));
};
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidforward(org.apache.arrow.vector.VectorSchemaRoot batch) Forwards one batch to every downstream node.
-
Constructor Details
-
ColumnarContext
public ColumnarContext()Creates an empty context.The framework creates one per processed batch; create one directly only to unit-test a
ColumnarProcessoroutside a topology.
-
-
Method Details
-
forward
public void forward(org.apache.arrow.vector.VectorSchemaRoot batch) Forwards one batch to every downstream node.Ownership of a forwarded batch transfers to the framework, which closes it once downstream processing finishes. Forwarding the input batch itself is allowed.
- Parameters:
batch- the batch to pass downstream- Throws:
NullPointerException- ifbatchis null
-