Interface TridentCollector
-
- All Known Implementing Classes:
AppendCollector,CaptureCollector,FreshCollector,GroupCollector
public interface TridentCollectorInterface for publishing tuples to a stream and reporting exceptions (to be displayed in Storm UI).Trident components that have the ability to emit tuples to a stream are passed an instance of this interface.
For example, to emit a new tuple to a stream, you would do something like the following:
```java collector.emit(new Values("a", "b", "c")); ```
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidemit(List<Object> values)Emits a tuple to a Stream.voidflush()Flush any buffered tuples (when batching is enabled).voidreportError(Throwable t)Reports an error.
-
-
-
Method Detail
-
emit
void emit(List<Object> values)
Emits a tuple to a Stream.- Parameters:
values- a list of values of which the tuple will be composed
-
flush
void flush()
Flush any buffered tuples (when batching is enabled).
-
reportError
void reportError(Throwable t)
Reports an error. The corresponding stack trace will be visible in the Storm UI.Note that calling this method does not alter the processing of a batch. To explicitly fail a batch and trigger a replay, components should throw
FailedException.- Parameters:
t- The instance of the error (Throwable) being reported.
-
-