T - Type of the stream body.public final class FormatStreamEventDecoder<T> extends Object implements co.cask.cdap.api.stream.StreamEventDecoder<LongWritable,co.cask.cdap.api.stream.GenericStreamEventData<T>>
StreamEventDecoder that decodes StreamEvent into LongWritable as key
and GenericStreamEventData as value for Mapper input. The key carries the event timestamp, while
the value is a GenericStreamEventData, which contains the event headers and the event body
formatted by some RecordFormat.| Constructor and Description |
|---|
FormatStreamEventDecoder(co.cask.cdap.api.data.format.RecordFormat<co.cask.cdap.api.flow.flowlet.StreamEvent,T> bodyFormat)
Create a decoder for stream events that decodes the body of the stream using the given initialized format.
|
| Modifier and Type | Method and Description |
|---|---|
co.cask.cdap.api.stream.StreamEventDecoder.DecodeResult<LongWritable,co.cask.cdap.api.stream.GenericStreamEventData<T>> |
decode(co.cask.cdap.api.flow.flowlet.StreamEvent event,
co.cask.cdap.api.stream.StreamEventDecoder.DecodeResult<LongWritable,co.cask.cdap.api.stream.GenericStreamEventData<T>> result) |
public FormatStreamEventDecoder(co.cask.cdap.api.data.format.RecordFormat<co.cask.cdap.api.flow.flowlet.StreamEvent,T> bodyFormat)
bodyFormat - Initialized format.public co.cask.cdap.api.stream.StreamEventDecoder.DecodeResult<LongWritable,co.cask.cdap.api.stream.GenericStreamEventData<T>> decode(co.cask.cdap.api.flow.flowlet.StreamEvent event, co.cask.cdap.api.stream.StreamEventDecoder.DecodeResult<LongWritable,co.cask.cdap.api.stream.GenericStreamEventData<T>> result)
decode in interface co.cask.cdap.api.stream.StreamEventDecoder<LongWritable,co.cask.cdap.api.stream.GenericStreamEventData<T>>Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.