SparkseePython3 6.1.0
sparksee.Database Class Reference

Database class. More...

Public Member Functions

 dump_schema (self, file_path)
 Dump the database schema to the given file using the Sparksee scripting format.
 add_query_stream_manager (self, query_stream_manager)
 Add a QueryStreamManager to the database.
 new_session (self)
 Creates a new Session.
 get_path (self)
 Gets the path of the Database.
 enable_rollback (self)
 Enables the rollback mechanism.
 fix_current_cache_max_size (self)
 Sets the cache maximum size to the current cache size in use.
 redo_precommitted (self, tx_id)
 Redo a pending precommitted transaction recovered.
 get_statistics (self, stats)
 Gets Database statistics.
 set_cache_max_size (self, mega_bytes)
 Sets the cache maximum size (in MB).
 disable_rollback (self)
 Disables the rollback mechanism.
 close (self)
 Closes the Database instance.
 get_alias (self)
 Gets the alias of the Database.
 get_cache_max_size (self)
 Gets the cache maximum size (in MB).
 is_closed (self)
 Gets if Database instance has been closed or not.

Detailed Description

Database class.

All the data of the Database is stored into a persistent file which just can be created or open through a Sparksee instance.

Also, all the manipulation of a Database must be done by means of a Session which can be initiated from a Database instance.

Multiple Databases do not share the memory, that is there is no negotiation among them. In those cases, memory must be prefixed for each Database. To do that, use the SPARKSEEConfig.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

◆ add_query_stream_manager()

sparksee.Database.add_query_stream_manager ( self,
query_stream_manager )

Add a QueryStreamManager to the database.

The user is responsible of keeping the manager alive for the duration of the Database. The Managers will be used in reverse order of addition while searching for a matching Stream.

Parameters
query_stream_manager[In] A reference to a QueryStreamManager

◆ close()

sparksee.Database.close ( self)

Closes the Database instance.

It must be called to ensure the integrity of all data.

◆ dump_schema()

sparksee.Database.dump_schema ( self,
file_path )

Dump the database schema to the given file using the Sparksee scripting format.

Parameters
file_pathnull

◆ get_alias()

sparksee.Database.get_alias ( self)

Gets the alias of the Database.

Returns
The alias of the Database.

◆ get_cache_max_size()

sparksee.Database.get_cache_max_size ( self)

Gets the cache maximum size (in MB).

Returns
Returns the current cache max size.

◆ get_path()

sparksee.Database.get_path ( self)

Gets the path of the Database.

Returns
The path of the Database.

◆ get_statistics()

sparksee.Database.get_statistics ( self,
stats )

Gets Database statistics.

Parameters
stats[out] The DatabaseStatistics instance.

◆ is_closed()

sparksee.Database.is_closed ( self)

Gets if Database instance has been closed or not.

See also
close()
Returns
TRUE if the Database instance has been closed, FALSE otherwise.

◆ new_session()

sparksee.Database.new_session ( self)

Creates a new Session.

Returns
A new Session instance.

◆ redo_precommitted()

sparksee.Database.redo_precommitted ( self,
tx_id )

Redo a pending precommitted transaction recovered.

YOU SHOULD NOT USE THIS METHOD. This method only exists for a specific service.

Parameters
tx_idnull

◆ set_cache_max_size()

sparksee.Database.set_cache_max_size ( self,
mega_bytes )

Sets the cache maximum size (in MB).

0 means unlimited which is all the physical memory of the computer minus a small margin.

Parameters
mega_bytes[in] The new cache max size.