Striim 3.10.3 documentation

Note

In this release, this is not a cache. Striim queries the external database as data is needed. If the same data is needed again, Striim queries it again.

CREATE EXTERNAL CACHE <name> (
ConnectionURL: '<database connection string>',
ConnectionRetry: <parameters>,
FetchSize: <count>,
Table: '<table name>',
KeyToMap: '<column name>',
SkipInvalid: <True / False>
)
OF <type name>;
• AdapterName must be DatabaseReader.

• For Username, Password, ConnectionURL, FetchSize and discussion of whether you need to install a JDBC driver, see Database Reader.

• With the default setting, if a connection attempt is unsuccessful, the adapter will try again in 30 seconds (retryInterval. If the second attempt is unsuccessful, in 30 seconds it will try a third time (maxRetries). If that is unsuccessful, the adapter will fail and log an exception. Negative values are not supported.

• For Table, specify a single table. See the discussion of the Tables property in Database Reader for additional information.

• For Columns, specify the names of the columns you wish to retrieve, separated by commas.

• For KeyToMap specify the table's primary key column. If the table has no primary key, specify any column.

• When skipinvalid has its default value of False, if the data in a cache does not match the defined format (for example, if it has fewer fields that are in the type), the application will crash. To skip invalid records, set to True.

• You may omit ConnectionRetry, FetchSize, and SkipInvalid from TQL if their default values are appropriate.

• The OF type must match the order, number, and data types of the specified columns.

For example:

CREATE TYPE RackType(
rack_id String KEY,
datacenter_id String,
rack_aisle java.lang.Integer,
rack_row java.lang.Integer,
slot_count java.lang.Integer
);
CREATE EXTERNAL CACHE ConfiguredRacks (
OF RackType;