C# Class BerkeleyDB.HashDatabaseConfig

A class representing configuration parameters for HashDatabase
Inheritance: BerkeleyDB.DatabaseConfig
Datei anzeigen Open project: yasuhirokimura/db18 Class Usage Examples

Public Properties

Property Type Description
BlobDir string
Creation CreatePolicy
DuplicateCompare EntryComparisonDelegate
Duplicates DuplicatesPolicy
ExternalFileDir string
HashComparison EntryComparisonDelegate
HashFunction HashFunctionDelegate

Private Properties

Property Type Description
SetPartition bool

Public Methods

Method Description
HashDatabaseConfig ( ) : System

Instantiate a new HashDatabaseConfig object

SetPartitionByCallback ( uint parts, PartitionDelegate partFunc ) : bool

Enable database partitioning using the specified number of partitions and partition function. Return true if the specified number of partitions are successfully enabled; otherwise return false. The number of partitions to create The name of partitioning function

SetPartitionByKeys ( Array keys ) : bool

Enable database partitioning using the specified partition keys. Return true if partitioning is successfully enabled; otherwise return false. An array of DatabaseEntry where each array entry defines the range of key values to be stored in each partition

Private Methods

Method Description
SetPartition ( uint parts, Array partKeys, PartitionDelegate partFunc ) : bool

Method Details

HashDatabaseConfig() public method

Instantiate a new HashDatabaseConfig object
public HashDatabaseConfig ( ) : System
return System

SetPartitionByCallback() public method

Enable database partitioning using the specified number of partitions and partition function. Return true if the specified number of partitions are successfully enabled; otherwise return false. The number of partitions to create The name of partitioning function
public SetPartitionByCallback ( uint parts, PartitionDelegate partFunc ) : bool
parts uint
partFunc PartitionDelegate
return bool

SetPartitionByKeys() public method

Enable database partitioning using the specified partition keys. Return true if partitioning is successfully enabled; otherwise return false. An array of DatabaseEntry where each array entry defines the range of key values to be stored in each partition
public SetPartitionByKeys ( Array keys ) : bool
keys Array
return bool

Property Details

BlobDir public_oe property

Deprecated. Replaced by ExternalFileDir.
public string BlobDir
return string

Creation public_oe property

The policy for how to handle database creation.
If the database does not already exist and CreatePolicy.NEVER is set, HashDatabase.Open fails.
public CreatePolicy Creation
return CreatePolicy

DuplicateCompare public_oe property

The duplicate data item comparison function.

The comparison function is called whenever it is necessary to compare a data item specified by the application with a data item currently stored in the database. Setting DuplicateCompare implies setting Duplicates to DuplicatesPolicy.SORTED.

If no comparison function is specified, the data items are compared lexically, with shorter data items collating before longer data items.

If the database already exists when HashDatabase.Open is called, the delegate must be the same as that historically used to create the database or corruption can occur.

public EntryComparisonDelegate DuplicateCompare
return EntryComparisonDelegate

Duplicates public_oe property

Policy for duplicate data items in the database. Allows a key/data pair to be inserted into the database even if the key already exists.

The ordering of duplicates in the database for DuplicatesPolicy.UNSORTED is determined by the order of insertion, unless the ordering is otherwise specified by use of a cursor operation or a duplicate sort function. The ordering of duplicates in the database for DuplicatesPolicy.SORTED is determined by the duplicate comparison function. If the application does not specify a comparison function using DuplicateCompare, a default lexical comparison is be used.

DuplicatesPolicy.SORTED is preferred to DuplicatesPolicy.UNSORTED for performance reasons. DuplicatesPolicy.UNSORTED should only be used by applications wanting to order duplicate data items manually.

If the database already exists, the value of Duplicates must be the same as the existing database or an error is returned.

public DuplicatesPolicy Duplicates
return DuplicatesPolicy

ExternalFileDir public_oe property

The path of the directory where external files are stored.

If the database is opened within DatabaseEnvironment, this path setting is ignored during HashDatabase.Open. Use HashDatabase.ExternalFileDir to identify the current storage location of external files after opening the database.

public string ExternalFileDir
return string

HashComparison public_oe property

The Hash key comparison function.

The comparison function is called whenever it is necessary to compare a key specified by the application with a key currently stored in the tree.

If no comparison function is specified, the keys are compared lexically, with shorter keys collating before longer keys.

If the database already exists, the comparison function must be the same as that historically used to create the database or corruption can occur.

public EntryComparisonDelegate HashComparison
return EntryComparisonDelegate

HashFunction public_oe property

A user-defined hash function; if no hash function is specified, a default hash function is used.

Because no hash function performs equally well on all possible data, the user may find that the built-in hash function performs poorly with a particular data set.

If the database already exists, HashFunction must be the same as that historically used to create the database or corruption can occur.

public HashFunctionDelegate HashFunction
return HashFunctionDelegate