public class Basic extends Scheme
Monoidal
calls
to the Strategy
. This window is only ever closed when the underlying Strategy
is also
Strategy.isClosed()
.Modifier and Type | Field and Description |
---|---|
static String |
NAME |
protected long |
windowCount |
aggregation, metadataKeys, window
Constructor and Description |
---|
Basic(Strategy aggregation,
Window window,
BulletConfig config)
Creates an instance of this windowing scheme with the provided
Strategy and BulletConfig . |
Modifier and Type | Method and Description |
---|---|
void |
combine(byte[] data)
This combines any data fed to it even if it is
isClosed() or isClosedForPartition() . |
void |
consume(com.yahoo.bullet.record.BulletRecord data)
This consumes any data fed to it even if it is
isClosed() or isClosedForPartition() . |
protected long |
count()
Counts the number of windows that have been opened since creation.
|
byte[] |
getData()
Get the data serialized as a byte[].
|
protected Map<String,Object> |
getMetadata(Map<String,String> metadataKeys)
Return any metadata for the windowing scheme with the given configured names for the metadata concepts.
|
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 . |
boolean |
isClosed()
Returns true if this is currently closed.
|
boolean |
isClosedForPartition()
Returns true if this window is closed when operating in partition mode.
|
protected String |
name()
Gets the name of this windowing scheme.
|
void |
reset()
Reset the data so far and make this the identity element for the Monoid with respect to inserting data.
|
void |
resetForPartition()
Resets the window when operating in partition mode.
|
void |
start()
Readies the window for querying.
|
getMetadata
public static final String NAME
protected long windowCount
public Basic(Strategy aggregation, Window window, BulletConfig config)
Strategy
and BulletConfig
.aggregation
- The non-null initialized aggregation strategy that this window will operate.window
- The initialized, configured window to use.config
- The validated config to use.protected Map<String,Object> getMetadata(Map<String,String> metadataKeys)
Scheme
getMetadata
in class Scheme
metadataKeys
- The mapping of metadata concepts to their names to get metadata for.Map
of strings to objects of the metadata.public void consume(com.yahoo.bullet.record.BulletRecord data)
isClosed()
or isClosedForPartition()
.data
- The BulletRecord
to consume.public void combine(byte[] data)
isClosed()
or isClosedForPartition()
.data
- The BulletRecord
to consume.public byte[] getData()
Monoidal
public Clip getResult()
Monoidal
Clip
.Clip
representing the data and the metadata so far.public List<com.yahoo.bullet.record.BulletRecord> getRecords()
Monoidal
List
of BulletRecord
.public void reset()
Monoidal
public void resetForPartition()
Scheme
resetForPartition
in class Scheme
public boolean isClosed()
Closable
public boolean isClosedForPartition()
Scheme
isClosedForPartition
in class Scheme
public void start()
Scheme
Querier.restart()
.protected String name()
protected long count()
Copyright © 2021. All rights reserved.