Qorus Integration Engine®  4.1.4.p4_git
com.qoretechnologies.qorus.DbRemoteSend Class Reference
Inheritance diagram for com.qoretechnologies.qorus.DbRemoteSend:
org::qore::jni::QoreObjectWrapper

Public Member Methods

 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
 

Detailed Description

Java wrapper for the OMQ::DbRemoteSend class in Qorus

Constructor & Destructor Documentation

◆ DbRemoteSend() [1/7]

com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend ( QoreObject  obj)
inline

Creates the object as a wrapper for the Qore object

◆ DbRemoteSend() [2/7]

com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend ( DbRemote  remote,
String  stream,
String  table_name,
HashMap< String, Object options 
) throws Throwable
inline

Constructor taking a DbRemote object for the remote server

Parameters
remotea DbRemote object
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource
optionsoptional 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
remotea DbRemote object
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource
Note
the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object

◆ DbRemoteSend() [4/7]

com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend ( String  remote,
String  datasource,
String  stream,
String  table_name,
HashMap< String, Object options 
) throws Throwable
inline

Constructor taking a string giving the name of the remote connection for the remote server

Parameters
remotethe name of the remote connection for the remote server
datasourcea string with name of the remote datasource to use
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource
optionsoptional 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
remotethe name of the remote connection for the remote server
datasourcea string with name of the remote datasource to use
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource
Note
the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object

◆ DbRemoteSend() [6/7]

com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend ( QorusSystemRestHelper  remote,
String  datasource,
String  stream,
String  table_name,
HashMap< String, Object options 
) throws Throwable
inline

Constructor taking a com.qoretechnologies.qorus.QorusSystemRestHelper object for the remote server

Parameters
remotea com.qoretechnologies.qorus.QorusSystemRestHelper object
datasourcea string with name of the remote datasource to use
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource
optionsoptional 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]

com.qoretechnologies.qorus.DbRemoteSend.DbRemoteSend ( QorusSystemRestHelper  remote,
String  datasource,
String  stream,
String  table_name 
) throws Throwable
inline

Constructor taking a com.qoretechnologies.qorus.QorusSystemRestHelper object for the remote server

Parameters
remotea com.qoretechnologies.qorus.QorusSystemRestHelper object
datasourcea string with name of the remote datasource to use
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource
Note
the explicit or default timeout value here overrides any socket I/O timeout set for the remote connection object

Member Function Documentation

◆ 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
dataa 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
dataa 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
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource
optionsoptional 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
streamthe system.sqlutil service stream to be used
table_namea string with remote table name located in the remote datasource

◆ 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
disconnecta 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: