8 Network I/O

Oracle Stream Analytics supports network I/O over TCP/IP with a variety of providers in server and client mode. You can define a network I/O service for SSL and non-SSL network access in the server config.xml file.

Oracle Stream Analytics servers are certified for use with IPv4 only or the IPv4/IPv6 dual-stack. For information about IPv6, see RFC 2460: Internet Protocol, Version 6 (IPv6) Specification at http://www.ietf.org/rfc/rfc2460.txt.

The jetty and weblogic-rmi-client server services depend on network I/O configuration. The jetty service depends on network I/O server (netio) configuration, and the weblogic-rmi-client service depends on network I/O client (netio-client) configuration.

This chapter includes the following sections:

8.1 Network I/O Providers

Oracle Stream Analytics supports several network I/O providers.

Table 8-1 Oracle Stream Analytics Network I/O Providers

provider-type SSL? Description

non-blocking

No

Provides fully non-blocking I/O for reads and writes. Each call to read or write on the Connection interface returns immediately without blocking. If the underlying connection is not ready, then the read or write call returns zero. At that point, the calling code must use one of the notification mechanisms in the NetIO API to wait until the connection is ready to read or write. Non-Blocking providers can also support a non-blocking connect call where a thread need not block if it takes a long time to establish (or if it fails to establish) a connection to a remote server.

semi-blocking

No

Provides non-blocking I/O for the read call, but each write call blocks until the data is handed to the TCP/IP stack. Some platforms enable you to implement a write-blocking provider that is faster than a fully non-blocking provider, but still allows for high scalability.

blocking

No

Blocks on each read and write call until it completes. If there is no data to read, then read blocks until there is. This provider is much less scalable because there must a thread must wait for each network connection that might have data. Oracle recommends that you not use this type of provider.

native

No

Oracle Stream Analytics tries the NativeAsyncEngine, and if it is not supported, then raises an error.

NIO

Yes

The NIOEngine is always used. This is the default provider type.

The following example shows how to specify a provider in the config.xml file netio element using the provider-type child element.

<netio>
     <name>myNetio</name>
     <port>12345</port>
     <provider-type>non-blocking</provider-type>
</netio>

8.2 Configure Network I/O Server (netio)

You can define a network I/O service to be used by other services to act as the server and listen for incoming connections. You can also create a client network I/O service as Configure Network I/O Client (netio-client) describes.

You configure network I/O server services with the netio element in the Oracle Stream Analytics server config.xml file. For more information, see:

Configure Network I/O Server

  1. In the Oracle Stream Analytics server config.xml file, create a netio element:
    <netio>
    </netio>
    
  2. Add a name element that uniquely identifies this netio element on this Oracle Stream Analytics server:
    <netio>
         <name>MyNetIO</name>
    </netio>
    
  3. Add a port element to define the TCP/IP port on which this netio service listens for connection requests:
    <netio>
         <name>MyNetIO</name>
         <port>9002</port>
    </netio>
    
  4. Optionally, specify a provider-type:
    <netio>
         <name>MyNetIO</name>
         <port>9002</port>
         <provider-type>NIO</provider-type>
    </netio>
    
  5. Optionally, specify the other netio child elements.

    See netio in Schema Reference for Oracle Stream Analytics.

8.3 Configure Network I/O Client (netio-client)

You can define a network I/O service to use to perform non-blocking network I/O, but that does not act as a server and does not listen for incoming connections. You can also create a server network I/O service as Configure Network I/O Server (netio) describes.

You configure network I/O client services with the netio-client element in the Oracle Stream Analytics server config.xml file.

For more information, see:

To configure network I/O client:

  1. In the Oracle Stream Analytics server config.xml file, create a netio-client element:
    <netio-client>
    </netio-client>
    
  2. Add a name element that uniquely identifies this netio element on this Oracle Stream Analytics server:
    <netio-client>
         <name>MyNetIOClient</name>
    </netio-client>
    
  3. Optionally, specify a provider-type:
    <netio-client>
         <name>MyNetIOClient</name>
         <provider-type>NIO</provider-type>
    </netio-client>
    
  4. Optionally, specify the other netio-client child elements.

    See netio in Schema Reference for Oracle Stream Analytics.