SparkseePython  6.0.2
Public Member Functions | Static Public Attributes | List of all members
sparksee.Sparksee Class Reference

Sparksee class. More...

Public Member Functions

def restore_encrypted_backup (self, path, backup_file, config, key_in_hex, iv_in_hex)
 Restores a Database from an encrypted backup file. More...
 
def resize_in_memory_pool (self, new_capacity)
 Resizes the in memory pool allocator. More...
 
def create (self, path, alias, config)
 Creates a new Database instance. More...
 
def verify_checksums (self, path)
 Verifies the Checksum integrity of the given image file and it's recovery log file. More...
 
def remove_checksums (self, path)
 Converts a database WITH checksums into a database WITHOUT checksums. More...
 
def restore (self, path, backup_file)
 Restores a Database from a backup file. More...
 
def add_checksums (self, path)
 Converts a database WITHOUT checksums into a database WITH checksums. More...
 
def restore_encrypted_backup (self, path, backup_file, key_in_hex, iv_in_hex)
 Restores a Database from an encrypted backup file. More...
 
def decrypt (self, path)
 Converts a database WITH encryption into a database WITHOUT encryption. More...
 
def restore (self, path, backup_file, config)
 Restores a Database from a backup file. More...
 
def create (self, path, alias)
 Creates a new Database instance. More...
 
def open (self, path, read_only)
 Opens an existing Database instance. More...
 
def __init__ (self, config)
 Creates a new instance. More...
 
def open (self, path, read_only, config)
 Opens an existing Database instance. More...
 
def set_unrecoverable_error_callback (self, callback)
 Sets the unrecoverable error callback. More...
 
def encrypt (self, path)
 Converts a database WITHOUT encryption into an encrypted database. More...
 
def close (self)
 Closes the Sparksee instance. More...
 
def get_in_memory_pool_capacity (self)
 Gets the capacity of the in-memory pool (in Megabytes) More...
 

Static Public Attributes

float VERSION = 5.0
 Sparksee version.
 

Detailed Description

Sparksee class.

All Sparksee programs must have one single Sparksee instance to manage one or more Database instances.

This class allows for the creation of new Databases or open an existing one.

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

Constructor & Destructor Documentation

def sparksee.Sparksee.__init__ (   self,
  config 
)

Creates a new instance.

Parameters
config[in/out] Sparksee configuration (may be updated).

Member Function Documentation

def sparksee.Sparksee.add_checksums (   self,
  path 
)

Converts a database WITHOUT checksums into a database WITH checksums.

Any error found is logged. The database (and it's recovery log if present) does NOT have checksums. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the checksum could be added or false otherwise.
Exceptions
RuntimeErrornull
IOErrornull
def sparksee.Sparksee.close (   self)

Closes the Sparksee instance.

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

def sparksee.Sparksee.create (   self,
  path,
  alias,
  config 
)

Creates a new Database instance.

Parameters
path[in] Database storage file.
alias[in] Database alias name.
config[in] Use a specific configuration instead of the one in this Sparksee
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file cannot be created.

Referenced by sparksee.Sparksee.create().

def sparksee.Sparksee.create (   self,
  path,
  alias 
)

Creates a new Database instance.

Parameters
path[in] Database storage file.
alias[in] Database alias name.
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file cannot be created.

References sparksee.Sparksee.create().

def sparksee.Sparksee.decrypt (   self,
  path 
)

Converts a database WITH encryption into a database WITHOUT encryption.

Any error found is logged. The database (and it's recovery log if present) is encrypted. The current encryption had been configured using SparkseeConfig. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the database could be unencrypted. The errors are returned with an exception.
Exceptions
RuntimeErrornull
IOErrornull
def sparksee.Sparksee.encrypt (   self,
  path 
)

Converts a database WITHOUT encryption into an encrypted database.

Any error found is logged. The database (and it's recovery log if present) does is NOT encrypted. The encryption had already been configured using SparkseeConfig. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the database could be encrypted. The errors are returned with an exception.
Exceptions
RuntimeErrornull
IOErrornull
def sparksee.Sparksee.get_in_memory_pool_capacity (   self)

Gets the capacity of the in-memory pool (in Megabytes)

Returns
Returns the capacity of the in memory pool
def sparksee.Sparksee.open (   self,
  path,
  read_only 
)

Opens an existing Database instance.

Parameters
path[in] Database storage file.
read_only[in] If TRUE, open Database in read-only mode.
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file does not exist.

Referenced by sparksee.Sparksee.open().

def sparksee.Sparksee.open (   self,
  path,
  read_only,
  config 
)

Opens an existing Database instance.

The provided configuration will be used for all the database settings but not for the license, which must already be properly setup in this class.

Parameters
path[in] Database storage file.
read_only[in] If TRUE, open Database in read-only mode.
config[in] Use a specific configuration instead of the one in this Sparksee
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file does not exist.

References sparksee.Sparksee.open().

def sparksee.Sparksee.remove_checksums (   self,
  path 
)

Converts a database WITH checksums into a database WITHOUT checksums.

Any error found is logged. The database (and it's recovery log if present) have checksums. sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the database image file
Returns
Returns true if the checksum could be removed. The errors are returned with an exception.
Exceptions
RuntimeErrornull
IOErrornull
def sparksee.Sparksee.resize_in_memory_pool (   self,
  new_capacity 
)

Resizes the in memory pool allocator.

Parameters
new_capacityThe new capacity of the in memory pool allocator
Returns
Returns true if was successful
def sparksee.Sparksee.restore (   self,
  path,
  backup_file 
)

Restores a Database from a backup file.

See the Graph class Backup method.

Parameters
path[in] Database storage file.
backup_file[in] The Backup file to be restored.
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file cannot be created, or the exported data file does not exists.

Referenced by sparksee.Sparksee.restore().

def sparksee.Sparksee.restore (   self,
  path,
  backup_file,
  config 
)

Restores a Database from a backup file.

See the Graph class Backup method.

Parameters
path[in] Database storage file.
backup_file[in] The Backup file to be restored.
config[in] Use a specific configuration instead of the one in this Sparksee
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file cannot be created, or the exported data file does not exists.

References sparksee.Sparksee.restore().

def sparksee.Sparksee.restore_encrypted_backup (   self,
  path,
  backup_file,
  config,
  key_in_hex,
  iv_in_hex 
)

Restores a Database from an encrypted backup file.

See the Graph class EncryptedBackup method.

Parameters
path[in] Database storage file.
backup_file[in] The Backup file to be restored.
config[in] Use a specific configuration instead of the one in this Sparksee
key_in_hex[In] The AES encryption Key of the backup file as an hexadecimal string (8, 16 or 32 bytes).
iv_in_hex[In] The AES Initialization Vector of the backup file as an hexadecimal string (16 bytes).
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file cannot be created, or the exported data file does not exists.

Referenced by sparksee.Sparksee.restore_encrypted_backup().

def sparksee.Sparksee.restore_encrypted_backup (   self,
  path,
  backup_file,
  key_in_hex,
  iv_in_hex 
)

Restores a Database from an encrypted backup file.

See the Graph class EncryptedBackup method.

Parameters
path[in] Database storage file.
backup_file[in] The Backup file to be restored.
key_in_hex[In] The AES encryption Key of the backup file as an hexadecimal string (8, 16 or 32 bytes).
iv_in_hex[In] The AES Initialization Vector of the backup file as an hexadecimal string (16 bytes).
Returns
A Database instance.
Exceptions
RuntimeErrornull
IOErrorIf the given file cannot be created, or the exported data file does not exists.

References sparksee.Sparksee.restore_encrypted_backup().

def sparksee.Sparksee.set_unrecoverable_error_callback (   self,
  callback 
)

Sets the unrecoverable error callback.

Parameters
callbackThe unrecoverable error callback to set
def sparksee.Sparksee.verify_checksums (   self,
  path 
)

Verifies the Checksum integrity of the given image file and it's recovery log file.

The main database file checksums are always checked.

When the recovery log file exists, the recovery log file is also checked for checksum and format errors.

When the checksums of the main file or the recovery file are incorrect, the funcion returns false, in any other error it throws an exception.

Any error found is logged as a WARNING.

sparksee::gdb::FileNotFoundExceptionsparksee::gdb::Error

Parameters
pathThe path to the image file
Returns
Returns true if the checksum verification succeeded. Returns false if an invalid checksum was detected.
Exceptions
RuntimeErrornull
IOErrornull