public abstract class Sketch extends Object
Modifier and Type | Field and Description |
---|---|
protected com.yahoo.bullet.record.BulletRecordProvider |
provider |
Constructor and Description |
---|
Sketch() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
addMetadata(Map<String,String> conceptKeys)
Adds the common metadata for this Sketch to
Map . |
protected abstract String |
getFamily()
Returns a String representing the family of this sketch.
|
Meta |
getMetadata(String metaKey,
Map<String,String> conceptKeys)
Returns the sketch metadata as a
Meta object. |
abstract List<com.yahoo.bullet.record.BulletRecord> |
getRecords()
Collects the data presented to the sketch so far and returns the
List of BulletRecord
representation of the resulting data in the sketch. |
Clip |
getResult(String metaKey,
Map<String,String> conceptKeys)
Gets the result from the data presented to the sketch as a
Clip . |
protected abstract Integer |
getSize()
Returns the size of the Sketch in bytes.
|
protected abstract Boolean |
isEstimationMode()
Returns whether this sketch was in estimation mode or not.
|
abstract void |
reset()
Resets the Sketch to the original state.
|
abstract byte[] |
serialize()
Serializes the sketch.
|
abstract void |
union(byte[] serialized)
Union a sketch serialized using
serialize() into this. |
public abstract byte[] serialize()
public abstract void union(byte[] serialized)
serialize()
into this.serialized
- A sketch serialized using the serialize method.public abstract List<com.yahoo.bullet.record.BulletRecord> getRecords()
List
of BulletRecord
representation of the resulting data in the sketch. See getResult(String, Map)
for getting the
result including the metadata and see getMetadata(String, Map)
for getting only the metadata.public abstract void reset()
serialize()
or getResult(String, Map)
if you want to add more data to the sketch.public Clip getResult(String metaKey, Map<String,String> conceptKeys)
metaKey
- If set to a non-null value, Sketch metadata will be added to the result.conceptKeys
- If provided, these Meta.Concept
names will be added to the metadata.Clip
of the results.public Meta getMetadata(String metaKey, Map<String,String> conceptKeys)
Meta
object.metaKey
- The key to add the metadata as.conceptKeys
- If provided, these Meta.Concept
names will be added to the metadata.protected Map<String,Object> addMetadata(Map<String,String> conceptKeys)
Map
.conceptKeys
- The Map
of Meta.Concept
names to their keys.Map
of sketch metadata.protected abstract String getFamily()
protected abstract Boolean isEstimationMode()
protected abstract Integer getSize()
Copyright © 2021. All rights reserved.