public class TupleImpl extends java.lang.Object implements Tuple
Heron needs to know how to serialize all the values in a tuple. By default, Heron knows how to serialize the primitive types, strings, and byte arrays. If you want to use another type, you'll need to implement and register a serializer for that type.
Constructor and Description |
---|
TupleImpl(TopologyContext context,
TopologyAPI.StreamId stream,
long tupleKey,
java.util.List<HeronTuples.RootId> roots,
java.util.List<java.lang.Object> values) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(java.lang.String field)
Returns true if this tuple contains the specified name of the field.
|
boolean |
equals(java.lang.Object other) |
int |
fieldIndex(java.lang.String field)
Returns the position of the specified field in this tuple.
|
byte[] |
getBinary(int i)
Returns the byte array at position i in the tuple.
|
byte[] |
getBinaryByField(java.lang.String field) |
java.lang.Boolean |
getBoolean(int i)
Returns the Boolean at position i in the tuple.
|
java.lang.Boolean |
getBooleanByField(java.lang.String field) |
java.lang.Byte |
getByte(int i)
Returns the Byte at position i in the tuple.
|
java.lang.Byte |
getByteByField(java.lang.String field) |
long |
getCreationTime() |
java.lang.Double |
getDouble(int i)
Returns the Double at position i in the tuple.
|
java.lang.Double |
getDoubleByField(java.lang.String field) |
Fields |
getFields()
Gets the names of the fields in this tuple.
|
java.lang.Float |
getFloat(int i)
Returns the Float at position i in the tuple.
|
java.lang.Float |
getFloatByField(java.lang.String field) |
java.lang.Integer |
getInteger(int i)
Returns the Integer at position i in the tuple.
|
java.lang.Integer |
getIntegerByField(java.lang.String field) |
java.lang.Long |
getLong(int i)
Returns the Long at position i in the tuple.
|
java.lang.Long |
getLongByField(java.lang.String field) |
java.util.List<HeronTuples.RootId> |
getRoots() |
java.lang.Short |
getShort(int i)
Returns the Short at position i in the tuple.
|
java.lang.Short |
getShortByField(java.lang.String field) |
java.lang.String |
getSourceComponent()
Gets the id of the component that created this tuple.
|
java.lang.String |
getSourceStreamId()
Gets the id of the stream that this tuple was emitted to.
|
int |
getSourceTask()
Gets the id of the task that created this tuple.
|
java.lang.String |
getString(int i)
Returns the String at position i in the tuple.
|
java.lang.String |
getStringByField(java.lang.String field) |
long |
getTupleKey() |
java.lang.Object |
getValue(int i)
Gets the field at position i in the tuple.
|
java.lang.Object |
getValueByField(java.lang.String field) |
java.util.List<java.lang.Object> |
getValues()
Gets all the values in this tuple.
|
int |
hashCode() |
void |
resetValues()
Resets the tuple values to null
TODO:- Is this needed
|
java.util.List<java.lang.Object> |
select(Fields selector)
Returns a subset of the tuple based on the fields selector.
|
int |
size()
Returns the number of fields in this tuple.
|
java.lang.String |
toString() |
public TupleImpl(TopologyContext context, TopologyAPI.StreamId stream, long tupleKey, java.util.List<HeronTuples.RootId> roots, java.util.List<java.lang.Object> values)
public java.util.List<HeronTuples.RootId> getRoots()
public long getTupleKey()
public int size()
Tuple
public int fieldIndex(java.lang.String field)
Tuple
fieldIndex
in interface Tuple
public boolean contains(java.lang.String field)
Tuple
public java.lang.Object getValue(int i)
Tuple
public java.lang.String getString(int i)
Tuple
public java.lang.Integer getInteger(int i)
Tuple
getInteger
in interface Tuple
public java.lang.Long getLong(int i)
Tuple
public java.lang.Boolean getBoolean(int i)
Tuple
getBoolean
in interface Tuple
public java.lang.Short getShort(int i)
Tuple
public java.lang.Byte getByte(int i)
Tuple
public java.lang.Double getDouble(int i)
Tuple
public java.lang.Float getFloat(int i)
Tuple
public byte[] getBinary(int i)
Tuple
public java.lang.Object getValueByField(java.lang.String field)
getValueByField
in interface Tuple
public java.lang.String getStringByField(java.lang.String field)
getStringByField
in interface Tuple
public java.lang.Integer getIntegerByField(java.lang.String field)
getIntegerByField
in interface Tuple
public java.lang.Long getLongByField(java.lang.String field)
getLongByField
in interface Tuple
public java.lang.Boolean getBooleanByField(java.lang.String field)
getBooleanByField
in interface Tuple
public java.lang.Short getShortByField(java.lang.String field)
getShortByField
in interface Tuple
public java.lang.Byte getByteByField(java.lang.String field)
getByteByField
in interface Tuple
public java.lang.Double getDoubleByField(java.lang.String field)
getDoubleByField
in interface Tuple
public java.lang.Float getFloatByField(java.lang.String field)
getFloatByField
in interface Tuple
public byte[] getBinaryByField(java.lang.String field)
getBinaryByField
in interface Tuple
public java.util.List<java.lang.Object> getValues()
Tuple
public Fields getFields()
Tuple
public java.util.List<java.lang.Object> select(Fields selector)
Tuple
public java.lang.String getSourceComponent()
Tuple
getSourceComponent
in interface Tuple
public int getSourceTask()
Tuple
getSourceTask
in interface Tuple
public java.lang.String getSourceStreamId()
Tuple
getSourceStreamId
in interface Tuple
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void resetValues()
Tuple
resetValues
in interface Tuple
public long getCreationTime()