Class SimpleMessageParser
java.lang.Object
org.apache.drill.exec.store.easy.json.parser.SimpleMessageParser
- All Implemented Interfaces:
MessageParser
A message parser which accepts a path to the data encoded as a
slash-separated string. Given the following JSON message:
{ status: {
succeeded: true,
runTimeMs: 123,
}
response: {
rowCount: 10,
rows: [
{ ... },
{ ... } ]
},
footer: "something interesting"
}
The path to the actual data would be "response/rows"
.
The message parser will "free-wheel" over all objects not on the
data path. Thus, this class will skip over the nested structure
within the status
member.
If the data path is not found then this class reports EOF of the whole data stream. It may have skipped over the actual payload if the path is mis-configured.
The payload can also be a single JSON object:
response: {
field1: "value1",
field2: "value2",
...
},
This parser "ungets" the value token (start object or start array) so that the structure parser can determine which case to handle.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.drill.exec.store.easy.json.parser.MessageParser
MessageParser.MessageContextException
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
parsePrefix
(TokenIterator tokenizer) void
parseSuffix
(TokenIterator tokenizer)
-
Constructor Details
-
SimpleMessageParser
-
-
Method Details
-
parsePrefix
- Specified by:
parsePrefix
in interfaceMessageParser
- Throws:
MessageParser.MessageContextException
-
parseSuffix
- Specified by:
parseSuffix
in interfaceMessageParser
-