This section explains other details about creating custom adaptors.
Use the following policies when creating a custom adaptor's data transmission application and data reception application:
- Do not connect to the same stream more than once.
Connect to each stream only once.
Although a single SDPConnector type object cannot connect to the same stream more than once, multiple SDPConnector type objects can be used to connect to the same stream multiple times. However, making multiple connections lowers the throughput of the stream data processing engine.
- If the output frequency of query result data to the output stream is high compared to the processing load of the data reception application, use either of the following methods to reduce the communication overhead of the data reception application:
- If you are using the polling method to receive multiple query results, use the getAll method to receive all of them in a single batch. This can reduce the communication overhead for data transfer.
- Create the data reception application as an in-process connection custom adaptor so that it runs in the same process as the SDP server. This can reduce communication overhead between processes.
By reducing the communication overhead, you can prevent tuples from being stranded in the output stream queue, thereby preventing a queue overflow.
- If the output frequency for query results is low, we recommend that you create the data reception application as an in-process connection custom adaptor that runs in the same process as the SDP server, and that you use the callback receive method for receiving data. This can reduce CPU usage.
- When creating an RMI connection custom adaptor, declare the main method as follows:
public static void main(String[]) |
The command (sdpstartap) you executed to start the RMI connection custom adaptor executes the main class, main method.
- When creating an RMI connection custom adaptor, do not use 1 as the application termination code.