Processing Messages / Aggregation States

Processing Messages And AggregationStates

Single processing units are represented by instances of type ProcessingMessage. This allows enriching of values with tags, which can be used for selective result handling, such as result writing, aggregations and selective handling of values.

Completion of a single batch is signalled by message of type AggregationState. This can be of two types:

  • AggregationStateWithoutData: provide info about completed batch without the generated data
  • AggregationStateWithData: provide info about completed batch with the generated data
trait AggregationState[+T] extends KolibriSerializable with TaggedWithType {
    val jobID: String
    val batchNr: Int
    val executionExpectation: ExecutionExpectation
}

case class AggregationStateWithoutData[+V](containedElementCount: Int,
                                           jobID: String,
                                           batchNr: Int,
                                           executionExpectation: ExecutionExpectation) extends AggregationState[V]

case class AggregationStateWithData[+V](data: V,
                                        jobID: String,
                                        batchNr: Int,
                                        executionExpectation: ExecutionExpectation) extends AggregationState[V]