DeveelDB
20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
|
Classes | |
class | StoreArea |
An IArea that is backed by a StoreBase. More... | |
Public Member Functions | |
bool | Open () |
void | Close () |
void | Dispose () |
IArea | CreateArea (long size) |
Allocates a block of memory in the store of the specified size and returns an IArea object that can be used to initialize the contents of the area. More... | |
void | DeleteArea (long id) |
Deletes an area that was previously allocated by the CreateArea method by the area id. More... | |
IArea | GetArea (long id, bool readOnly) |
Returns an object that allows for the contents of an area (represented by the id parameter) to be Read. More... | |
abstract void | Lock () |
This method is called before the start of a sequence of Write commands between consistant states of some data structure represented by the store. More... | |
abstract void | Unlock () |
This method is called after the end of a sequence of Write commands between consistant states of some data structure represented by the store. More... | |
IEnumerable< long > | GetAllAreas () |
Returns a complete list of pointers to all areas in the Store as long objects sorted from lowest pointer to highest. More... | |
Protected Member Functions | |
StoreBase (bool isReadOnly) | |
void | ReadAreaHeader (long offset, long[] header) |
void | SplitArea (long offset, long newBoundary) |
abstract void | SetDataAreaSize (long length) |
virtual void | Dispose (bool disposing) |
abstract void | OpenStore (bool readOnly) |
abstract void | CloseStore () |
int | ReadByte (long offset) |
abstract int | Read (long offset, byte[] buffer, int index, int length) |
void | Write (long offset, byte value) |
abstract void | Write (long offset, byte[] buffer, int index, int length) |
Package Functions | |
IEnumerable< long > | FindAllocatedAreasNotIn (List< long > usedAreas) |
Properties | |
long | WildernessOffset [get, set] |
bool | IsReadOnly [get, private set] |
abstract long | DataAreaEndOffset [get] |
bool | ClosedClean [get, private set] |
Properties inherited from Deveel.Data.Store.IStore | |
bool | ClosedClean [get] |
Indicates if the store was closed cleanly last time was accessed. More... | |
Private Member Functions | |
~StoreBase () | |
void | CheckOffset (long offset) |
void | ReadBins () |
void | WriteAllBins () |
void | WriteBinIndex (int index) |
void | AddToBinChain (long pointer, long size) |
void | RemoveFromBinChain (long offset, long size) |
void | Free (long pointer) |
long | GetPreviousAreaHeader (long offset, long[] header) |
long | GetNextAreaHeader (long offset, long[] header) |
void | ReboundArea (long offset, long[] header, bool writeHeaders) |
void | CoalesceArea (long offset, long size) |
void | CropArea (long offset, long allocatedSize) |
long | Alloc (long size) |
long | ExpandDataArea (long minSize) |
void | Init () |
Static Private Member Functions | |
static int | MinimumBinSizeIndex (long size) |
static bool | IsValidBoundarySize (long size) |
Private Attributes | |
long[] | freeBinList |
long | totalAllocatedSpace |
readonly byte[] | binArea = new byte[128 * 8] |
const long | ActiveFlag = Int64.MaxValue |
const long | DeletedFlag = Int64.MinValue |
const long | FixedAreaOffset = 128 |
const long | DataAreaOffset = 256 + 1024 + 32 |
const long | BinAreaOffset = 256 |
const int | Magic = 0x0AEAE91 |
readonly byte[] | headerBuf = new byte[16] |
bool | disposed |
Static Private Attributes | |
static readonly int[] | BinSizes |
static readonly int | BinSizeEntries = BinSizes.Length |
static readonly int | MaxBinSize = BinSizes[BinSizeEntries - 1] |
Definition at line 25 of file StoreBase.cs.
|
inlineprotected |
Definition at line 61 of file StoreBase.cs.
|
inlineprivate |
Definition at line 72 of file StoreBase.cs.
|
inlineprivate |
Definition at line 125 of file StoreBase.cs.
|
inlineprivate |
Definition at line 408 of file StoreBase.cs.
|
inlineprivate |
Definition at line 82 of file StoreBase.cs.
|
inline |
Definition at line 728 of file StoreBase.cs.
|
protectedpure virtual |
Implemented in Deveel.Data.Store.SingleFileStore.
|
inlineprivate |
Definition at line 361 of file StoreBase.cs.
|
inline |
Allocates a block of memory in the store of the specified size and returns an IArea object that can be used to initialize the contents of the area.
size | The amount of memory to allocate. |
Note that an area in the store is undefined until the IArea.Flush method is called in IArea.
System.IO.IOException | If not enough space available to create the area or the store is Read-only. |
Implements Deveel.Data.Store.IStore.
Definition at line 755 of file StoreBase.cs.
|
inlineprivate |
Definition at line 372 of file StoreBase.cs.
|
inline |
Deletes an area that was previously allocated by the CreateArea method by the area id.
id | The identifier of the area to delete. |
Once an area is deleted the resources may be reclaimed. The behaviour of this method is undefined if the id doesn't represent a valid area.
IOException | If the id is invalid or the area can not otherwise by deleted. |
Implements Deveel.Data.Store.IStore.
Definition at line 762 of file StoreBase.cs.
|
inline |
Definition at line 738 of file StoreBase.cs.
|
inlineprotectedvirtual |
|
inlineprivate |
Definition at line 564 of file StoreBase.cs.
|
inlinepackage |
Definition at line 806 of file StoreBase.cs.
|
inlineprivate |
Definition at line 245 of file StoreBase.cs.
|
inline |
Returns a complete list of pointers to all areas in the Store as long objects sorted from lowest pointer to highest.
This should be used for diagnostics only because it may be difficult for this to be generated with some implementations. It is useful in a repair tool to determine if a pointer is valid or not.
Implements Deveel.Data.Store.IStore.
Definition at line 785 of file StoreBase.cs.
|
inline |
Returns an object that allows for the contents of an area (represented by the id parameter) to be Read.
id | The identifier of the area to Read, or -1 for a 64 byte fixed area in the store. |
readOnly | Indicates if the returned area must be read-only. |
The behaviour of this method is undefined if the id doesn't represent a valid area.
When id is -1 then a fixed area (64 bytes in size) in the store is returned. The fixed area can be used to store important static information.
IOException | If the id is invalid or the area can not otherwise be accessed. |
Implements Deveel.Data.Store.IStore.
Definition at line 768 of file StoreBase.cs.
|
inlineprivate |
Definition at line 325 of file StoreBase.cs.
|
inlineprivate |
Definition at line 308 of file StoreBase.cs.
|
inlineprivate |
Definition at line 615 of file StoreBase.cs.
|
inlinestaticprivate |
Definition at line 609 of file StoreBase.cs.
|
pure virtual |
This method is called before the start of a sequence of Write commands between consistant states of some data structure represented by the store.
This Lock mechanism is intended to inform the store when it is not safe to checkpoint the data in a log, ensuring that no partial updates are committed to a transaction log and the data can be restored in a consistant manner.
If the store does not implement a check point log or is otherwise not interested in consistant states of the data, then it is not necessary for this method to do anything.
This method prevents a check point from happening during some sequence of operations. This method should not Lock unless a check point is in progress. This method does not prevent concurrent writes to the store.
Implements Deveel.Data.Store.IStore.
Implemented in Deveel.Data.Store.SingleFileStore.
|
inlinestaticprivate |
Definition at line 89 of file StoreBase.cs.
|
inline |
Definition at line 653 of file StoreBase.cs.
|
protectedpure virtual |
Implemented in Deveel.Data.Store.SingleFileStore.
|
protectedpure virtual |
Implemented in Deveel.Data.Store.SingleFileStore.
|
inlineprotected |
Definition at line 342 of file StoreBase.cs.
|
inlineprivate |
Definition at line 97 of file StoreBase.cs.
|
inlineprotected |
Definition at line 865 of file StoreBase.cs.
|
inlineprivate |
Definition at line 350 of file StoreBase.cs.
|
inlineprivate |
Definition at line 205 of file StoreBase.cs.
|
protectedpure virtual |
Implemented in Deveel.Data.Store.SingleFileStore.
|
inlineprotected |
Definition at line 585 of file StoreBase.cs.
|
pure virtual |
This method is called after the end of a sequence of Write commands between consistant states of some data structure represented by the store.
See the Lock method for a further description of the operation of this locking mechanism.
Implements Deveel.Data.Store.IStore.
Implemented in Deveel.Data.Store.SingleFileStore.
|
inlineprotected |
Definition at line 876 of file StoreBase.cs.
|
protectedpure virtual |
Implemented in Deveel.Data.Store.SingleFileStore.
|
inlineprivate |
Definition at line 108 of file StoreBase.cs.
|
inlineprivate |
Definition at line 118 of file StoreBase.cs.
|
private |
Definition at line 49 of file StoreBase.cs.
|
private |
Definition at line 29 of file StoreBase.cs.
|
private |
Definition at line 57 of file StoreBase.cs.
|
staticprivate |
Definition at line 46 of file StoreBase.cs.
|
staticprivate |
Definition at line 31 of file StoreBase.cs.
|
private |
Definition at line 55 of file StoreBase.cs.
|
private |
Definition at line 50 of file StoreBase.cs.
|
private |
Definition at line 743 of file StoreBase.cs.
|
private |
Definition at line 52 of file StoreBase.cs.
|
private |
Definition at line 26 of file StoreBase.cs.
|
private |
Definition at line 348 of file StoreBase.cs.
|
private |
Definition at line 59 of file StoreBase.cs.
|
staticprivate |
Definition at line 47 of file StoreBase.cs.
|
private |
Definition at line 27 of file StoreBase.cs.
|
getprivate set |
Definition at line 783 of file StoreBase.cs.
|
getprotected |
Definition at line 80 of file StoreBase.cs.
|
getprivate set |
Definition at line 78 of file StoreBase.cs.
|
getsetprivate |
Definition at line 76 of file StoreBase.cs.