public class JsonSerializer extends Object implements ISerializer
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CHARSET |
Constructor and Description |
---|
JsonSerializer() |
Modifier and Type | Method and Description |
---|---|
Number |
connect(Map<String,Object> 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)
ISerializer
initialize
in interface ISerializer
processIn
- output stream to non-JVM componentprocessOut
- input stream from non-JVM componentpublic Number connect(Map<String,Object> conf, TopologyContext context) throws IOException, NoOutputException
ISerializer
connect
in interface ISerializer
conf
- storm configurationcontext
- topology contextIOException
NoOutputException
public void writeBoltMsg(BoltMsg boltMsg) throws IOException
ISerializer
writeBoltMsg
in interface ISerializer
boltMsg
- bolt messageIOException
public void writeSpoutMsg(SpoutMsg msg) throws IOException
ISerializer
writeSpoutMsg
in interface ISerializer
msg
- spout messageIOException
public void writeTaskIds(List<Integer> taskIds) throws IOException
ISerializer
writeTaskIds
in interface ISerializer
taskIds
- list of task IDsIOException
public ShellMsg readShellMsg() throws IOException, NoOutputException
ISerializer
readShellMsg
in interface ISerializer
IOException
NoOutputException
Copyright © 2023 The Apache Software Foundation. All rights reserved.