|
| | Sparksee (SparkseeConfig &config) |
| | Creates a new instance.
|
|
virtual | ~Sparksee () |
| | Destructor.
|
| Database * | Create (const std::wstring &path, const std::wstring &alias) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Creates a new Database instance.
|
| Database * | Create (const std::wstring &path, const std::wstring &alias, const SparkseeConfig &config) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Creates a new Database instance.
|
| Database * | Open (const std::wstring &path, bool_t readOnly) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Opens an existing Database instance.
|
| Database * | Open (const std::wstring &path, bool_t readOnly, const SparkseeConfig &config) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Opens an existing Database instance.
|
| Database * | Restore (const std::wstring &path, const std::wstring &backupFile) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Restores a Database from a backup file.
|
| Database * | Restore (const std::wstring &path, const std::wstring &backupFile, const SparkseeConfig &config) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Restores a Database from a backup file.
|
| Database * | RestoreEncryptedBackup (const std::wstring &path, const std::wstring &backupFile, const std::wstring &keyInHex, const std::wstring &ivInHex) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Restores a Database from an encrypted backup file.
|
| Database * | RestoreEncryptedBackup (const std::wstring &path, const std::wstring &backupFile, const SparkseeConfig &config, const std::wstring &keyInHex, const std::wstring &ivInHex) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Restores a Database from an encrypted backup file.
|
| bool_t | VerifyChecksums (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Verifies the Checksum integrity of the given image file and it's recovery log file.
|
| bool_t | AddChecksums (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Converts a database WITHOUT checksums into a database WITH checksums.
|
| bool_t | RemoveChecksums (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Converts a database WITH checksums into a database WITHOUT checksums.
|
| void | SetUnrecoverableErrorCallback (SPARKSEE_UNRECOVERABLE_ERR_CALLBACK callback) |
| | Sets the unrecoverable error callback.
|
| bool_t | Encrypt (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Converts a database WITHOUT encryption into an encrypted database.
|
| bool_t | Decrypt (const std::wstring &path) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Converts a database WITH encryption into a database WITHOUT encryption.
|
| void | ResizeInMemoryPool (int64_t newCapacity) throw (sparksee::gdb::SystemError) |
| | Resizes the in memory pool allocator.
|
| int64_t | GetInMemoryPoolCapacity () |
| | Gets the capacity of the in-memory pool (in Megabytes).
|
| void | RebuildDatabase (const std::wstring &path, const SparkseeConfig &config, const bool_t minimizeDisk) throw (sparksee::gdb::FileNotFoundException, sparksee::gdb::Error) |
| | Rebuild the database from scratch with the same data.
|
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
| void Sparksee::RebuildDatabase |
( |
const std::wstring & | path, |
|
|
const SparkseeConfig & | config, |
|
|
const bool_t | minimizeDisk ) |
| throw | ( | sparksee::gdb::FileNotFoundException, |
| | sparksee::gdb::Error ) | | | |
Rebuild the database from scratch with the same data.
It will create a new database on the same file with the same data but rebuilt from scratch, so the internal OIDs may change and the storage usage may be compacted.
It's the equivalent to extract a backup of the data and restore it. This operation can take a long time and the result file should be smaller than the original if there had been data removals or the data was not loaded in the most optimal order. But the file size could also end up being slightly bigger the the original in some cases (the data creation in the database was optimal and nothing had beed removed).
WARNING: If anything goes wrong while the database is being rebuilt you may lose the database. The data should not be lost, but it may require an additional process to recover it.
To avoid data loss, the next open after a failed rebuild operation will attempt to automatically recover the database by the fastest solution available (restoring the original file, finishing the almost completed rebuild or restoring a backup).
The source database is also kept until the rebuilt database is available to reduce the recovery time after a rebuild failure and avoid data loss risks. But if reducing the temporary disk usage is more important, you can use the minimizeDisk to delete it as soon as possible instead.
The final rebuilt database size will be the same whether you use the minimizeDisk argument or not.
- Parameters
-
| path | [In] The Sparksee database to rebuild. |
| config | [in] Use a specific configuration instead of the one in this Sparksee. |
| minimizeDisk | [in] Use less temporary disk space. |
References Sparksee().
| bool_t Sparksee::VerifyChecksums |
( |
const std::wstring & | path | ) |
|
| throw | ( | sparksee::gdb::FileNotFoundException, |
| | sparksee::gdb::Error ) | | | |
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.
- Parameters
-
| path | The path to the image file |
- Returns
- Returns true if the checksum verification succeeded. Returns false if an invalid checksum was detected.
- Exceptions
-
| sparksee::gdb::FileNotFoundException | |
| sparksee::gdb::Error | |