diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
---|---|---|
committer | <> | 2015-03-17 16:26:24 +0000 |
commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /lang/csharp/src/HeapDatabase.cs | |
parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
download | berkeleydb-master.tar.gz |
Diffstat (limited to 'lang/csharp/src/HeapDatabase.cs')
-rw-r--r-- | lang/csharp/src/HeapDatabase.cs | 68 |
1 files changed, 56 insertions, 12 deletions
diff --git a/lang/csharp/src/HeapDatabase.cs b/lang/csharp/src/HeapDatabase.cs index 0b393842..054fe6f1 100644 --- a/lang/csharp/src/HeapDatabase.cs +++ b/lang/csharp/src/HeapDatabase.cs @@ -1,7 +1,7 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved. * */ using System; @@ -23,11 +23,17 @@ namespace BerkeleyDB { private void Config(HeapDatabaseConfig cfg) { base.Config(cfg); /* - * Database.Config calls set_flags, but that doesn't get the Heap + * Database.Config calls set_flags, but that does not get the Heap * specific flags. No harm in calling it again. */ db.set_flags(cfg.flags); + if (cfg.BlobDir != null && cfg.Env == null) + db.set_blob_dir(cfg.BlobDir); + + if (cfg.blobThresholdIsSet) + db.set_blob_threshold(cfg.BlobThreshold, 0); + if (cfg.maxSizeIsSet) db.set_heapsize(cfg.MaxSizeGBytes, cfg.MaxSizeBytes); if (cfg.regionszIsSet) @@ -47,13 +53,13 @@ namespace BerkeleyDB { /// </para> /// <para> /// If <see cref="DatabaseConfig.AutoCommit"/> is set, the operation - /// will be implicitly transaction protected. Note that transactionally - /// protected operations on a datbase object requires the object itself + /// is implicitly transaction protected. Transactionally + /// protected operations on a database object requires the object itself /// be transactionally protected during its open. /// </para> /// </remarks> /// <param name="Filename"> - /// The name of an underlying file that will be used to back the + /// The name of an underlying file used to back up the /// database. In-memory databases never intended to be preserved on disk /// may be created by setting this parameter to null. /// </param> @@ -76,15 +82,15 @@ namespace BerkeleyDB { /// </para> /// <para> /// If <paramref name="txn"/> is null, but - /// <see cref="DatabaseConfig.AutoCommit"/> is set, the operation will - /// be implicitly transaction protected. Note that transactionally - /// protected operations on a datbase object requires the object itself - /// be transactionally protected during its open. Also note that the + /// <see cref="DatabaseConfig.AutoCommit"/> is set, the operation + /// is implicitly transaction protected. Transactionally + /// protected operations on a database object requires the object itself + /// be transactionally protected during its open. The /// transaction must be committed before the object is closed. /// </para> /// </remarks> /// <param name="Filename"> - /// The name of an underlying file that will be used to back the + /// The name of an underlying file used to back up the /// database. In-memory databases never intended to be preserved on disk /// may be created by setting this parameter to null. /// </param> @@ -112,6 +118,44 @@ namespace BerkeleyDB { #region Properties /// <summary> + /// The path of the directory where blobs are stored. + /// </summary> + public string BlobDir { + get { + string dir; + db.get_blob_dir(out dir); + return dir; + } + } + + internal string BlobSubDir { + get { + string dir; + db.get_blob_sub_dir(out dir); + return dir; + } + } + + /// <summary> + /// The threshold value in bytes beyond which data items are stored as + /// blobs. + /// <para> + /// Any data item that is equal to or larger in size than the + /// threshold value is automatically stored as a blob. + /// </para> + /// <para> + /// A value of 0 indicates that blobs are not used by the database. + /// </para> + /// </summary> + public uint BlobThreshold { + get { + uint ret = 0; + db.get_blob_threshold(ref ret); + return ret; + } + } + + /// <summary> /// The gigabytes component of the maximum on-disk database file size. /// </summary> public uint MaxSizeGBytes { @@ -232,7 +276,7 @@ namespace BerkeleyDB { /// </param> /// <param name="isoDegree"> /// The level of isolation for database reads. - /// <see cref="Isolation.DEGREE_ONE"/> will be silently ignored for + /// <see cref="Isolation.DEGREE_ONE"/> is silently ignored for /// databases which did not specify /// <see cref="DatabaseConfig.ReadUncommitted"/>. /// </param> @@ -283,7 +327,7 @@ namespace BerkeleyDB { /// </param> /// <param name="isoDegree"> /// The level of isolation for database reads. - /// <see cref="Isolation.DEGREE_ONE"/> will be silently ignored for + /// <see cref="Isolation.DEGREE_ONE"/> is silently ignored for /// databases which did not specify /// <see cref="DatabaseConfig.ReadUncommitted"/>. /// </param> |