public class TupleImpl extends Object implements Tuple
Constructor and Description |
---|
TupleImpl(GeneralTopologyContext context,
List<Object> values,
String srcComponent,
int taskId,
String streamId) |
TupleImpl(GeneralTopologyContext context,
List<Object> values,
String srcComponent,
int taskId,
String streamId,
MessageId id) |
TupleImpl(Tuple t) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String field)
Returns true if this tuple contains the specified name of the field.
|
boolean |
equals(Object other) |
int |
fieldIndex(String field)
Returns the position of the specified field in this tuple.
|
long |
getAckVal() |
byte[] |
getBinary(int i)
Returns the byte array at position i in the tuple.
|
byte[] |
getBinaryByField(String field)
Gets the Byte array field with a specific name.
|
Boolean |
getBoolean(int i)
Returns the Boolean at position i in the tuple.
|
Boolean |
getBooleanByField(String field)
Gets the Boolean field with a specific name.
|
Byte |
getByte(int i)
Returns the Byte at position i in the tuple.
|
Byte |
getByteByField(String field)
Gets the Byte field with a specific name.
|
GeneralTopologyContext |
getContext()
Gets the topology context associated with the tuple
|
Double |
getDouble(int i)
Returns the Double at position i in the tuple.
|
Double |
getDoubleByField(String field)
Gets the Double field with a specific name.
|
Long |
getExecuteSampleStartTime() |
Fields |
getFields()
Gets the names of the fields in this tuple.
|
Float |
getFloat(int i)
Returns the Float at position i in the tuple.
|
Float |
getFloatByField(String field)
Gets the Float field with a specific name.
|
Integer |
getInteger(int i)
Returns the Integer at position i in the tuple.
|
Integer |
getIntegerByField(String field)
Gets the Integer field with a specific name.
|
Long |
getLong(int i)
Returns the Long at position i in the tuple.
|
Long |
getLongByField(String field)
Gets the Long field with a specific name.
|
MessageId |
getMessageId()
Gets the message id that associated with this tuple.
|
Long |
getProcessSampleStartTime() |
Short |
getShort(int i)
Returns the Short at position i in the tuple.
|
Short |
getShortByField(String field)
Gets the Short field with a specific name.
|
String |
getSourceComponent()
Gets the id of the component that created this tuple.
|
GlobalStreamId |
getSourceGlobalStreamId()
Returns the global stream id (component + stream) of this tuple.
|
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.
|
String |
getString(int i)
Returns the String at position i in the tuple.
|
String |
getStringByField(String field)
Gets the String field with a specific name.
|
Object |
getValue(int i)
Gets the field at position i in the tuple.
|
Object |
getValueByField(String field)
Gets the field with a specific name.
|
List<Object> |
getValues()
Gets all the values in this tuple.
|
int |
hashCode() |
List<Object> |
select(Fields selector)
Returns a subset of the tuple based on the fields selector.
|
void |
setExecuteSampleStartTime(long ms) |
void |
setProcessSampleStartTime(long ms) |
int |
size()
Tuple APIs
|
String |
toString() |
void |
updateAckVal(long val) |
public TupleImpl(Tuple t)
public TupleImpl(GeneralTopologyContext context, List<Object> values, String srcComponent, int taskId, String streamId, MessageId id)
public TupleImpl(GeneralTopologyContext context, List<Object> values, String srcComponent, int taskId, String streamId)
public Long getProcessSampleStartTime()
public void setProcessSampleStartTime(long ms)
public Long getExecuteSampleStartTime()
public void setExecuteSampleStartTime(long ms)
public void updateAckVal(long val)
public long getAckVal()
public int fieldIndex(String field)
ITuple
Returns the position of the specified field in this tuple.
fieldIndex
in interface ITuple
public boolean contains(String field)
ITuple
Returns true if this tuple contains the specified name of the field.
public Object getValue(int i)
ITuple
Gets the field at position i in the tuple. Returns object since tuples are dynamically typed.
public String getString(int i)
ITuple
Returns the String at position i in the tuple.
public Integer getInteger(int i)
ITuple
Returns the Integer at position i in the tuple.
getInteger
in interface ITuple
public Long getLong(int i)
ITuple
Returns the Long at position i in the tuple.
public Boolean getBoolean(int i)
ITuple
Returns the Boolean at position i in the tuple.
getBoolean
in interface ITuple
public Short getShort(int i)
ITuple
Returns the Short at position i in the tuple.
public Byte getByte(int i)
ITuple
Returns the Byte at position i in the tuple.
public Double getDouble(int i)
ITuple
Returns the Double at position i in the tuple.
public Float getFloat(int i)
ITuple
Returns the Float at position i in the tuple.
public byte[] getBinary(int i)
ITuple
Returns the byte array at position i in the tuple.
public Object getValueByField(String field)
ITuple
Gets the field with a specific name. Returns object since tuples are dynamically typed.
getValueByField
in interface ITuple
public String getStringByField(String field)
ITuple
Gets the String field with a specific name.
getStringByField
in interface ITuple
public Integer getIntegerByField(String field)
ITuple
Gets the Integer field with a specific name.
getIntegerByField
in interface ITuple
public Long getLongByField(String field)
ITuple
Gets the Long field with a specific name.
getLongByField
in interface ITuple
public Boolean getBooleanByField(String field)
ITuple
Gets the Boolean field with a specific name.
getBooleanByField
in interface ITuple
public Short getShortByField(String field)
ITuple
Gets the Short field with a specific name.
getShortByField
in interface ITuple
public Byte getByteByField(String field)
ITuple
Gets the Byte field with a specific name.
getByteByField
in interface ITuple
public Double getDoubleByField(String field)
ITuple
Gets the Double field with a specific name.
getDoubleByField
in interface ITuple
public Float getFloatByField(String field)
ITuple
Gets the Float field with a specific name.
getFloatByField
in interface ITuple
public byte[] getBinaryByField(String field)
ITuple
Gets the Byte array field with a specific name.
getBinaryByField
in interface ITuple
public List<Object> getValues()
ITuple
Gets all the values in this tuple.
public Fields getFields()
ITuple
Gets the names of the fields in this tuple.
public List<Object> select(Fields selector)
ITuple
Returns a subset of the tuple based on the fields selector.
public GlobalStreamId getSourceGlobalStreamId()
Tuple
Returns the global stream id (component + stream) of this tuple.
getSourceGlobalStreamId
in interface Tuple
public String getSourceComponent()
Tuple
Gets the id of the component that created this tuple.
getSourceComponent
in interface Tuple
public int getSourceTask()
Tuple
Gets the id of the task that created this tuple.
getSourceTask
in interface Tuple
public String getSourceStreamId()
Tuple
Gets the id of the stream that this tuple was emitted to.
getSourceStreamId
in interface Tuple
public MessageId getMessageId()
Tuple
Gets the message id that associated with this tuple.
getMessageId
in interface Tuple
public GeneralTopologyContext getContext()
Tuple
Gets the topology context associated with the tuple
getContext
in interface Tuple
Copyright © 2019 The Apache Software Foundation. All rights reserved.