Qorus Integration Engine®  4.0.3_git
com.qoretechnologies.qorus.DbRemoteSend Class Reference

Java wrapper for the OMQ::DbRemoteSend class in Qorus. More...

Inheritance diagram for com.qoretechnologies.qorus.DbRemoteSend:
org::qore::jni::QoreObjectWrapper

Public Member Methods

 DbRemoteSend (QoreObject obj)
 creates the object as a wrapper for the Qore object
 
 DbRemoteSend (DbRemote remote, String stream, String table_name, HashMap< String, Object > options) throws Throwable
 constructor taking a DbRemote object for the remote server More...
 
 DbRemoteSend (DbRemote remote, String stream, String table_name) throws Throwable
 constructor taking a DbRemote object for the remote server More...
 
 DbRemoteSend (String remote, String datasource, String stream, String table_name, HashMap< String, Object > options) throws Throwable
 constructor taking a string giving the name of the remote connection for the remote server More...
 
 DbRemoteSend (String remote, String datasource, String stream, String table_name) throws Throwable
 constructor taking a string giving the name of the remote connection for the remote server More...
 
 DbRemoteSend (QorusSystemRestHelper remote, String datasource, String stream, String table_name, HashMap< String, Object > options) throws Throwable
 constructor taking a com.qoretechnologies.qorus.QorusSystemRestHelper object for the remote server More...
 
 DbRemoteSend (QorusSystemRestHelper remote, String datasource, String stream, String table_name) throws Throwable
 constructor taking a com.qoretechnologies.qorus.QorusSystemRestHelper object for the remote server More...
 
void openStream (String stream, String table_name, HashMap< String, Object > options) throws Throwable
 flushes the current stream and reopens a new stream with the same remote connection and in the same datasources More...
 
void openStream (String stream, String table_name) throws Throwable
 flushes the current stream and reopens a new stream with the same remote connection and in the same datasources More...
 
void commit () throws Throwable
 Commit the remote transaction. It also sends any pending data in the data queue before the commit.
 
void rollback (boolean disconnect) throws Throwable
 Rollback remote transaction. More...
 
void rollback () throws Throwable
 Rollback remote transaction and disconnect the connection. More...
 
void append (HashMap< String, Object >[] data) throws Throwable
 Append data to the ready queue: list. More...
 
void append (HashMap< String, Object > data) throws Throwable
 Append data to the ready queue: hash. More...
 
StreamConfig config () throws Throwable
 returns the configuration object
 

Detailed Description

Java wrapper for the OMQ::DbRemoteSend class in Qorus.

Constructor & Destructor Documentation

◆ DbRemoteSend() [1/6]

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() [2/6]

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() [3/6]

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() [4/6]

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() [5/6]

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() [6/6]

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.

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).

Data are sent whenever their count reaches the block size.

The DB transaction is left open.

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.

Parameters
dataa hash with data to be added; can be a single row or multiple rows in column format

Data are sent whenever the row count reaches the block size.

The DB transaction is left open.

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

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