public class JsonSerializer extends Object implements ISerializer
JsonSerializer implements the JSON multilang protocol.
| Modifier and Type | Field and Description | 
|---|---|
| static String | DEFAULT_CHARSET | 
| Constructor and Description | 
|---|
| JsonSerializer() | 
| Modifier and Type | Method and Description | 
|---|---|
| Number | connect(Map conf,
       TopologyContext context)This method transmits the Storm config to the non-JVM process and receives its pid. | 
| void | initialize(OutputStream processIn,
          InputStream processOut)This method sets the input and output streams of the serializer | 
| ShellMsg | readShellMsg()This method receives a shell message from the non-JVM process | 
| void | writeBoltMsg(BoltMsg boltMsg)This method sends a bolt message to a non-JVM bolt process | 
| void | writeSpoutMsg(SpoutMsg msg)This method sends a spout message to a non-JVM spout process | 
| void | writeTaskIds(List<Integer> taskIds)This method sends a list of task IDs to a non-JVM bolt process | 
public static final String DEFAULT_CHARSET
public void initialize(OutputStream processIn, InputStream processOut)
ISerializerThis method sets the input and output streams of the serializer
initialize in interface ISerializerprocessIn - output stream to non-JVM componentprocessOut - input stream from non-JVM componentpublic Number connect(Map conf, TopologyContext context) throws IOException, NoOutputException
ISerializerThis method transmits the Storm config to the non-JVM process and receives its pid.
connect in interface ISerializerconf - storm configurationcontext - topology contextIOExceptionNoOutputExceptionpublic void writeBoltMsg(BoltMsg boltMsg) throws IOException
ISerializerThis method sends a bolt message to a non-JVM bolt process
writeBoltMsg in interface ISerializerboltMsg - bolt messageIOExceptionpublic void writeSpoutMsg(SpoutMsg msg) throws IOException
ISerializerThis method sends a spout message to a non-JVM spout process
writeSpoutMsg in interface ISerializermsg - spout messageIOExceptionpublic void writeTaskIds(List<Integer> taskIds) throws IOException
ISerializerThis method sends a list of task IDs to a non-JVM bolt process
writeTaskIds in interface ISerializertaskIds - list of task IDsIOExceptionpublic ShellMsg readShellMsg() throws IOException, NoOutputException
ISerializerThis method receives a shell message from the non-JVM process
readShellMsg in interface ISerializerIOExceptionNoOutputExceptionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.