Skip to main content

CREATE WACTIONSTORE

CREATE WACTIONSTORE <name> 
CONTEXT OF { <type name> } 
EVENT TYPES ( <type name> ) 
[ USING { MEMORY | ( <properties> ) } ];
  • The CONTEXT OF type defines the fields that may be stored in the WActionStore. Two WActionStores may not use the same CONTEXT OF type. If necessary, define multiple identical types to work around this limitation.

  • If LINK SOURCE EVENT is not specified in the CQ that populates the WActionStore, specify the CONTEXT OF type as the sole event type. If LINK SOURCE EVENT is specified, specify the type of each component specified in the CQ's FROM clause in EVENT TYPES.

  • USING MEMORY disables persistence.

  • If you omit the USING clause, the WActionStore will persist to Elasticsearch with its default properties. This is functionally equivalent to USING (storageProvider:'elasticsearch'). Data is persisted to Striim/data/<cluster name>/nodes/<node number>/indices/<namespace>.<WActionStore name>. See https://www.elastic.co/blog/found-dive-into-elasticsearch-storage for more information about these paths.

For example, from MultiLogApp:

CREATE TYPE ZeroContentEventListType (
    srcIp String KEY,
    code Integer,
    size Integer,
    level String,
    message String,
    xception String);
    
CREATE WACTIONSTORE ZeroContentEventList
CONTEXT OF ZeroContentEventListType 
EVENT TYPES (
  ZeroContentEventListType ...

CREATE CQ GenerateZeroContentEventList
INSERT INTO ZeroContentEventList
SELECT srcIp, code, size, level, message, xception ...

This stores the information used to populate the five-column table on the Zero Content details dashboard page.

See PosApp for a detailed discussion of how the queries, types, and WActionStore interact.

The following will persist to Elasticsearch:

CREATE WACTIONSTORE MerchantActivity  
CONTEXT OF MerchantActivityContext
EVENT TYPES (MerchantTxRate);

The following will retain data in Elasticsearch for a minimum of one day, after which it will be expunged. The exact time the data will be expunged is unpredictable.

CREATE WACTIONSTORE MerchantActivity  
CONTEXT OF MerchantActivityContext
EVENT TYPES (MerchantTxRate) 
  USING (storageProvider:'elasticsearch', elasticsearch.time_to_live: '1d');

You may specify the time to live as m (milliseconds), s (seconds), h (hours), d (days), or w (weeks). 

The following does not persist the data to disk:

CREATE WACTIONSTORE MerchantActivity
  CONTEXT OF MerchantActivityContext
  EVENT TYPES (MerchantTxRate)
  USING MEMORY;

Striim also supports persistence to MySQL and Oracle. To use one of those options, specify USING (<properties>) with the appropriate properties for the DBMS as detailed below.

Warning

WActionStores with more than one event type cannot be persisted to MySQL or Oracle.

The properties for MySQL are:

storageProvider:'jdbc',
persistence_interval: '10 sec',
JDBC_DRIVER:'com.mysql.jdbc.Driver',
JDBC_URL:'jdbc:mysql://<host>/<database name>',
JDBC_USER:'<user name>',
JDBC_PASSWORD:'<password>',
DDL_GENERATION:'create-or-extend-tables'

The properties for Oracle are:

storageProvider:'jdbc',
persistence_interval: '10 sec',
JDBC_DRIVER:'oracle.jdbc.driver.OracleDriver',
JDBC_URL:'jdbc:oracle:thin:@<host IP address>:<port>:<host SID>',
JDBC_USER:'<user name>',
JDBC_PASSWORD:'<password>',
DDL_GENERATION:'create-or-extend-tables',
CONTEXT_TABLE:'<context table name>',
EVENT_TABLE:'<event table name>'

Warning

When persisting a WActionStore to Oracle, the context and event table names must be unique within the application and not exceed Oracle's 30-character limit, and the number of characters in the namespace and the WActionStore name must total no more than 24.