Package org.apache.storm.tuple
Class TupleImpl
- java.lang.Object
-
- org.apache.storm.tuple.TupleImpl
-
- Direct Known Subclasses:
ClojureTuple
public class TupleImpl extends Object implements Tuple
-
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(String field)Returns true if this tuple contains the specified name of the field.booleanequals(Object other)intfieldIndex(String field)Returns the position of the specified field in this tuple.longgetAckVal()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.BooleangetBoolean(int i)Returns the Boolean at position i in the tuple.BooleangetBooleanByField(String field)Gets the Boolean field with a specific name.BytegetByte(int i)Returns the Byte at position i in the tuple.BytegetByteByField(String field)Gets the Byte field with a specific name.GeneralTopologyContextgetContext()Gets the topology context associated with the tuple.DoublegetDouble(int i)Returns the Double at position i in the tuple.DoublegetDoubleByField(String field)Gets the Double field with a specific name.LonggetExecuteSampleStartTime()FieldsgetFields()Gets the names of the fields in this tuple.FloatgetFloat(int i)Returns the Float at position i in the tuple.FloatgetFloatByField(String field)Gets the Float field with a specific name.IntegergetInteger(int i)Returns the Integer at position i in the tuple.IntegergetIntegerByField(String field)Gets the Integer field with a specific name.LonggetLong(int i)Returns the Long at position i in the tuple.LonggetLongByField(String field)Gets the Long field with a specific name.MessageIdgetMessageId()Gets the message id that associated with this tuple.LonggetProcessSampleStartTime()ShortgetShort(int i)Returns the Short at position i in the tuple.ShortgetShortByField(String field)Gets the Short field with a specific name.StringgetSourceComponent()Gets the id of the component that created this tuple.GlobalStreamIdgetSourceGlobalStreamId()Returns the global stream id (component + stream) of this tuple.StringgetSourceStreamId()Gets the id of the stream that this tuple was emitted to.intgetSourceTask()Gets the id of the task that created this tuple.StringgetString(int i)Returns the String at position i in the tuple.StringgetStringByField(String field)Gets the String field with a specific name.ObjectgetValue(int i)Gets the field at position i in the tuple.ObjectgetValueByField(String field)Gets the field with a specific name.List<Object>getValues()Gets all the values in this tuple.inthashCode()List<Object>select(Fields selector)Returns a subset of the tuple based on the fields selector.voidsetExecuteSampleStartTime(long ms)voidsetProcessSampleStartTime(long ms)intsize()Returns the number of fields in this tuple.StringtoString()voidupdateAckVal(long val)
-
-
-
Constructor Detail
-
TupleImpl
public TupleImpl(Tuple t)
-
TupleImpl
public TupleImpl(GeneralTopologyContext context, List<Object> values, String srcComponent, int taskId, String streamId, MessageId id)
-
TupleImpl
public TupleImpl(GeneralTopologyContext context, List<Object> values, String srcComponent, int taskId, String streamId)
-
-
Method Detail
-
getProcessSampleStartTime
public Long getProcessSampleStartTime()
-
setProcessSampleStartTime
public void setProcessSampleStartTime(long ms)
-
getExecuteSampleStartTime
public Long getExecuteSampleStartTime()
-
setExecuteSampleStartTime
public void setExecuteSampleStartTime(long ms)
-
updateAckVal
public void updateAckVal(long val)
-
getAckVal
public long getAckVal()
-
size
public int size()
Description copied from interface:ITupleReturns the number of fields in this tuple.
-
fieldIndex
public int fieldIndex(String field)
Description copied from interface:ITupleReturns the position of the specified field in this tuple.- Specified by:
fieldIndexin interfaceITuple
-
contains
public boolean contains(String field)
Description copied from interface:ITupleReturns true if this tuple contains the specified name of the field.
-
getValue
public Object getValue(int i)
Description copied from interface:ITupleGets the field at position i in the tuple. Returns object since tuples are dynamically typed.
-
getString
public String getString(int i)
Description copied from interface:ITupleReturns the String at position i in the tuple.
-
getInteger
public Integer getInteger(int i)
Description copied from interface:ITupleReturns the Integer at position i in the tuple.- Specified by:
getIntegerin interfaceITuple
-
getLong
public Long getLong(int i)
Description copied from interface:ITupleReturns the Long at position i in the tuple.
-
getBoolean
public Boolean getBoolean(int i)
Description copied from interface:ITupleReturns the Boolean at position i in the tuple.- Specified by:
getBooleanin interfaceITuple
-
getShort
public Short getShort(int i)
Description copied from interface:ITupleReturns the Short at position i in the tuple.
-
getByte
public Byte getByte(int i)
Description copied from interface:ITupleReturns the Byte at position i in the tuple.
-
getDouble
public Double getDouble(int i)
Description copied from interface:ITupleReturns the Double at position i in the tuple.
-
getFloat
public Float getFloat(int i)
Description copied from interface:ITupleReturns the Float at position i in the tuple.
-
getBinary
public byte[] getBinary(int i)
Description copied from interface:ITupleReturns the byte array at position i in the tuple.
-
getValueByField
public Object getValueByField(String field)
Description copied from interface:ITupleGets the field with a specific name. Returns object since tuples are dynamically typed.- Specified by:
getValueByFieldin interfaceITuple
-
getStringByField
public String getStringByField(String field)
Description copied from interface:ITupleGets the String field with a specific name.- Specified by:
getStringByFieldin interfaceITuple
-
getIntegerByField
public Integer getIntegerByField(String field)
Description copied from interface:ITupleGets the Integer field with a specific name.- Specified by:
getIntegerByFieldin interfaceITuple
-
getLongByField
public Long getLongByField(String field)
Description copied from interface:ITupleGets the Long field with a specific name.- Specified by:
getLongByFieldin interfaceITuple
-
getBooleanByField
public Boolean getBooleanByField(String field)
Description copied from interface:ITupleGets the Boolean field with a specific name.- Specified by:
getBooleanByFieldin interfaceITuple
-
getShortByField
public Short getShortByField(String field)
Description copied from interface:ITupleGets the Short field with a specific name.- Specified by:
getShortByFieldin interfaceITuple
-
getByteByField
public Byte getByteByField(String field)
Description copied from interface:ITupleGets the Byte field with a specific name.- Specified by:
getByteByFieldin interfaceITuple
-
getDoubleByField
public Double getDoubleByField(String field)
Description copied from interface:ITupleGets the Double field with a specific name.- Specified by:
getDoubleByFieldin interfaceITuple
-
getFloatByField
public Float getFloatByField(String field)
Description copied from interface:ITupleGets the Float field with a specific name.- Specified by:
getFloatByFieldin interfaceITuple
-
getBinaryByField
public byte[] getBinaryByField(String field)
Description copied from interface:ITupleGets the Byte array field with a specific name.- Specified by:
getBinaryByFieldin interfaceITuple
-
getValues
public List<Object> getValues()
Description copied from interface:ITupleGets all the values in this tuple.
-
getFields
public Fields getFields()
Description copied from interface:ITupleGets the names of the fields in this tuple.
-
select
public List<Object> select(Fields selector)
Description copied from interface:ITupleReturns a subset of the tuple based on the fields selector.
-
getSourceGlobalStreamId
public GlobalStreamId getSourceGlobalStreamId()
Description copied from interface:TupleReturns the global stream id (component + stream) of this tuple.- Specified by:
getSourceGlobalStreamIdin interfaceTuple
-
getSourceComponent
public String getSourceComponent()
Description copied from interface:TupleGets the id of the component that created this tuple.- Specified by:
getSourceComponentin interfaceTuple
-
getSourceTask
public int getSourceTask()
Description copied from interface:TupleGets the id of the task that created this tuple.- Specified by:
getSourceTaskin interfaceTuple
-
getSourceStreamId
public String getSourceStreamId()
Description copied from interface:TupleGets the id of the stream that this tuple was emitted to.- Specified by:
getSourceStreamIdin interfaceTuple
-
getMessageId
public MessageId getMessageId()
Description copied from interface:TupleGets the message id that associated with this tuple.- Specified by:
getMessageIdin interfaceTuple
-
getContext
public GeneralTopologyContext getContext()
Description copied from interface:TupleGets the topology context associated with the tuple.- Specified by:
getContextin interfaceTuple
-
-