C# Класс LightningDB.LightningEnvironment

LMDB Environment.
Наследование: IClosingEventSource, IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BeginTransaction ( ) : LightningTransaction

Create a transaction for use with the environment. The transaction handle may be discarded using Abort() or Commit(). Note: Transactions may not span threads; a transaction must only be used by a single thread. Also, a thread may only have a single transaction. Cursors may not span transactions; each cursor must be opened and closed within a single transaction.

BeginTransaction ( LightningTransaction parent, TransactionBeginFlags beginFlags ) : LightningTransaction

Create a transaction for use with the environment. The transaction handle may be discarded using Abort() or Commit(). Note: Transactions may not span threads; a transaction must only be used by a single thread. Also, a thread may only have a single transaction. Cursors may not span transactions; each cursor must be opened and closed within a single transaction.

BeginTransaction ( TransactionBeginFlags beginFlags ) : LightningTransaction

Create a transaction for use with the environment. The transaction handle may be discarded usingAbort() or Commit(). Note: Transactions may not span threads; a transaction must only be used by a single thread. Also, a thread may only have a single transaction. Cursors may not span transactions; each cursor must be opened and closed within a single transaction.

CopyTo ( string path, bool compact = false ) : void

Copy an MDB environment to the specified path. This function may be used to make a backup of an existing environment.

Dispose ( ) : void

Dispose the environment and release the memory map. Only a single thread may call this function. All transactions, databases, and cursors must already be closed before calling this function. Attempts to use any such handles after calling this function will cause a SIGSEGV. The environment handle will be freed and must not be used again after this call.

Flush ( bool force ) : void

Flush the data buffers to disk. Data is always written to disk when LightningTransaction.Commit is called, but the operating system may keep it buffered. MDB always flushes the OS buffers upon commit as well, unless the environment was opened with EnvironmentOpenFlags.NoSync or in part EnvironmentOpenFlags.NoMetaSync.

Handle ( ) : IntPtr
LightningEnvironment ( string path, LightningDB.EnvironmentConfiguration configuration = null ) : System

Creates a new instance of LightningEnvironment.

Open ( EnvironmentOpenFlags openFlags = EnvironmentOpenFlags.None, UnixAccessMode accessMode = UnixAccessMode.Default ) : void

Open the environment.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Disposes the environment and deallocates all resources associated with it.

Приватные методы

Метод Описание
EnsureOpened ( ) : void

Описание методов

BeginTransaction() публичный Метод

Create a transaction for use with the environment. The transaction handle may be discarded using Abort() or Commit(). Note: Transactions may not span threads; a transaction must only be used by a single thread. Also, a thread may only have a single transaction. Cursors may not span transactions; each cursor must be opened and closed within a single transaction.
public BeginTransaction ( ) : LightningTransaction
Результат LightningTransaction

BeginTransaction() публичный Метод

Create a transaction for use with the environment. The transaction handle may be discarded using Abort() or Commit(). Note: Transactions may not span threads; a transaction must only be used by a single thread. Also, a thread may only have a single transaction. Cursors may not span transactions; each cursor must be opened and closed within a single transaction.
public BeginTransaction ( LightningTransaction parent, TransactionBeginFlags beginFlags ) : LightningTransaction
parent LightningTransaction /// If this parameter is non-NULL, the new transaction will be a nested transaction, with the transaction indicated by parent as its parent. /// Transactions may be nested to any level. /// A parent transaction may not issue any other operations besides BeginTransaction, Abort, or Commit while it has active child transactions. ///
beginFlags TransactionBeginFlags /// Special options for this transaction. ///
Результат LightningTransaction

BeginTransaction() публичный Метод

Create a transaction for use with the environment. The transaction handle may be discarded usingAbort() or Commit(). Note: Transactions may not span threads; a transaction must only be used by a single thread. Also, a thread may only have a single transaction. Cursors may not span transactions; each cursor must be opened and closed within a single transaction.
public BeginTransaction ( TransactionBeginFlags beginFlags ) : LightningTransaction
beginFlags TransactionBeginFlags /// Special options for this transaction. ///
Результат LightningTransaction

CopyTo() публичный Метод

Copy an MDB environment to the specified path. This function may be used to make a backup of an existing environment.
public CopyTo ( string path, bool compact = false ) : void
path string The directory in which the copy will reside. This directory must already exist and be writable but must otherwise be empty.
compact bool Omit empty pages when copying.
Результат void

Dispose() публичный Метод

Dispose the environment and release the memory map. Only a single thread may call this function. All transactions, databases, and cursors must already be closed before calling this function. Attempts to use any such handles after calling this function will cause a SIGSEGV. The environment handle will be freed and must not be used again after this call.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Disposes the environment and deallocates all resources associated with it.
protected Dispose ( bool disposing ) : void
disposing bool True if called from Dispose.
Результат void

Flush() публичный Метод

Flush the data buffers to disk. Data is always written to disk when LightningTransaction.Commit is called, but the operating system may keep it buffered. MDB always flushes the OS buffers upon commit as well, unless the environment was opened with EnvironmentOpenFlags.NoSync or in part EnvironmentOpenFlags.NoMetaSync.
public Flush ( bool force ) : void
force bool If true, force a synchronous flush. Otherwise if the environment has the EnvironmentOpenFlags.NoSync flag set the flushes will be omitted, and with MDB_MAPASYNC they will be asynchronous.
Результат void

Handle() публичный Метод

public Handle ( ) : IntPtr
Результат System.IntPtr

LightningEnvironment() публичный Метод

Creates a new instance of LightningEnvironment.
public LightningEnvironment ( string path, LightningDB.EnvironmentConfiguration configuration = null ) : System
path string Directory for storing database files.
configuration LightningDB.EnvironmentConfiguration Configuration for the environment.
Результат System

Open() публичный Метод

Open the environment.
public Open ( EnvironmentOpenFlags openFlags = EnvironmentOpenFlags.None, UnixAccessMode accessMode = UnixAccessMode.Default ) : void
openFlags EnvironmentOpenFlags
accessMode UnixAccessMode
Результат void