Package org.apache.pinot.spi.stream
Interface StreamMessageDecoder<T>
-
-
Field Summary
Fields Modifier and Type Field Description static StringRECORD_EXTRACTOR_CONFIG_CONFIG_KEYstatic StringRECORD_EXTRACTOR_CONFIG_KEY
-
Method Summary
Modifier and Type Method Description GenericRowdecode(T payload, int offset, int length, GenericRow destination)Decodes a row.GenericRowdecode(T payload, GenericRow destination)Decodes a row.voidinit(Map<String,String> props, Set<String> fieldsToRead, String topicName)Initializes the decoder.
-
-
-
Field Detail
-
RECORD_EXTRACTOR_CONFIG_KEY
static final String RECORD_EXTRACTOR_CONFIG_KEY
- See Also:
- Constant Field Values
-
RECORD_EXTRACTOR_CONFIG_CONFIG_KEY
static final String RECORD_EXTRACTOR_CONFIG_CONFIG_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
void init(Map<String,String> props, Set<String> fieldsToRead, String topicName) throws Exception
Initializes the decoder.- Parameters:
props- Decoder properties extracted from theStreamConfigfieldsToRead- The fields to read from the source stream. If blank, reads all fields (only for AVRO/JSON currently)topicName- Topic name of the stream- Throws:
Exception- If an error occurs
-
decode
@Nullable GenericRow decode(T payload, GenericRow destination)
Decodes a row.- Parameters:
payload- The buffer from which to read the row.- Returns:
- A new row decoded from the buffer. If the returned value is
nullthe row is dropped from the segment.
-
decode
@Nullable GenericRow decode(T payload, int offset, int length, GenericRow destination)
Decodes a row.- Parameters:
payload- The buffer from which to read the row.offset- The offset into the array from which the row contents startslength- The length of the row contents in bytesdestination- TheGenericRowto write the decoded row into- Returns:
- A new row decoded from the buffer If the returned value is
nullthe row is dropped from the segment.
-
-