public interface Monoidal extends Closable
reset(). This is a special case of a Monoid that works on
BulletRecord and allows you to collapse chained combinations of them with combine(byte[]) or
merge(Monoidal). You can extract the data using getData() to use with combine(byte[]) or
as results to present to the work with getResult() or getRecords() or getMetadata(). Note
that getMetadata() might not be strictly monoidal since they may not reset to the identity upon reset().| Modifier and Type | Method and Description |
|---|---|
void |
combine(byte[] data)
Combines a serialized piece of data into this Monoid.
|
void |
consume(com.yahoo.bullet.record.BulletRecord data)
Consumes a single
BulletRecord into this Monoid. |
byte[] |
getData()
Get the data serialized as a byte[].
|
Meta |
getMetadata()
Get the metadata only of the data so far.
|
List<com.yahoo.bullet.record.BulletRecord> |
getRecords()
Get the data so far as a
List of BulletRecord. |
Clip |
getResult()
Get the data so far as a
Clip. |
default void |
merge(Monoidal other)
Combine the data from another instance of the same type of object into this Monoid.
|
void |
reset()
Reset the data so far and make this the identity element for the Monoid with respect to inserting data.
|
void consume(com.yahoo.bullet.record.BulletRecord data)
BulletRecord into this Monoid.data - The BulletRecord to consume.void combine(byte[] data)
data - A serialized representation of the data produced by getData().default void merge(Monoidal other)
getData() method on the object and passes it to
combine(byte[]).other - The non-null other object to combine data from.byte[] getData()
Clip getResult()
Clip.Clip representing the data and the metadata so far.List<com.yahoo.bullet.record.BulletRecord> getRecords()
List of BulletRecord.Meta getMetadata()
reset().Meta collected so far.void reset()
Copyright © 2021. All rights reserved.