|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.rapportive.storm.scheme.SimpleJSONScheme
public class SimpleJSONScheme
Deserialisation scheme for JSON values using the json-simple library. Emits one-element tuples with the field name object, containing the parsed JSON value. N.B. if passed invalid JSON it will throw an IllegalArgumentException.
| Constructor Summary | |
|---|---|
SimpleJSONScheme()
Create a new JSON deserialisation scheme using UTF-8 as the character encoding. |
|
SimpleJSONScheme(String encoding)
Create a new JSON deserialisation scheme using the given character encoding. |
|
| Method Summary | |
|---|---|
List<Object> |
deserialize(byte[] bytes)
Deserialise a JSON value from bytes using the requested character encoding. |
backtype.storm.tuple.Fields |
getOutputFields()
Emits tuples containing only one field, named "object". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleJSONScheme(String encoding)
encoding - character encoding used to deserialise JSON from raw
bytespublic SimpleJSONScheme()
| Method Detail |
|---|
public List<Object> deserialize(byte[] bytes)
deserialize in interface backtype.storm.spout.SchemeIllegalArgumentException - if bytes does not contain
valid JSON encoded using the requested encoding.
IllegalStateException - if the requested character encoding is
not supported.public backtype.storm.tuple.Fields getOutputFields()
getOutputFields in interface backtype.storm.spout.Scheme
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||