|
| constructor (string remote, string path, *hash options) |
| constructor taking a string giving the name of the remote connection for the remote server More...
|
|
| constructor (string remote, string conn, string path, *hash options) |
| constructor taking a string giving the name of the remote connection for the remote server More...
|
|
| constructor (QorusSystemRestHelper remote, string path, *hash options) |
| constructor taking an OMQ::QorusSystemRestHelper object for the remote connection More...
|
|
| constructor (QorusSystemRestHelper remote, string conn, string path, *hash options) |
| constructor taking an OMQ::QorusSystemRestHelper object for the remote connection More...
|
|
private | stopIoThreadImpl () |
| signal the I/O thread to stop sending data
|
|
private | terminateIoWait (string action) |
| flushes all remote I/O, terminates the I/O thread, and checks for background I/O errors, in which case an exception is thrown
|
|
private | startStreamImpl () |
| no implementation in this class
|
|
private | socketThreadImpl () |
| opens the remote socket stream in the socket I/O thread and starts streaming the data
|
|
| commit () |
| this method flushes all buffered I/O to the remote server and returns when all data have been sent to the server and the socket I/O thread has terminated More...
|
|
| cancel () |
| this method purges any queued I/O and stops the socket thread and returns when the socket I/O thread has terminated More...
|
|
| append (data data) |
| Append data to the ready queue: data. More...
|
|
| append (Qore::FileLineIterator it) |
| Append data to the ready queue using a FileLineIterator object for input. More...
|
|
private bool | submitImpl () |
| queues buffered data to be sent in the socket I/O thread More...
|
|
nothing | rename (string target, softbool man=False) |
| executes an implicit commit() and renames/moves the file given in path in the constructor() More...
|
|
nothing | del () |
| executes an implicit commit() and deletes the file given in path in the constructor() More...
|
|
private any | sendDataImpl () |
| reimplemented from DataStreamClient::DataStreamSendMessage More...
|
|
OMQ::StreamConfig | config () |
| returns the configuration object
|
|
| destructor () |
| waits for any I/O to complete and then returns
|
|
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
|
|
| disconnect () |
| Disconnects the connection.
|
|
| flush () |
| flushes all remote I/O, signals the I/O thread to terminate and waits for confirmation, then checks for background I/O errors, in which case an exception is thrown in this thread More...
|
|
private bool | terminateIoWaitIntern (string action) |
| flushes all remote I/O, signals the I/O thread the terminate and waits for confirmation, then checks for background I/O errors, in which case an exception is thrown in this thread More...
|
|
Filesystem stream for outbound/writing data to the remote instance.
- FsRemoteSend Background Socket I/O
- This class creates a background thread that handles the socket I/O so that socket I/O can be executed in parallel to the main data acquisition thread (the thread that creates the object).
There is a Queue object that passes aggregated row data to the send thread; the default Queue size is 2 (representing a number of blocks), which allows 2 blocks of data to be queued before the internal private FsRemoteSend::submitImpl() (called implicitly by DbRemoteSend::append()) will block.
If the Queue size is 2 and the block size is 16384 then at most 32768 bytes will be queued for sending before the main thread will block in the internal private method FsRemoteSend::submitImpl().
This allows the main data acquisition thread to stay loosely in sync with the I/O thread so that memory usage is optimized and furthermore serves to avoid stalling the I/O thread due to lack of data.
OMQ::FsRemote class can be used for synchronous calls of the remote system.fs service
- FsRemoteSend Usage
- Call FsRemoteSend::append() to queue data for sending, then call FsRemoteSend::commit() to ensure that all data have been sent to the remote server before continuing.
In case of an error in the sending thread, FsRemoteSend::cancel() should be called to cancel the socket I/O send operation and shut down the socket thread. Note that in this case the file is not automatically deleted; to delete the file, call omq.system.service.fs.del() manually.
- FsRemoteSend Example
FsRemoteSend fs(qrest, remote_fs_connection, relative_path, opts);
on_success fs.commit();
on_error fs.cancel();
map fs.append($1), dataIterator;
- Note
- This class is not thread-safe; it's designed to be used from a single thread; calling this class's methods from multiple threads simultaneously will result in unpredictable behavior