![]() |
Qorus Integration Engine® Enterprise Edition 7.1.0_prod
|
A class for inbound/reading data from the remote instance, I/O is handled in a background thread and is made available in the getData() and getAllData() methods. More...
Public Member Methods | |
| constructor (DbRemoteBase remote, string stream, string table_name, *hash< auto > options) | |
| constructor taking an OMQ::DbRemoteBase object for the remote connection | |
| constructor (DbRemoteBase remote, string table_name, *hash< auto > options) | |
constructor taking an OMQ::DbRemoteBase object for the remote connection and assuming the "select" stream | |
| constructor (string remote, string datasource, string stream, string table_name, *hash< auto > options) | |
| constructor taking a string giving the name of the remote connection for the remote server | |
| constructor (string remote, string datasource, string table_name, *hash< auto > options) | |
constructor taking a string giving the name of the remote connection for the remote server and assuming the "select" stream | |
| constructor (QorusSystemRestHelper remote, string datasource, string stream, string table_name, *hash< auto > options) | |
| constructor taking an OMQ::QorusSystemRestHelper object for the remote connection | |
| constructor (QorusSystemRestHelper remote, string datasource, string table_name, *hash< auto > options) | |
constructor taking an OMQ::QorusSystemRestHelper object for the remote connection and assuming the "select" stream | |
| openStream (string stream, string table_name, *hash< auto > options) | |
| flushes the current stream and reopens a new stream with the same remote connection and in the same datasource | |
| commit () | |
| Commit remote transaction. | |
| rollback (bool action=DO_DISCONNECT) | |
| Rollback remote transaction. | |
| disconnect () | |
| Disconnects the connection. | |
| *hash< auto > | getData (*timeout timeout_ms) |
| returns queued data as soon as it is available, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue; once this method return NOTHING it signifies that the end of stream data condition has been reached; do not call this method again after it returns NOTHING | |
| *hash< auto > | getAllData (*timeout timeout_ms) |
| returns all data recevied by the object in a single call, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue | |
| *list< auto > | getDataRows (*timeout timeout_ms) |
| returns queued data as a list<auto> of rows as soon as it is available, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue; once this method return NOTHING it signifies that the end of stream data condition has been reached; do not call this method again after it returns NOTHING | |
| *list< auto > | getAllDataRows (*timeout timeout_ms) |
| returns all data recevied by the object in a single call as a list<auto> of rows, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue | |
| OMQ::StreamConfig | config () |
| returns the configuration object | |
Public Member Methods inherited from OMQ::AbstractParallelReceiveStream | |
| destructor () | |
| disconnects and aborts the I/O thread if it's still running | |
| nothing | cleanup () |
| called when the thread resource is still allocated and the thread exits or one of Qore::throw_thread_resource_exceptions() or Qore::throw_thread_resource_exceptions_to_mark() is called | |
Public Member Methods inherited from OMQ::AbstractParallelStream | |
| destructor () | |
| wait for any I/O in progress to complete | |
| nothing | cleanupBase () |
| called by child classes when the thread resource is still allocated and the thread exits or one of Qore::throw_thread_resource_exceptions() or Qore::throw_thread_resource_exceptions_to_mark() is called | |
| bool | inTransaction () |
| Returns True if a remote transaction is in progress. | |
| OMQ::StreamInfo | getInfo () |
| returns performance information about the stream | |
Private Member Methods | |
| constructor (*hash< auto > options, DbRemoteBase remote, string sql, *list< auto > args) | |
| Private constructor. | |
| constructor (*hash< auto > options, string remote, string datasource, string sql, *list< auto > args) | |
| Private constructor. | |
| constructor (*hash< auto > options, QorusSystemRestHelper remote, string datasource, string sql, *list< auto > args) | |
| Private constructor. | |
| startStreamImpl () | |
| opens the remote transaction if necessary | |
| socketThreadImpl () | |
| receive reimplementation | |
| nothing | recvDataImpl (auto rdata) |
| An abstract method to handle incoming data. | |
| nothing | recvDataDoneImpl (*string err) |
| called when all data has been received or the background I/O operation terminates due to an error | |
| checkComplete (string meth) | |
| checks if data is requested after the transfer is complete | |
Private Member Methods inherited from OMQ::AbstractParallelReceiveStream | |
| abortInternMethod (string meth) | |
| if the I/O thread is running, then abort it, disconnect the connection, and throw a user-friendly exception what happened and how to avoid such situations in the future | |
| abortIntern (string meth, string fmt) | |
| if the I/O thread is running, then abort it, disconnect the connection, and throw a user-friendly exception what happened and how to avoid such situations in the future | |
Private Member Methods inherited from OMQ::AbstractParallelStream | |
| Qore::Thread::Counter | cnt () |
| confirmation counter for the socket I/O thread | |
| OMQ::StreamInfo | m_info () |
| stream information | |
| waitIoComplete () | |
| waits for the I/O thread to complete and returns | |
| markIoInProgress () | |
| marks the current connection as in progress; must be already checked beforehand that it's not in progress | |
| markIoComplete () | |
| performs thread cleanup on the background I/O thread if any is registered and running | |
| checkError (string cmd) | |
| checks for an error in the background send thread; if there is one, then rethrows the exception in the main application / data thread | |
| startStream () | |
| opens the remote transaction by calling startStreamImpl() and starts the background I/O socket thread | |
| socketThread (*ThreadLocalData my_tld) | |
| sets up thread-local data if possible and calls socketThreadImpl() that implements the background socket I/O for the object | |
| abortIo (string reason) | |
| signals the end of queue operations | |
| bool | abortIoWait (string reason) |
| signals the end of queue operations and waits until the socket thread terminates | |
| beginTransaction (OMQ::DbStreamConfig m_config) | |
| starts or continues a remote transaction | |
| commit (OMQ::DbStreamConfig m_config) | |
| commits a remote transaction | |
| rollback (OMQ::DbStreamConfig m_config) | |
| rolls back a remote transaction | |
Private Attributes | |
| DbSelectStreamConfig | m_config |
| stream configuration | |
| bool | complete |
| flag indicating that all data has been taken from the Queue | |
Private Attributes inherited from OMQ::AbstractParallelStream | |
| Qore::Thread::Queue | dataq |
| Queue for the socket I/O thread. | |
| *hash< auto > | thread_ex |
| exception info for send thread to communicate errors to the primary data thread | |
| string | objid |
| stream object identifier | |
| const | StreamTerminatedError = "STREAM-TERMINATED" |
| stream terminated error | |
| const | ThreadKey = "_STREAM_" |
| thread-local data key | |
Additional Inherited Members | |
Static Public Member Methods inherited from OMQ::AbstractParallelStream | |
| static | staticCleanup () |
| performs static thread resource cleanup on I/O thread resources | |
| static | checkStream (QorusSystemRestHelper helper, string op) |
| checks if there is a stream operation running in the background, if so, a user-friendly exception is thrown | |
Public Attributes inherited from OMQ::AbstractParallelStream | |
| const | DO_DISCONNECT = True |
| A constant for rollback() methods to perform real disconnect. | |
| const | DONT_DISCONNECT = False |
| A constant for rollback() methods to keep the network connection alive. | |
A class for inbound/reading data from the remote instance, I/O is handled in a background thread and is made available in the getData() and getAllData() methods.
"Qorus-Connection: Continue-Persistent" header when opening the stream if the "transaction" constructor() option is set to True. Remote transactions must be explicitly committed (by calling DbRemoteReceive::commit() for example) or aborted (by calling DbRemoteReceive::disconnect() for example); otherwise the remote transaction status is left unchanged by the DbRemoteReceive object.transaction option is set, otherwise the remote transaction status is left unchanged | OMQ::DbRemoteReceive::commit | ( | ) |
Commit remote transaction.
| OMQ::DbRemoteReceive::constructor | ( | DbRemoteBase | remote, |
| string | stream, | ||
| string | table_name, | ||
| *hash< auto > | options | ||
| ) |
constructor taking an OMQ::DbRemoteBase object for the remote connection
| remote | an OMQ::DbRemoteBase object |
| stream | the system.sqlutil service stream to be used |
| table_name | a string with remote table name located in the remote datasource |
| options | optional Streaming API Constructor Options as follows:
|
transaction option is set, otherwise the remote transaction status is left unchangedforupdate select_option must be manually included in the "select" option hash to initiate a "select for update"; this is not automatically set by setting the "transaction" option| OMQ::DbRemoteReceive::constructor | ( | DbRemoteBase | remote, |
| string | table_name, | ||
| *hash< auto > | options | ||
| ) |
constructor taking an OMQ::DbRemoteBase object for the remote connection and assuming the "select" stream
| remote | an OMQ::DbRemoteBase object |
| table_name | a string with remote table name located in the remote datasource |
| options | optional Streaming API Constructor Options as follows:
|
"select" transaction option is set, otherwise the remote transaction status is left unchangedforupdate select_option must be manually included in the "select" option hash to initiate a "select for update"; this is not automatically set by setting the "transaction" option| OMQ::DbRemoteReceive::constructor | ( | QorusSystemRestHelper | remote, |
| string | datasource, | ||
| string | stream, | ||
| string | table_name, | ||
| *hash< auto > | options | ||
| ) |
constructor taking an OMQ::QorusSystemRestHelper object for the remote connection
| remote | an OMQ::QorusSystemRestHelper object |
| datasource | a string with name of the remote datasource to use |
| stream | the system.sqlutil service stream to be used |
| table_name | a string with remote table name located in the remote datasource |
| options | optional Streaming API Constructor Options as follows:
|
transaction option is set, otherwise the remote transaction status is left unchangedforupdate select_option must be manually included in the "select" option hash to initiate a "select for update"; this is not automatically set by setting the "transaction" option| OMQ::DbRemoteReceive::constructor | ( | QorusSystemRestHelper | remote, |
| string | datasource, | ||
| string | table_name, | ||
| *hash< auto > | options | ||
| ) |
constructor taking an OMQ::QorusSystemRestHelper object for the remote connection and assuming the "select" stream
| remote | an OMQ::QorusSystemRestHelper object |
| datasource | a string with name of the remote datasource to use |
| table_name | a string with remote table name located in the remote datasource |
| options | optional Streaming API Constructor Options as follows:
|
"select" transaction option is set, otherwise the remote transaction status is left unchangedforupdate select_option must be manually included in the "select" option hash to initiate a "select for update"; this is not automatically set by setting the "transaction" option| OMQ::DbRemoteReceive::constructor | ( | string | remote, |
| string | datasource, | ||
| string | stream, | ||
| string | table_name, | ||
| *hash< auto > | options | ||
| ) |
constructor taking a string giving the name of the remote connection for the remote server
| remote | a string giving the name of the remote connection for the remote server |
| datasource | a string with name of the remote datasource to use |
| stream | the system.sqlutil service stream to be used |
| table_name | a string with remote table name located in the remote datasource |
| options | optional Streaming API Constructor Options as follows:
|
transaction option is set, otherwise the remote transaction status is left unchangedforupdate select_option must be manually included in the "select" option hash to initiate a "select for update"; this is not automatically set by setting the "transaction" option| OMQ::DbRemoteReceive::constructor | ( | string | remote, |
| string | datasource, | ||
| string | table_name, | ||
| *hash< auto > | options | ||
| ) |
constructor taking a string giving the name of the remote connection for the remote server and assuming the "select" stream
| remote | a string giving the name of the remote connection for the remote server |
| datasource | a string with name of the remote datasource to use |
| table_name | a string with remote table name located in the remote datasource |
| options | optional Streaming API Constructor Options as follows:
|
"select" transaction option is set, otherwise the remote transaction status is left unchangedforupdate select_option must be manually included in the "select" option hash to initiate a "select for update"; this is not automatically set by setting the "transaction" option| *hash< auto > OMQ::DbRemoteReceive::getAllData | ( | *timeout | timeout_ms | ) |
returns all data recevied by the object in a single call, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue
| timeout_ms | an override for the the timeout for waiting on the queue; integers are interpreted as milliseconds; relative date/time values are interpreted literally with a maximum resolution of milliseconds; if the timeout limit is exceeded before data is available, a QUEUE-TIMEOUT error is thrown. If no value is given here, the default queue timeout value configured for the object is used (see the "queue_timeout" option in the constructor()) |
| DB-REMOTE-RECEIVE-ERROR | this exception is thrown if this method is called after it returns NOTHING signifying end of stream |
| QUEUE-TIMEOUT | no data was posted to the queue in the timeout period |
| STREAM-TERMINATED | if the I/O thread was terminated prematurely, this exception will be thrown |
| *list< auto > OMQ::DbRemoteReceive::getAllDataRows | ( | *timeout | timeout_ms | ) |
returns all data recevied by the object in a single call as a list<auto> of rows, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue
| timeout_ms | an override for the the timeout for waiting on the queue; integers are interpreted as milliseconds; relative date/time values are interpreted literally with a maximum resolution of milliseconds; if the timeout limit is exceeded before data is available, a QUEUE-TIMEOUT error is thrown. If no value is given here, the default queue timeout value configured for the object is used (see the "queue_timeout" option in the constructor()) |
| DB-REMOTE-RECEIVE-ERROR | this exception is thrown if this method is called after it returns NOTHING signifying end of stream |
| QUEUE-TIMEOUT | no data was posted to the queue in the timeout period |
| STREAM-TERMINATED | if the I/O thread was terminated prematurely, this exception will be thrown |
| *hash< auto > OMQ::DbRemoteReceive::getData | ( | *timeout | timeout_ms | ) |
returns queued data as soon as it is available, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue; once this method return NOTHING it signifies that the end of stream data condition has been reached; do not call this method again after it returns NOTHING
| timeout_ms | an override for the the timeout for waiting on the queue; integers are interpreted as milliseconds; relative date/time values are interpreted literally with a maximum resolution of milliseconds; if the timeout limit is exceeded before data is available, a QUEUE-TIMEOUT error is thrown. If no value is given here, the default queue timeout value configured for the object is used (see the "queue_timeout" option in the constructor()) |
| DB-REMOTE-RECEIVE-ERROR | this exception is thrown if this method is called after it returns NOTHING signifying end of stream |
| QUEUE-TIMEOUT | this exception is thrown if a timeout occurs on the Queue |
| STREAM-TERMINATED | if the I/O thread was terminated prematurely, this exception will be thrown |
| *list< auto > OMQ::DbRemoteReceive::getDataRows | ( | *timeout | timeout_ms | ) |
returns queued data as a list<auto> of rows as soon as it is available, if the timeout is omitted or equal or less than 0, no timeout is used and the call will block until data is available on the queue; once this method return NOTHING it signifies that the end of stream data condition has been reached; do not call this method again after it returns NOTHING
| timeout_ms | an override for the the timeout for waiting on the queue; integers are interpreted as milliseconds; relative date/time values are interpreted literally with a maximum resolution of milliseconds; if the timeout limit is exceeded before data is available, a QUEUE-TIMEOUT error is thrown. If no value is given here, the default queue timeout value configured for the object is used (see the "queue_timeout" option in the constructor()) |
| DB-REMOTE-RECEIVE-ERROR | this exception is thrown if this method is called after it returns NOTHING signifying end of stream |
| QUEUE-TIMEOUT | this exception is thrown if a timeout occurs on the Queue |
| STREAM-TERMINATED | if the I/O thread was terminated prematurely, this exception will be thrown |
| OMQ::DbRemoteReceive::openStream | ( | string | stream, |
| string | table_name, | ||
| *hash< auto > | options | ||
| ) |
flushes the current stream and reopens a new stream with the same remote connection and in the same datasource
| stream | the system.sqlutil service stream to be used |
| table_name | a string with remote table name located in the remote datasource |
| options | optional Streaming API Constructor Options as follows:
|
|
private |
An abstract method to handle incoming data.
| rdata | data arrive in hash format: keys = columns, values = lists of row values |
| OMQ::DbRemoteReceive::rollback | ( | bool | action = DO_DISCONNECT | ) |
Rollback remote transaction.
| action | an optional bool value to keep connection open or close the connection. Connection closing is the default |