com.apama.memorystore
Event Store


Represents a store, which is a container for a uniquely named collection of tables.
See Also:
com.apama.memorystore.Storage - Provides actions to prepare and open a Store.
com.apama.memorystore.Table - Represents the tables in a Store.

Action summary
 integerbackup(string filename)

Create a backup of the Store.
 stringgetStoreName()

Get the name of this Store.
 booleanhasTable(string name)

Indicate whether or not a Table with the specified name is present in the Store.
 com.apama.memorystore.Tableopen(string name)

Open the specified table, once it has been prepared.
 integerpersist()

Persist committed changes back to stable storage, asynchronously.
 integerprepare(string name, com.apama.memorystore.Schema schema)

Prepare a table so that subsequent open calls for it will succeed.
 integerprepareFromAny(any prototype)

Prepare a table from a supplied type (a users Event) using the type name as the table name and the fields and field types as the schema.
 integerprepareFromTypeName(string typeName)

Prepare a table from a type identified from the supplied type name. The type name should identify a users Event.
 
Action detail

backup

            integer backup(string filename)
        
Create a backup of the Store.

The backup is created in the specified file, which is overwritten if it already exists.

Only persistent (on-disk) stores can be backed up.
Parameters:
filename
Returns:
The unique identifier for this operation, which will be included in the Finished event sent after the operation is complete.
See Also:
com.apama.memorystore.Finished - A Finished event will be sent when this asynchronous operation has completed.

getStoreName

            string getStoreName()
        
Get the name of this Store.

hasTable

            boolean hasTable(string name)
        
Indicate whether or not a Table with the specified name is present in the Store.
Parameters:
name - The unique table name to check for.
Returns:
True if it is safe to call open() on the specified table; false if preparation failed or is still in progress.

open

            com.apama.memorystore.Table open(string name)
        
Open the specified table, once it has been prepared.

It is an error to call this before a prepare call for the table has finished without error.
Parameters:
name - The name of the table to be opened, which must be the same as the name used when the table was first prepared.
See Also:
com.apama.memorystore.Store#prepare() - This action must not be called until prepare has completed successfully.

persist

            integer persist()
        
Persist committed changes back to stable storage, asynchronously.

Only on-disk persistent stores can be persisted using this action. It is not possible to call this method on Correlator-persistent tables since all changes committed to such tables will be written to disk automatically in the same transaction as changes to the state of persistent EPL monitors.
Returns:
The unique identifier for this operation, which will be included in the Finished event sent after the operation is complete.
See Also:
com.apama.memorystore.Finished - A Finished event will be sent when this asynchronous operation has completed.

prepare

            integer prepare(string name, com.apama.memorystore.Schema schema)
        
Prepare a table so that subsequent open calls for it will succeed.

If the table already exists, the Schema provided to the prepare function must completely match the existing schema. If it does not already exist, the Schema will be used to create the table.

The function returns an id; once preparation is complete a Finished event with that id will be sent.

This call is idempotent - if the table was already successfully prepared, it will return success immediately.
Parameters:
name - A unique name that will be used to identify the new table.
schema - The schema identifying the fields of the new table.
Returns:
The unique identifier for this operation, which will be included in the Finished event sent after the operation is complete.
See Also:
com.apama.memorystore.Finished - A Finished event will be sent when this asynchronous operation has completed.

prepareFromAny

            integer prepareFromAny(any prototype)
        
Prepare a table from a supplied type (a users Event) using the type name as the table name and the fields and field types as the schema.

        
integer id := Schema.prepareFromAny(new MyEventType);
Parameters:
prototype - Any type value to use as the table name and schema
Returns:
The unique identifier for this operation, which will be included in the Finished event sent after the operation is complete.
Since:
10.1
See Also:
com.apama.memorystore.Finished - A Finished event will be sent when this asynchronous operation has completed.
com.apama.memorystore.Store#prepare() - 

prepareFromTypeName

            integer prepareFromTypeName(string typeName)
        
Prepare a table from a type identified from the supplied type name. The type name should identify a users Event.

        
integer id := Schema.prepareFromTypeName("MyEventType");
Parameters:
typeName - The type name to use as the table name and schema.
Returns:
The unique identifier for this operation, which will be included in the Finished event sent after the operation is complete.
Since:
10.1
See Also:
com.apama.memorystore.Finished - A Finished event will be sent when this asynchronous operation has completed.
com.apama.memorystore.Store#prepareFromAny() -