com.apama.memorystore
Event Schema


Represents the schema for a table in the store, specifying the field names, types, and other behavioural information about the table.

The fields and types sequences must be the same length as one another, specifying the names of fields and their corresponding types.

Never construct a Schema using a "Schema(...)" expression. Instead, always create a variable initialized to "new Schema", and then set parameters individually with separate statements. This ensures that your code will continue to work without modification if a subsequent version of the MemoryStore adds more parameters to the Schema event.
See Also:
com.apama.memorystore.Store.prepare() - The schema for a table is specified when it is prepared.

Field summary
 sequence<string>fields

A sequence specifying the name of each field in this table.
 sequence<string>types

A sequence specifying the type of each field in this table.
 booleanexposeMemoryView

When this field is true, the MemoryStore makes the rows in the in-memory table associated with this schema available to the scenario service, so they can be used by external clients and dashboards.
 booleanexposePersistentView

When this field is true, the MemoryStore makes the rows in the on-disk table associated with this schema available to the scenario service, so they can be used by external clients and dashboards.
 stringmemoryViewDisplayName

Specifies the display name for an in-memory table.
 stringmemoryViewDescription

Describes an in-memory table.
 stringpersistentViewDisplayName

Specifies the display name for an on-disk table.
 stringpersistentViewDescription

Describes an on-disk table.
 
Action summary
 sequence<string>static normalizeTypes(sequence<string> types)

Normalize a sequence of types to those accepted by Memory Store.
 com.apama.memorystore.Schemastatic schemaFromAny(any prototype)

Convert the supplied types into a valid MemoryStore table Schema.
 
Field detail

exposeMemoryView

boolean exposeMemoryView
When this field is true, the MemoryStore makes the rows in the in-memory table associated with this schema available to the scenario service, so they can be used by external clients and dashboards.

That is, the MemoryStore creates DataViews that contain the state of this table that has been committed (but not necessarily persisted) to the shared in-memory representation of the table.

Committing changes to the in-memory row in a table that is exposing its in-memory state causes events to be sent to the main context.

exposePersistentView

boolean exposePersistentView
When this field is true, the MemoryStore makes the rows in the on-disk table associated with this schema available to the scenario service, so they can be used by external clients and dashboards.

That is, the MemoryStore creates DataViews that contain data from this table that has been persisted to disk.

You cannot expose a persistent view of a table in a correlator-persistent store.

fields

sequence<stringfields
A sequence specifying the name of each field in this table.

For looking up the index of a specific field name (e.g. while processing RowChanged events), use Table.getFieldIndex() which is more efficient than using indexOf() on the fields sequence.
See Also:
com.apama.memorystore.Table.getFieldIndex() - for efficiently obtaining the index of a field.

memoryViewDescription

string memoryViewDescription
Describes an in-memory table.

memoryViewDisplayName

string memoryViewDisplayName
Specifies the display name for an in-memory table.

persistentViewDescription

string persistentViewDescription
Describes an on-disk table.

persistentViewDisplayName

string persistentViewDisplayName
Specifies the display name for an on-disk table.

types

sequence<stringtypes
A sequence specifying the type of each field in this table.

Permitted types are currently: 'integer', 'boolean', 'float', 'string' and 'decimal'.

This sequence must have the same length as the fields sequence.
Action detail

normalizeTypes

sequence<string> static normalizeTypes(sequence<string> types)
Normalize a sequence of types to those accepted by Memory Store.

Converts anything other than integer, float, boolean and decimal to string.
Parameters:
types - Type string sequence to normalize
Returns:
Sequence of normalized string types
Since:
10.1

schemaFromAny

com.apama.memorystore.Schema static schemaFromAny(any prototype)
Convert the supplied types into a valid MemoryStore table Schema.

Field types that are not supported by MemoryStore are converted to strings.
Parameters:
prototype
Returns:
The MemoryStore table Schema.
Since:
10.1