uCosminexus Stream Data Platform - Application Framework Application Development Guide

[Contents][Index][Back][Next]

get(int count, long timeout) method

Format

ArrayList<StreamTuple> get(int count, long timeout)

Explanation

Acquires the number of tuples specified by the count parameter from the SDP server.

If there is no result data in the SDP server, this method waits until result data arrives or until the time specified in the timeout parameter elapses. If result data arrives while the method is waiting, an ArrayList type object containing the new data is returned. If the time specified in the timeout parameter elapses or if an interrupt occurs in the waiting thread, one of the following objects is returned:

If a stop notification has been issued to the query group when this method is called (a data transmission termination notification has been sent by a method, or a query group stop notification has been sent by a command), one of the following processes takes place:

This method is a polling method.

Parameters

count

Specifies the number of data items to be acquired from the SDP server. You can specify between 1 and 1,048,576 data items.

The actual number of data items that will be acquired varies as shown below, depending on the value specified in this parameter and the state of the output stream queue.

Condition Number that can be acquired
Value specified in count is less than or equal to the number of data items in the output stream queue. Value specified in the count parameter
Value specified in count is greater than the number of data items in the output stream queue. Number of data items in the output stream queue
Value specified in count is greater than the maximum size of the output stream queue.

timeout

Specifies the maximum amount of time (in milliseconds) to wait when there is no data.

Depending on the specified value, one of the following processes takes place:

Specified value Process that is executed
Negative number No waiting
0 Waits until result data arrives or until the stream ends.
Positive number Waits until result data arrives or until the specified time elapses.

Exceptions

The following table shows the exceptions and the conditions for their generation.

Exception Generation condition
SDPClientCommunicationException A communication exception occurred during RMI connection.
SDPClientEndOfStreamException Processing of the transmitted data is finished.
SDPClientException
  • The output stream is already closed.
  • A listener object for callback is already registered.
  • A parameter is invalid.
SDPClientQueryGroupHoldException The query group is held. (Detailed exception of SDPClientQueryGroupStateException)
SDPClientQueryGroupNotExistException The query group was deleted.
SDPClientQueryGroupStateException The query group is not being executed.
SDPClientQueryGroupStopException There is no result data or the query group is stopped. (Detailed exception of SDPClientQueryGroupStateException)

Return value

A tuple list (ArrayList<StreamTuple> type object)