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.

Adding Caches
In the Display Builder, select Tools>Caches to open the Caches dialog. When you have finished adding all of your caches and configuring their properties, Save the display (.rtv) file and add this Cache Definition file to the Cache data source configuration.

 
 
Add To add a new cache, click Add and enter a cache name and select a cache type. Once you have added a cache, select that cache from the list and edit properties in the Object Properties dialog.
Cache Name Enter a unique name for each cache listed. Caches that do not specify a name, as well as caches with a duplicate names, will not be created and an error will print to the console.
Cache Type Choose a type of cache from the drop down menu (Table or Double).
Copy Select a cache from the list and click Copy to create a duplicate of that cache. NOTE: You must enter a unique name for each copy you make.

To copy a cache from your current display to another display (.rtv) file, select a cache from the list and click the Copy button  in the toolbar (or Ctrl-C). Then open the other display (.rtv) file and click the Paste button  (or Ctrl-V).  If a cache by that name already exists in that display (.rtv) file, you will need to rename the cache.

NOTE: A cache pasted into another display (.rtv) file will have the same data attachments as the original cache.

Remove Select a cache from the list and click Remove to delete.
Display Content Select a cache from the list that is attached to data and click Display Content to view the contents of the attached current and/or history table(s).
List All Caches Select to view caches from all display (.rtv) files and included files. NOTE: Only properties for caches defined within the current display (.rtv) file can be modified.

Cache Definition Files
To create an Cache Definition file, save the display (.rtv) file that contains the cache definition properties you set. See Application Options for details on how to add a Cache Definition file to the Cache data source configuration.

Viewing Caches
See the Attach to Cache Data section for more information on attaching to cache data variables.

 


Table Cache
The Table Cache allows you to cache your tabular data. Attach your input data to the valueTable property.

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
compactionType Select from the following options:
  • None - No compaction.
  • Aggregate - Compact via data aggregation.
  • Displace - Compact via table displacement.

You must specify at least one index column via the indexColumnNames property and, where possible, quoteColumnNamesFlag should be selected to preserve column name case.

NOTE: Based on your specified compactionRules, use the -smoothcompaction command line option to perform compaction on old data which currently exists in your database from prior executions of the Historian.

compactionGroupBy This property applies only if the selected compactionType is Aggregate. Click on the  button to specify the methods used to perform compaction (i.e. sum, count, average, min or max).
compactionRules Specify compaction rules. NOTE: If the selected compactionType is Displace, then currently this property only supports the use of one displacement rule.

NOTE: These object properties apply to Advanced Historian users only.

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
The Double Cache allows you to cache your scalar (double) data. Attach your input data to the value property.

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.
 


 
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.

 

jQuery is licensed under MIT. Copyright © John Resig,

 
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.