|
| DbRemoteSend (QoreObject obj) |
|
| DbRemoteSend (DbRemote remote, String stream, String table_name, HashMap< String, Object > options) throws Throwable |
|
| DbRemoteSend (DbRemote remote, String stream, String table_name) throws Throwable |
|
| DbRemoteSend (String remote, String datasource, String stream, String table_name, HashMap< String, Object > options) throws Throwable |
|
| DbRemoteSend (String remote, String datasource, String stream, String table_name) throws Throwable |
|
| DbRemoteSend (QorusSystemRestHelper remote, String datasource, String stream, String table_name, HashMap< String, Object > options) throws Throwable |
|
| DbRemoteSend (QorusSystemRestHelper remote, String datasource, String stream, String table_name) throws Throwable |
|
void | openStream (String stream, String table_name, HashMap< String, Object > options) throws Throwable |
|
void | openStream (String stream, String table_name) throws Throwable |
|
void | commit () throws Throwable |
|
void | rollback (boolean disconnect) throws Throwable |
|
void | rollback () throws Throwable |
|
void | append (HashMap< String, Object >[] data) throws Throwable |
|
void | append (HashMap< String, Object > data) throws Throwable |
|
StreamConfig | config () throws Throwable |
|
Java wrapper for the OMQ::DbRemoteSend class in Qorus
◆ DbRemoteSend() [1/7]
com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend |
( |
QoreObject |
obj | ) |
|
|
inline |
Creates the object as a wrapper for the Qore object
◆ DbRemoteSend() [2/7]
Constructor taking a DbRemote object for the remote server
- Parameters
-
remote | a DbRemote 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:
-
"block" : data block size
-
"loglevel" : a default log level option for logging; see Log Levels for valid value
-
"no_remote_timeout" : if True the "timeout" option will not be sent to the remote
-
"omit_update" : a list of columns to omit when updating for asymmetrical upserts; only valid with the "upsert" stream; if this option is given with other streams, it will be ignored
-
"queue_block_size" : the number of blocks to queue for sending before the main data thread will block (default: 2)
-
"queue_timeout" : the number of milliseconds to wait for queue data before throwing a QUEUE-TIMEOUT exception
-
"timeout" : an HTTP socket timeout value in milliseconds; used locally and in the remote for socket I/O and queue operations; default value: 5m
-
"upsert_strategy" : an upsert strategy code; only valid with the "upsert" stream; if this option is given with other streams, it will be ignored
|
- Note
- the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object
◆ DbRemoteSend() [3/7]
com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend |
( |
DbRemote |
remote, |
|
|
String |
stream, |
|
|
String |
table_name |
|
) |
| throws Throwable |
|
inline |
Constructor taking a DbRemote object for the remote server
- Parameters
-
- Note
- the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object
◆ DbRemoteSend() [4/7]
Constructor taking a string giving the name of the remote connection for the remote server
- Parameters
-
remote | 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:
-
"block" : data block size
-
"loglevel" : a default log level option for logging; see Log Levels for valid value
-
"no_remote_timeout" : if True the "timeout" option will not be sent to the remote
-
"omit_update" : a list of columns to omit when updating for asymmetrical upserts; only valid with the "upsert" stream; if this option is given with other streams, it will be ignored
-
"queue_block_size" : the number of blocks to queue for sending before the main data thread will block (default: 2)
-
"queue_timeout" : the number of milliseconds to wait for queue data before throwing a QUEUE-TIMEOUT exception
-
"timeout" : an HTTP socket timeout value in milliseconds; used locally and in the remote for socket I/O and queue operations; default value: 5m
-
"upsert_strategy" : an upsert strategy code; only valid with the "upsert" stream; if this option is given with other streams, it will be ignored
|
- Note
- the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object
◆ DbRemoteSend() [5/7]
com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend |
( |
String |
remote, |
|
|
String |
datasource, |
|
|
String |
stream, |
|
|
String |
table_name |
|
) |
| throws Throwable |
|
inline |
Constructor taking a string giving the name of the remote connection for the remote server
- Parameters
-
- Note
- the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object
◆ DbRemoteSend() [6/7]
Constructor taking a com.qoretechnologies.qorus.QorusSystemRestHelper object for the remote server
- Parameters
-
remote | a com.qoretechnologies.qorus.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:
-
"block" : data block size
-
"loglevel" : a default log level option for logging; see Log Levels for valid value
-
"no_remote_timeout" : if True the "timeout" option will not be sent to the remote
-
"omit_update" : a list of columns to omit when updating for asymmetrical upserts; only valid with the "upsert" stream; if this option is given with other streams, it will be ignored
-
"queue_block_size" : the number of blocks to queue for sending before the main data thread will block (default: 2)
-
"queue_timeout" : the number of milliseconds to wait for queue data before throwing a QUEUE-TIMEOUT exception
-
"timeout" : an HTTP socket timeout value in milliseconds; used locally and in the remote for socket I/O and queue operations; default value: 5m
-
"upsert_strategy" : an upsert strategy code; only valid with the "upsert" stream; if this option is given with other streams, it will be ignored
|
- Note
- the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object
◆ DbRemoteSend() [7/7]
◆ append() [1/2]
void com.qoretechnologies.qorus.DbRemoteSend.append |
( |
HashMap< String, Object > [] |
data | ) |
throws Throwable |
|
inline |
Append data to the ready queue: list
Data are sent whenever their count reaches the block
size.
The DB transaction is left open.
- Parameters
-
data | a list with row data to be added. It should follow the expected target format (list of hashes, each list element represents a row and each has the row data). |
- Note
- This class assumes that data submitted with the append() methods is stable; that is, it has the same format and same hash keys, additionally, if there are any SqlUtil operator hashes, that they are identical in every row
◆ append() [2/2]
void com.qoretechnologies.qorus.DbRemoteSend.append |
( |
HashMap< String, Object > |
data | ) |
throws Throwable |
|
inline |
Append data to the ready queue: hash
Data are sent whenever the row count reaches the block
size.
The DB transaction is left open.
- Parameters
-
data | a hash with data to be added; can be a single row or multiple rows in column format |
- Note
- This class assumes that data submitted with the append() methods is stable; that is, it has the same format and same hash keys, additionally, if there are any SqlUtil operator hashes, that they are identical in every row
◆ commit()
void com.qoretechnologies.qorus.DbRemoteSend.commit |
( |
| ) |
throws Throwable |
|
inline |
Commit the remote transaction. It also sends any pending data in the data queue before the commit.
◆ config()
StreamConfig com.qoretechnologies.qorus.DbRemoteSend.config |
( |
| ) |
throws Throwable |
|
inline |
Returns the configuration object
◆ openStream() [1/2]
void com.qoretechnologies.qorus.DbRemoteSend.openStream |
( |
String |
stream, |
|
|
String |
table_name, |
|
|
HashMap< String, Object > |
options |
|
) |
| throws Throwable |
|
inline |
Flushes the current stream and reopens a new stream with the same remote connection and in the same datasources
- Example:
out.openStream("update", "table2");
- Parameters
-
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:
-
"block" : data block size giving the number of rows per block
-
"timeout" : an HTTP socket timeout value in milliseconds; used locally and in the remote for socket I/O and queue operations; default value: 5m
-
"loglevel" : a default log level option for logging; see Log Levels for valid value
-
"no_remote_timeout" : if True the "timeout" option will not be sent to the remote
-
"queue_block_size" : the number of blocks to queue for sending before the main data thread will block (default: 2)
-
"queue_timeout" : the number of milliseconds to wait for queue data before throwing a QUEUE-TIMEOUT exception
|
◆ openStream() [2/2]
void com.qoretechnologies.qorus.DbRemoteSend.openStream |
( |
String |
stream, |
|
|
String |
table_name |
|
) |
| throws Throwable |
|
inline |
Flushes the current stream and reopens a new stream with the same remote connection and in the same datasources
- Example:
out.openStream("update", "table2");
- Parameters
-
◆ rollback() [1/2]
void com.qoretechnologies.qorus.DbRemoteSend.rollback |
( |
boolean |
disconnect | ) |
throws Throwable |
|
inline |
Rollback remote transaction
- Note
- it's normally better to disconnect the connection if an error occurs rather than call rollback() when streaming because if a chunked transfer is interrupted, then HTTP calls will fail anyway, and the remote end will rollback the transaction in any case unless an explicit commit is executed
- Parameters
-
disconnect | a boolean value to keep connection open or close the connection. Connection closing is the default |
- See also
- disconnect()
◆ rollback() [2/2]
void com.qoretechnologies.qorus.DbRemoteSend.rollback |
( |
| ) |
throws Throwable |
|
inline |
Rollback remote transaction and disconnect the connection
- Note
- it's normally better to disconnect the connection if an error occurs rather than call rollback() when streaming because if a chunked transfer is interrupted, then HTTP calls will fail anyway, and the remote end will rollback the transaction in any case unless an explicit commit is executed
- See also
- disconnect()
The documentation for this class was generated from the following file:
- /builds/qorus/qorus/java/com/qoretechnologies/qorus/DbRemoteSend.java