Class Tuple

    • Field Detail

      • EOF

        public boolean EOF
        When EOF field is true the Tuple marks the end of the stream. The EOF Tuple will not contain a record from the stream, but it may contain metrics/aggregates gathered by underlying streams.

        public boolean EXCEPTION
        When EXCEPTION field is true the Tuple marks an exception in the stream and the corresponding "EXCEPTION" field contains a related message.
    • Constructor Detail

      • Tuple

        public Tuple()
      • Tuple

        public Tuple​(Map<?,​?> fields)
        A copy constructor.
        fields - map containing keys and values to be copied to this tuple
      • Tuple

        public Tuple​(Object... fields)
        Constructor that accepts an even number of arguments as key / value pairs.
        fields - a list of key / value pairs, with keys at odd and values at even positions.
    • Method Detail

      • remove

        public void remove​(Object key)
      • getException

        public String getException()
      • getFields

        public Map<Object,​Object> getFields()
        Return all tuple fields and their values.
      • getFieldLabels

        public Map<String,​String> getFieldLabels()
        This represents the mapping of external field labels to the tuple's internal field names if they are different from field names.
        field labels or null
      • setFieldLabels

        public void setFieldLabels​(Map<String,​String> fieldLabels)
      • getFieldNames

        public List<String> getFieldNames()
        A list of field names to serialize. This list (together with the mapping in getFieldLabels() determines what tuple values are serialized and their external (serialized) names.
        list of external field names or null
      • setFieldNames

        public void setFieldNames​(List<String> fieldNames)
      • setMetrics

        public void setMetrics​(Map<String,​Map> metrics)
      • merge

        public void merge​(Tuple other)
      • EOF

        public static Tuple EOF()
        Create a new empty tuple marked as EOF.

        public static Tuple EXCEPTION​(String msg,
                                      boolean eof)
        Create a new empty tuple marked as EXCEPTION, and optionally EOF.
        msg - exception message
        eof - if true the tuple will be marked as EOF