Enterprise RTView® 
User Guide


Caches

The Cache data source was specifically designed to enable high-speed analytic processing of real-time data and the comparison of current real-time values against history data, either visually or as input to alert rules that activate automated behavior.

The Cache data source allows for easy definition of a memory resident data cache that can store current scalar values, tabular data with optional filters, as well as time-stamped scalar or tabular data (up to a configurable number of entries), which keeps only the most current information and discards older entries. A cache history can be configured to time-stamp incoming data or to recognize a time-stamp already included in incoming data. You can also optionally pre-load a cache with data from another source, for example if you have historical information stored in a database.

In many real-time situations, data enters the system asynchronously. For example, in a financial trading application a series of data might be delivered that contains multi-dimensional data about a particular trading instrument. You might want to store the current value of a particular market data feed based on the instrument name index (IBM) and the activity index ("buy") and require a time-stamped history of this market data to analyze the trend of a particular instrument over a period of time.

The Cache data source allows for much higher performance than the traditional means of either performing analytics on information stored in a database or querying it back out of the database when it is necessary to make calculations.

Create a Cache Definition File
A Cache Definition file is an Enterprise RTView display (.rtv) file that contains your cache definition objects. To create a Cache Definition file, add cache definition objects to a display in the Display Builder. The cache definition objects are in the Caches tab of the Object Palette. For each cache definition, you must assign a unique name in the cacheName property. It is possible to define multiple Cache Definition files.

There are two types of cache definition objects: Table and Double. The Table Cache allows you to cache your tabular data by attaching your input data to the valueTable property. The Double Cache allows you to cache your scalar (double) data by attaching your input data to the value property. When you have finished adding all of your cache definition objects and configuring their properties, Save the display (.rtv) file and add your Cache Definition file to the Cache data source configuration.

The properties for each cache definition object are described below. All of the properties for each cache type can be modified by selecting the cache definition object and using the Object Property dialog.

Cache Definition Objects: Table and Double

Table Cache

Cache Properties
allowDuplicatesInHistoryFlag If this property is deselected, then before adding a new row to the History table the cache data source will first check if an existing row has the identical timestamp and index column values. If a duplicate does exist, the existing row will be replaced with the new row.

NOTE: If duplicate history rows are acceptable or unlikely to occur, then it is recommended that this property remain selected to maintain optimum performance.

cacheName A unique name for the cache. An entry for this property is required. Caches that do not specify a cacheName, as well as caches with duplicate cacheName properties, will not be created and an error will print to the console.
indexColumnNames Enter a semicolon (;) separated list of column names from the attached valueTable to be used as index columns.
indexColumnNamesForDelete Enter a semicolon (;) separated list of column names from the attached valueTable from which defunct rows will be removed. That is, any rows in the current cache table that contain values in the specified indexColumnNamesForDelete that were not updated. These static rows are considered defunct and removed from the current cache table.
timeSpan Amount of time that rows will be kept in the History table according to their timestamp. Specify the duration in seconds or specify a number followed by a single character indicating the desired time interval (e.g. 15m for 15 minutes). Valid characters are as follows:
y years (365 days)
M months (31 days)
w weeks (7 days)
d days
h hours
m minutes
s seconds

The timeSpan property only determines the duration of rows kept in the History table by the cache data source. It does not affect database storage, if any, associated with the cache.

NOTE: The maxNumberOfRows property will limit the total number of rows in the History table regardless of the specified timeSpan.

timestampColumnName Specify the name of a timestamp column. If the specified timestampColumnName is not found in the incoming data, a column will be inserted and each row will contain the time that row was received.

Data Properties
deleteTable For an indexed table cache, this is a data attachment which will cause selected rows to be removed from the cache tables. Rows will be removed if their index column values match those of a row in the table data coming from this attachment.
initialTable Attach this property to a table containing initial values for the cache. This table must contain the same column(s) as the input table attached to valueTable, as well as a timestamp column if timestampColumnName is specified. NOTE: If the specified timestampColumnName is not found in the incoming data, a column will be inserted.

Data attached to this property works best if it is only updated once at the startup of Enterprise RTView.

NOTE: A table attached the initialTable property will be modified if you did not include a column with the timestampColumnName and/or if the deleteTable property is updated. If other objects in your Enterprise RTView application are attached to this same table, those objects may also be affected.

maxNumberOfRows Number of rows in the History table. Default is 100. If set to 0, no History table is created and only the Current table will be available in the Table drop down menu in the Attach to Cache Data dialog.
resetTrigger When data values attached to this property receive an update the cache will be cleared.
schemaTable Optionally attach this property to any tabular data source (e.g. SQL query, XML file, etc.) to provide the structure of a table you would like the Table Cache object to use. Only the table's structure will be used from this data attachment, any row data will be ignored.

Once a schemaTable is specified, Current and History tables will be initialized accordingly and the Attach to Cache Data dialog will show the columns found in that table structure. Once data becomes available, Table Cache objects will contain the columns found in the specified schemaTable, in addition to columns found in the data.

NOTE: If the data types of columns defined in the schemaTable differ from data types found in the actual data attachment, then the schema types will be used and incoming data will be converted. If the specified timestampColumnName is not found in the incoming data, a column will be inserted.

valueTable Attach your input data to this property if it is tabular. For scalar input data, select the Double Cache object and attach your input data to the value property.

Historian Properties
You must specify your Cache definition (.rtv) file as an Historian data configuration (,rtv) file in order use the following object properties.
Property Name Description
currentTableName Enter the name of a table in your Historian database in which to store the cache's current data table. If you specify a currentTableName and no table by that name exists in your database, then one will be created for you the first time you run the Historian.

On each update of the data attached to the valueTable property, the Historian will create or update corresponding rows in the specified currentTableName in the Historian database. The indexColumnNames property will be used to locate rows to update otherwise, if no indexColumnNames are defined, the Historian will replace the entire table on each update.

If the deleteTable property is used to delete rows from the cache's current table, then Historian will also delete those rows from the specified currentTableName table in the Historian database.

On startup of an Enterprise RTView application, the specified currentTableName will be queried from the Historian database for initial rows to be loaded into the cache's current table. To prevent this initial data from being loaded, you can run the Display Builder or Display Viewer from a command window and use the -nohistory command line option.

NOTE: The currentTableName property is not supported in combination with the Historian's -kdbformat command line option.

databaseName Name of your Historian database that contains history and/or current tables for this cache. If left blank, the database name RTVHISTORY is assumed.
historyTableName Enter the name of a table in your Historian database in which to store the cache's history data table. If you specify a historyTableName and no table by that name exists in your database, then one will be created for you the first time you run the Historian.

When rows are appended to the cache's history table, the Historian will also append those rows to the specified historyTableName in the Historian database.

If you specify a timestampColumnName, the Historian assumes that column will be used for sorting and purging rows in chronological order and will not append its own timestamp columns to the specified historyTableName table.

Before data is stored in the database, the cache's schemaTable, if any, is applied.

If you specify a historyTableName, Enterprise RTView applications will automatically query the Historian database table for the initial rows to be loaded into the cache's history table, provided that:

  • The initialTable property is not attached to data (indicating an explicit query has been configured to load cache history data), and
  • A timestampColumnName is specified (so that it can be used to sort the SQL query result by time).

The number of rows loaded by this initial query is limited by the maxNumberOfRows property. To prevent this initial data from being loaded, you can run the Display Builder or Display Viewer from a command window and use the -nohistory command line option.

quoteColumnNamesFlag If selected, column names will be quoted in all SQL queries and commands for this cache.

Object Properties
Property Name Description
objName Name given to facilitate object management via the Object List dialog. Select Tools>Object List.
objX Plot x-axis position of object.
objY Plot y-axis position of object.

 


 

Double Cache

Cache Properties
cacheName A unique name for the cache. An entry for this property is required. Caches that do not specify a cacheName, as well as caches with duplicate cacheName properties, will not be created and an error will print to the console.
timeSpan Amount of time that rows will be kept in the History table according to their timestamp. Specify the duration in seconds or specify a number followed by a single character indicating the desired time interval (e.g. 15m for 15 minutes). Valid characters are as follows:
y years (365 days)
M months (31 days)
w weeks (7 days)
d days
h hours
m minutes
s seconds

The timeSpan property only determines the duration of rows kept in the History table by the cache data source. It does not affect database storage, if any, associated with the cache.

NOTE: The maxNumberOfRows property will limit the total number of rows in the History table regardless of the specified timeSpan.

timestampColumnName Specify the name of a timestamp column. If the specified timestampColumnName is not found in the incoming data, a column will be inserted and each row will contain the time that row was received

Data Properties
initialTable Attach this property to a table containing initial values for the cache. This attachment must result in a table with a single column of type double, as well as a timestamp column if timestampColumnName is specified. NOTE: If the specified timestampColumnName is not found in the incoming data, a column will be inserted.

Data attached to this property works best if it is only updated once at the startup of Enterprise RTView.

NOTE: A table attached the initialTable property will be modified if you did not include a column with the timestampColumnName and/or if the deleteTable property is updated. If other objects in your Enterprise RTView application are attached to this same table, those objects may also be affected.

maxNumberOfRows Number of rows in the History table. Default is 100. If set to 0, no History table is created and only the Current table will be available in the Table drop down menu in the Attach to Cache Data dialog.
resetTrigger When data values attached to this property receive an update the cache will be cleared.
value Attach your input data to this property if it is scalar. For tabular input data, select the Table Cache object and attach your input data to the valueTable property.

Historian Properties
Property Name Description
databaseName Name of your Historian database that contains history and/or current tables for this cache. If left blank, the database name RTVHISTORY is assumed.
historyTableName Enter the name of a table in your Historian database in which to store the cache's history data table. If you specify a historyTableName and no table by that name exists in your database, then one will be created for you the first time you run the Historian.

When rows are appended to the cache's history table, the Historian will also append those rows to the specified historyTableName in the Historian database.

If you specify a timestampColumnName, the Historian assumes that column will be used for sorting and purging rows in chronological order and will not append its own timestamp columns to the specified historyTableName table.

Before data is stored in the database, the cache's schemaTable, if any, is applied.

If you specify a historyTableName, Enterprise RTView applications will automatically query the Historian database table for the initial rows to be loaded into the cache's history table, provided that:

  • The initialTable property is not attached to data (indicating an explicit query has been configured to load cache history data), and
  • A timestampColumnName is specified (so that it can be used to sort the SQL query result by time).

The number of rows loaded by this initial query is limited by the maxNumberOfRows property. To prevent this initial data from being loaded, you can run the Display Builder or Display Viewer from a command window and use the -nohistory command line option.

quoteColumnNamesFlag If selected, column names will be quoted in all SQL queries and commands for this cache.

Object Properties
Property Name Description
objName Name given to facilitate object management via the Object List dialog. Select Tools>Object List.
objX Plot x-axis position of object.
objY Plot y-axis position of object.

 


Add a Cache Definition File
When the Cache data source reads in a Cache Definition file, it creates a cache for each cache definition object in the file using the unique cacheName given to each object. Caches that do not specify a cacheName, as well as caches with duplicate cacheName properties, will not be created and an error will print to the console. See Application Options for details on how to add a Cache Definition file to the Cache data source configuration.

 

Viewing Caches
You can create a display using the Display Builder to view your real-time cache data. See the Attach to Cache Data section for more information on attaching to cache data variables.

 

 
Enterprise RTView contains components licensed under the Apache License Version 2.0.

 

Treemap Algorithms v1.0  is used without modifications and licensed by MPL Version 1.1. Copyright © 2001 University of Maryland, College Park, MD

 

Datejs is licensed under MIT. Copyright © Coolite Inc.

 

JCalendar 1.3.2 is licensed under LGPL. Copyright © Kai Toedter.

 
JMS, JMX and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. They are mentioned in this document for identification purposes only. 

 
SL, SL-GMS, GMS, Enterprise RTView, SL Corporation, and the SL logo are trademarks or registered trademarks of Sherrill-Lubinski Corporation in the United States and other countries. Copyright © 1998-2009 Sherrill-Lubinski Corporation. All Rights Reserved.