C# Class DBreeze.Scheme

Inheritance: IDisposable
Show file Open project: hhblaze/DBreeze Class Usage Examples

Public Methods

Method Description
DeleteTable ( string userTableName ) : void

Deletes user table

Dispose ( ) : void
GetTablePathFromTableName ( string userTableName ) : string

Returns physical path to the table file, if table doesn't exists in the Scheme returns String.Empty

GetUserTableNamesStartingWith ( string mask ) : List

Returns List of user tables starting from specified mask. If mask is String.Empty returns all user tables

IfUserTableExists ( string userTableName ) : bool

Returns if user table exists

RenameTable ( string oldUserTableName, string newUserTableName ) : void

Renames user table, if it existed.

Safe, will make operation only when other threads stop to work with the oldTable

Scheme ( DBreezeEngine DBreezeEngine ) : System

Private Methods

Method Description
CheckAlternativeTableLocationsIntersections ( string userTableName, string &alternativePath ) : bool

Checks if in configuration was supplied alternative path for table location. Returns true if intersection was found. Alternative Path equals to String.Empty - locate in Memory

CloseTables ( ulong?>.Dictionary closeOpenTables ) : void

Called by Transaction, when it's time to be Disposed and close tables. Tables will be closed only in case of other threads don't use it.

DeleteAllReleatedTableFiles ( string fullTableFilePath ) : void

Used by GetTableFor Write, if table is newly created and we have such file name

GetPhysicalPathToTheUserTable ( string userTableName ) : string

ONLY FOR INTERNAL NEEDS, lock must be handeled by outer procedure. Users must use GetTablePathFromTableName. Transactions Journal after start will try to delete RollbackFiles of the finished transactions. For this it needs to know exact pathes. For now all tables stored in one folder. Later we will have extra config file which lets to reside some of tables in the other folders. This function is an access globalizer to physical file locations by userTableName. !!!!TRAnJRNL, WHEN RESTORES ROLLBACK, MUST REFER TO Scheme trie settings in the future, FOR NOW DEFAULT

GetTable ( string userTableName ) : LTrie

Returns table for READ, WRITE FUNC

GetUserTableNameAsByte ( string tableName ) : byte[]

Adds static prefix to all user table names, to make selection of tables for different purposes easier with StartsWith function

GetUserTableNameAsString ( string tableName ) : string
OpenSchema ( ) : void
ReadUserLastFileNumber ( ) : void
RenameTableInternal ( string oldUserTableName, string newUserTableName ) : bool

Renames user table, if it existed.

If there are threads which are working with this table, rename will not be finished and will return false

Method Details

DeleteTable() public method

Deletes user table
public DeleteTable ( string userTableName ) : void
userTableName string
return void

Dispose() public method

public Dispose ( ) : void
return void

GetTablePathFromTableName() public method

Returns physical path to the table file, if table doesn't exists in the Scheme returns String.Empty
public GetTablePathFromTableName ( string userTableName ) : string
userTableName string
return string

GetUserTableNamesStartingWith() public method

Returns List of user tables starting from specified mask. If mask is String.Empty returns all user tables
public GetUserTableNamesStartingWith ( string mask ) : List
mask string
return List

IfUserTableExists() public method

Returns if user table exists
public IfUserTableExists ( string userTableName ) : bool
userTableName string
return bool

RenameTable() public method

Renames user table, if it existed.

Safe, will make operation only when other threads stop to work with the oldTable

public RenameTable ( string oldUserTableName, string newUserTableName ) : void
oldUserTableName string
newUserTableName string
return void

Scheme() public method

public Scheme ( DBreezeEngine DBreezeEngine ) : System
DBreezeEngine DBreezeEngine
return System