本文整理汇总了C#中BerkeleyDB.DatabaseEnvironmentConfig类的典型用法代码示例。如果您正苦于以下问题:C# DatabaseEnvironmentConfig类的具体用法?C# DatabaseEnvironmentConfig怎么用?C# DatabaseEnvironmentConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseEnvironmentConfig类属于BerkeleyDB命名空间,在下文中一共展示了DatabaseEnvironmentConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetCursorWithExplicitTxn
public void GetCursorWithExplicitTxn(string home,
string dbFile, bool ifConfig)
{
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseTxns = true;
envConfig.UseMPool = true;
DatabaseEnvironment env = DatabaseEnvironment.Open(
home, envConfig);
Transaction openTxn = env.BeginTransaction();
RecnoDatabaseConfig dbConfig =
new RecnoDatabaseConfig();
dbConfig.Creation = CreatePolicy.IF_NEEDED;
dbConfig.Env = env;
RecnoDatabase db = RecnoDatabase.Open(dbFile,
dbConfig, openTxn);
openTxn.Commit();
Transaction cursorTxn = env.BeginTransaction();
RecnoCursor cursor;
if (ifConfig == false)
cursor = db.Cursor(cursorTxn);
else
cursor = db.Cursor(new CursorConfig(), cursorTxn);
cursor.Close();
cursorTxn.Commit();
db.Close();
env.Close();
}
开发者ID:gildafnai82,项目名称:craq,代码行数:31,代码来源:RecnoCursorTest.cs
示例2: GetCursorInBtreeDBInCDS
// Get a cursor in CDS.
public static void GetCursorInBtreeDBInCDS(
string home, string name,
CursorConfig cursorConfig,
out DatabaseEnvironment env, out BTreeDatabase db,
out BTreeCursor cursor)
{
string dbFileName = name + ".db";
// Open an environment.
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseCDB = true;
envConfig.UseMPool = true;
env = DatabaseEnvironment.Open(home, envConfig);
/*
* Open an btree database. The underlying database
* should be opened with ReadUncommitted if the
* cursor's isolation degree will be set to be 1.
*/
BTreeDatabaseConfig dbConfig = new BTreeDatabaseConfig();
dbConfig.Creation = CreatePolicy.IF_NEEDED;
dbConfig.Env = env;
if (cursorConfig.IsolationDegree == Isolation.DEGREE_ONE)
dbConfig.ReadUncommitted = true;
db = BTreeDatabase.Open(dbFileName, dbConfig);
// Get a cursor in the transaction.
cursor = db.Cursor(cursorConfig);
}
开发者ID:kanbang,项目名称:Colt,代码行数:34,代码来源:CursorTest.cs
示例3: SetUpEnvWithTxnAndLocking
public static void SetUpEnvWithTxnAndLocking(string envHome,
out DatabaseEnvironment env, out Transaction txn,
uint maxLock, uint maxLocker, uint maxObject, uint partition)
{
// Configure env and locking subsystem.
LockingConfig lkConfig = new LockingConfig();
/*
* If the maximum number of locks/lockers/objects
* is given, then the LockingConfig is set. Unless,
* it is not set to any value.
*/
if (maxLock != 0)
lkConfig.MaxLocks = maxLock;
if (maxLocker != 0)
lkConfig.MaxLockers = maxLocker;
if (maxObject != 0)
lkConfig.MaxObjects = maxObject;
if (partition != 0)
lkConfig.Partitions = partition;
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseTxns = true;
envConfig.UseMPool = true;
envConfig.LockSystemCfg = lkConfig;
envConfig.UseLocking = true;
envConfig.NoLocking = false;
env = DatabaseEnvironment.Open(envHome, envConfig);
txn = env.BeginTransaction();
}
开发者ID:jamiekeefer,项目名称:gldcoin,代码行数:32,代码来源:TransactionTest.cs
示例4: Logging
/*
* Open environment, database and write data into database.
* Generated log files are put under testHome.
*/
public void Logging(string home, string dbName,
out DatabaseEnvironment env, out RecnoDatabase recnoDB)
{
string dbFileName = dbName + ".db";
Configuration.ClearDir(home);
// Open environment with logging subsystem.
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseLogging = true;
envConfig.LogSystemCfg = new LogConfig();
envConfig.LogSystemCfg.FileMode = 755;
envConfig.LogSystemCfg.ZeroOnCreate = true;
envConfig.UseMPool = true;
env = DatabaseEnvironment.Open(home, envConfig);
/*
* Open recno database, write 100000 records into
* the database and close it.
*/
RecnoDatabaseConfig recnoConfig =
new RecnoDatabaseConfig();
recnoConfig.Creation = CreatePolicy.IF_NEEDED;
recnoConfig.Env = env;
// The db needs mpool to open.
recnoConfig.NoMMap = false;
recnoDB = RecnoDatabase.Open(dbFileName,
recnoConfig);
for (int i = 0; i < 1000; i++)
recnoDB.Append(new DatabaseEntry(
ASCIIEncoding.ASCII.GetBytes("key")));
}
开发者ID:simonzhangsm,项目名称:h-store,代码行数:38,代码来源:LogCursorTest.cs
示例5: EnvConfigCase1
public void EnvConfigCase1(DatabaseEnvironmentConfig cfg)
{
cfg.Create = true;
cfg.UseTxns = true;
cfg.UseMPool = true;
cfg.UseLogging = true;
}
开发者ID:bohrasd,项目名称:windowsrtdev,代码行数:7,代码来源:HeapDatabaseTest.cs
示例6: LockingEnvSetUp
public static void LockingEnvSetUp(string testHome,
string testName, out DatabaseEnvironment env,
uint maxLock, uint maxLocker, uint maxObject,
uint partition)
{
// Configure env and locking subsystem.
LockingConfig lkConfig = new LockingConfig();
/*
* If the maximum number of locks/lockers/objects
* is given, then the LockingConfig is set. Unless,
* it is not set to any value.
*/
if (maxLock != 0)
lkConfig.MaxLocks = maxLock;
if (maxLocker != 0)
lkConfig.MaxLockers = maxLocker;
if (maxObject != 0)
lkConfig.MaxObjects = maxObject;
if (partition != 0)
lkConfig.Partitions = partition;
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.LockSystemCfg = lkConfig;
envConfig.UseLocking = true;
envConfig.ErrorPrefix = testName;
env = DatabaseEnvironment.Open(testHome, envConfig);
}
开发者ID:mania25,项目名称:diy-project,代码行数:30,代码来源:LockTest.cs
示例7: SetUpEnv
/*
* Set up environment.
*/
public static int SetUpEnv(string home, string data_dir)
{
DatabaseEnvironment env;
DatabaseEnvironmentConfig envConfig;
/* Configure an environment. */
envConfig = new DatabaseEnvironmentConfig();
envConfig.MPoolSystemCfg = new MPoolConfig();
envConfig.MPoolSystemCfg.CacheSize = new CacheInfo(
0, 64 * 1024, 1);
envConfig.Create = true;
envConfig.DataDirs.Add(data_dir);
envConfig.CreationDir = data_dir;
envConfig.ErrorPrefix = progName;
envConfig.UseLogging = true;
envConfig.UseLocking = true;
envConfig.UseMPool = true;
envConfig.UseTxns = true;
/* Create and open the environment. */
try {
env = DatabaseEnvironment.Open(home, envConfig);
} catch (Exception e) {
Console.WriteLine("{0}", e.Message);
return EXIT_FAILURE;
}
Console.ReadLine();
env.Close();
return EXIT_SUCCESS;
}
开发者ID:simonzhangsm,项目名称:h-store,代码行数:34,代码来源:excs_env.cs
示例8: GetCursorWithImplicitTxn
public void GetCursorWithImplicitTxn(string home,
string dbFile, bool ifConfig)
{
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseCDB = true;
envConfig.UseMPool = true;
DatabaseEnvironment env = DatabaseEnvironment.Open(
home, envConfig);
RecnoDatabaseConfig dbConfig =
new RecnoDatabaseConfig();
dbConfig.Creation = CreatePolicy.IF_NEEDED;
dbConfig.Env = env;
RecnoDatabase db = RecnoDatabase.Open(dbFile,
dbConfig);
RecnoCursor cursor;
if (ifConfig == false)
cursor = db.Cursor();
else
cursor = db.Cursor(new CursorConfig());
cursor.Close();
db.Close();
env.Close();
}
开发者ID:gildafnai82,项目名称:craq,代码行数:28,代码来源:RecnoCursorTest.cs
示例9: Open
public static RepQuoteEnvironment Open(string home, DatabaseEnvironmentConfig cfg)
{
RepQuoteEnvironment dbEnv = new RepQuoteEnvironment();
dbEnv.env = DatabaseEnvironment.Open(home, cfg);
dbEnv._appFinished = false;
dbEnv._inClientSync = false;
dbEnv._isMaster = false;
return dbEnv;
}
开发者ID:kanbang,项目名称:Colt,代码行数:9,代码来源:RepQuoteEnvironment.cs
示例10: SetUpEnv
public DatabaseEnvironment SetUpEnv(String home, uint priority, uint port, bool isMaster)
{
try {
Configuration.ClearDir(home);
} catch (Exception e) {
Console.WriteLine(e.Message);
throw new TestException("Please clean the directory");
}
/* Configure and open environment with replication
* application.
*/
DatabaseEnvironmentConfig cfg =
new DatabaseEnvironmentConfig();
cfg.UseReplication = true;
cfg.MPoolSystemCfg = new MPoolConfig();
cfg.MPoolSystemCfg.CacheSize =
new CacheInfo(0, 20485760, 1);
cfg.UseLocking = true;
cfg.UseTxns = true;
cfg.UseMPool = true;
cfg.Create = true;
cfg.UseLogging = true;
cfg.RunRecovery = true;
cfg.TxnNoSync = true;
cfg.FreeThreaded = true;
cfg.RepSystemCfg = new ReplicationConfig();
DbSiteConfig dbSiteConfig = new DbSiteConfig();
dbSiteConfig.Host = ip;
dbSiteConfig.Port = port;
dbSiteConfig.LocalSite = true;
cfg.RepSystemCfg.RepmgrSitesConfig.Add(dbSiteConfig);
cfg.RepSystemCfg.Priority = priority;
if (!isMaster) {
DbSiteConfig dbSiteConfig1 = new DbSiteConfig();
dbSiteConfig1.Host = ip;
dbSiteConfig1.Port = masterPort;
dbSiteConfig1.Helper = true;
cfg.RepSystemCfg.RepmgrSitesConfig.Add(dbSiteConfig1);
}
cfg.RepSystemCfg.BulkTransfer = false;
cfg.RepSystemCfg.AckTimeout = 5000;
cfg.RepSystemCfg.RepMgrAckPolicy =
AckPolicy.ALL_PEERS;
DatabaseEnvironment env = DatabaseEnvironment.Open(
home, cfg);
return env;
}
开发者ID:bohrasd,项目名称:windowsrtdev,代码行数:52,代码来源:TransactionCommitTokenTest.cs
示例11: GetSecondaryCursurWithTxn
public void GetSecondaryCursurWithTxn(string home,
string name, bool ifCfg)
{
string dbFileName = name + ".db";
SecondaryCursor cursor;
// Open env.
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseTxns = true;
envConfig.UseMPool = true;
DatabaseEnvironment env = DatabaseEnvironment.Open(home,
envConfig);
// Open primary/secondary database.
Transaction txn = env.BeginTransaction();
BTreeDatabaseConfig dbConfig = new BTreeDatabaseConfig();
dbConfig.Creation = CreatePolicy.IF_NEEDED;
dbConfig.Env = env;
BTreeDatabase db = BTreeDatabase.Open(dbFileName,
dbConfig, txn);
SecondaryBTreeDatabaseConfig secDBConfig = new
SecondaryBTreeDatabaseConfig(db,
new SecondaryKeyGenDelegate(SecondaryKeyGen));
secDBConfig.Env = env;
SecondaryBTreeDatabase secDB =
SecondaryBTreeDatabase.Open(dbFileName,
secDBConfig, txn);
for (int i = 0; i < 10; i++)
db.Put(new DatabaseEntry(BitConverter.GetBytes(i)),
new DatabaseEntry(BitConverter.GetBytes((int)i)), txn);
// Create secondary cursor.
if (ifCfg == false)
secDB.SecondaryCursor(txn);
else if (ifCfg == true)
{
CursorConfig cursorConfig = new CursorConfig();
cursorConfig.WriteCursor = false;
cursor = secDB.SecondaryCursor(cursorConfig, txn);
cursor.Close();
}
secDB.Close();
db.Close();
txn.Commit();
env.Close();
}
开发者ID:xiaogao0371,项目名称:dockerfile,代码行数:51,代码来源:SecondaryDatabaseTest.cs
示例12: DBInit
/*
* Create and open environment and database.
*/
public static int DBInit(out DatabaseEnvironment env,
string home, string progName, uint maxLock,
uint doUnLink)
{
DatabaseEnvironmentConfig envConfig;
LockingConfig lkConfig;
/* Configure locking subsystem. */
lkConfig = new LockingConfig();
lkConfig.MaxLocks = maxLock;
/* Configure environment. */
envConfig = new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.ErrorPrefix = progName;
envConfig.LockSystemCfg = lkConfig;
envConfig.UseLocking = true;
/*
* Optionally remove the environment region and
* open the environment.
*/
try {
if (doUnLink == 1)
DatabaseEnvironment.Remove(home, true);
env = DatabaseEnvironment.Open(home, envConfig);
} catch (Exception e) {
Console.WriteLine("{0}:{1}\n{2}",
e.Source, e.Message, e.StackTrace);
env = null;
return EXIT_FAILURE;
}
/*
try
{
env = DatabaseEnvironment.Open(home, envConfig);
}
catch(Exception e)
{
Console.WriteLine("{0}:{1}\n{2}",
e.Source, e.Message, e.StackTrace);
env = null;
return ExConstants.EXIT_FAILURE;
}
*/
return EXIT_SUCCESS;
}
开发者ID:simonzhangsm,项目名称:h-store,代码行数:52,代码来源:excs_lock.cs
示例13: TestGetAndFreeMutex
public void TestGetAndFreeMutex()
{
testName = "TestGetAndFreeMutex";
SetUpTest(true);
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseMPool = true;
DatabaseEnvironment env = DatabaseEnvironment.Open(
testHome, envConfig);
BerkeleyDB.Mutex mutex = env.GetMutex(true, true);
mutex.Dispose();
env.Close();
}
开发者ID:sukantoguha,项目名称:INET-Vagrant-Demos,代码行数:15,代码来源:MutexTest.cs
示例14: TestGetAndFreeMutex
public void TestGetAndFreeMutex()
{
testName = "TestGetAndFreeMutex";
testHome = testFixtureHome + "/" + testName;
Configuration.ClearDir(testHome);
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseMPool = true;
DatabaseEnvironment env = DatabaseEnvironment.Open(
testHome, envConfig);
BerkeleyDB.Mutex mutex = env.GetMutex(true, true);
mutex.Dispose();
env.Close();
}
开发者ID:kanbang,项目名称:Colt,代码行数:16,代码来源:MutexTest.cs
示例15: OpenNewSequenceInEnv
public void OpenNewSequenceInEnv(string home, string dbname,
out DatabaseEnvironment env, out BTreeDatabase db,
out Sequence seq)
{
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseTxns = true;
envConfig.UseMPool = true;
envConfig.UseLogging = true;
env = DatabaseEnvironment.Open(home, envConfig);
Transaction openTxn = env.BeginTransaction();
BTreeDatabaseConfig dbConfig =
new BTreeDatabaseConfig();
dbConfig.Creation = CreatePolicy.IF_NEEDED;
dbConfig.Env = env;
db = BTreeDatabase.Open(dbname + ".db", dbConfig,
openTxn);
openTxn.Commit();
Transaction seqTxn = env.BeginTransaction();
SequenceConfig seqConfig = new SequenceConfig();
seqConfig.BackingDatabase = db;
seqConfig.Creation = CreatePolicy.ALWAYS;
seqConfig.Decrement = false;
seqConfig.FreeThreaded = true;
seqConfig.Increment = true;
seqConfig.InitialValue = 0;
seqConfig.key = new DatabaseEntry(
ASCIIEncoding.ASCII.GetBytes("key"));
seqConfig.SetRange(Int64.MinValue, Int64.MaxValue);
seqConfig.Wrap = true;
seq = new Sequence(seqConfig);
seqTxn.Commit();
}
开发者ID:xiaogao0371,项目名称:dockerfile,代码行数:36,代码来源:SequenceTest.cs
示例16: MoveWithRMW
public void MoveWithRMW(string home, string name)
{
paramEnv = null;
paramDB = null;
// Open the environment.
DatabaseEnvironmentConfig envCfg =
new DatabaseEnvironmentConfig();
envCfg.Create = true;
envCfg.FreeThreaded = true;
envCfg.UseLocking = true;
envCfg.UseLogging = true;
envCfg.UseMPool = true;
envCfg.UseTxns = true;
paramEnv = DatabaseEnvironment.Open(home, envCfg);
// Open database in transaction.
Transaction openTxn = paramEnv.BeginTransaction();
BTreeDatabaseConfig cfg = new BTreeDatabaseConfig();
cfg.Creation = CreatePolicy.ALWAYS;
cfg.Env = paramEnv;
cfg.FreeThreaded = true;
cfg.PageSize = 4096;
cfg.Duplicates = DuplicatesPolicy.UNSORTED;
paramDB = BTreeDatabase.Open(name + ".db", cfg, openTxn);
openTxn.Commit();
/*
* Put 10 different, 2 duplicate and another different
* records into database.
*/
Transaction txn = paramEnv.BeginTransaction();
for (int i = 0; i < 13; i++)
{
DatabaseEntry key, data;
if (i == 10 || i == 11)
{
key = new DatabaseEntry(
ASCIIEncoding.ASCII.GetBytes("key"));
data = new DatabaseEntry(
ASCIIEncoding.ASCII.GetBytes("data"));
}
else
{
key = new DatabaseEntry(
BitConverter.GetBytes(i));
data = new DatabaseEntry(
BitConverter.GetBytes(i));
}
paramDB.Put(key, data, txn);
}
txn.Commit();
// Get a event wait handle.
signal = new EventWaitHandle(false, EventResetMode.ManualReset);
/*
* Start RdMfWt() in two threads. RdMfWt() reads
* and writes data into database.
*/
Thread t1 = new Thread(new ThreadStart(RdMfWt));
Thread t2 = new Thread(new ThreadStart(RdMfWt));
t1.Start();
t2.Start();
/*
* Give both threads time to read before signalling
* them to write.
*/
Thread.Sleep(1000);
// Invoke the write operation in both threads.
signal.Set();
// Return the number of deadlocks.
while (t1.IsAlive || t2.IsAlive)
{
/*
* Give both threads time to write before
* counting the number of deadlocks.
*/
Thread.Sleep(1000);
uint deadlocks = paramEnv.DetectDeadlocks(
DeadlockPolicy.DEFAULT);
// Confirm that there won't be any deadlock.
Assert.AreEqual(0, deadlocks);
}
t1.Join();
t2.Join();
paramDB.Close();
paramEnv.Close();
}
开发者ID:gildafnai82,项目名称:craq,代码行数:95,代码来源:CursorTest.cs
示例17: TestSnapshotIsolation
public void TestSnapshotIsolation()
{
BTreeDatabaseConfig dbConfig;
DatabaseEntry key, data;
DatabaseEnvironmentConfig envConfig;
Thread readThread, updateThread;
Transaction txn;
updateTxn = null;
readTxn = null;
paramDB = null;
paramEnv = null;
testName = "TestSnapshotIsolation";
testHome = testFixtureHome + "/" + testName;
Configuration.ClearDir(testHome);
/*
* Open environment with DB_MULTIVERSION
* which is required by DB_TXN_SNAPSHOT.
*/
envConfig = new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.UseMVCC = true;
envConfig.UseTxns = true;
envConfig.UseMPool = true;
envConfig.UseLocking = true;
envConfig.TxnTimeout = 1000;
paramEnv = DatabaseEnvironment.Open(
testHome, envConfig);
paramEnv.DetectDeadlocks(DeadlockPolicy.YOUNGEST);
/*
* Open a transactional database and put 1000 records
* into it within transaction.
*/
txn = paramEnv.BeginTransaction();
dbConfig = new BTreeDatabaseConfig();
dbConfig.Creation = CreatePolicy.IF_NEEDED;
dbConfig.UseMVCC = true;
dbConfig.Env = paramEnv;
paramDB = BTreeDatabase.Open(
testName + ".db", dbConfig, txn);
for (int i = 0; i < 256; i++)
{
key = new DatabaseEntry(
BitConverter.GetBytes(i));
data = new DatabaseEntry(
BitConverter.GetBytes(i));
paramDB.Put(key, data, txn);
}
txn.Commit();
/*
* Begin two threads, read and update thread.
* The update thread runs a update transaction
* using full read/write locking. The read thread
* set DB_TXN_SNAPSHOT on read-only cursor.
*/
readThread = new Thread(new ThreadStart(ReadTxn));
updateThread = new Thread(new ThreadStart(UpdateTxn));
updateThread.Start();
Thread.Sleep(1000);
readThread.Start();
readThread.Join();
updateThread.Join();
// Commit transacion in both two threads.
if (updateTxn != null)
updateTxn.Commit();
if (readTxn != null)
readTxn.Commit();
/*
* Confirm that the overwrite operation works.
*/
ConfirmOverwrite();
paramDB.Close();
paramEnv.Close();
}
开发者ID:gildafnai82,项目名称:craq,代码行数:81,代码来源:CursorTest.cs
示例18: Config
public static void Config(XmlElement xmlElement,
ref DatabaseEnvironmentConfig envConfig, bool compulsory)
{
uint value = new uint();
DateTime time = new DateTime();
Configuration.ConfigBool(xmlElement, "AutoCommit",
ref envConfig.AutoCommit, compulsory);
Configuration.ConfigBool(xmlElement, "CDB_ALLDB",
ref envConfig.CDB_ALLDB, compulsory);
Configuration.ConfigBool(xmlElement, "Create",
ref envConfig.Create, compulsory);
Configuration.ConfigString(xmlElement, "CreationDir",
ref envConfig.CreationDir, compulsory);
Configuration.ConfigStringList(xmlElement, "DataDirs",
ref envConfig.DataDirs, compulsory);
Configuration.ConfigString(xmlElement, "ErrorPrefix",
ref envConfig.ErrorPrefix, compulsory);
Configuration.ConfigBool(xmlElement, "ForceFlush",
ref envConfig.ForceFlush, compulsory);
Configuration.ConfigBool(xmlElement, "FreeThreaded",
ref envConfig.FreeThreaded, compulsory);
Configuration.ConfigBool(xmlElement, "InitRegions",
ref envConfig.InitRegions, compulsory);
Configuration.ConfigString(xmlElement, "IntermediateDirMode",
ref envConfig.IntermediateDirMode, compulsory);
Configuration.ConfigBool(xmlElement, "Lockdown",
ref envConfig.Lockdown, compulsory);
if (Configuration.ConfigUint(xmlElement, "LockTimeout",
ref value, compulsory))
envConfig.LockTimeout = value;
if (Configuration.ConfigUint(xmlElement, "MaxTransactions",
ref value, compulsory))
envConfig.MaxTransactions = value;
Configuration.ConfigBool(xmlElement, "NoBuffer",
ref envConfig.NoBuffer, compulsory);
Configuration.ConfigBool(xmlElement, "NoLocking",
ref envConfig.NoLocking, compulsory);
Configuration.ConfigBool(xmlElement, "NoMMap",
ref envConfig.NoMMap, compulsory);
Configuration.ConfigBool(xmlElement, "NoLocking",
ref envConfig.NoLocking, compulsory);
Configuration.ConfigBool(xmlElement, "NoPanic",
ref envConfig.NoPanic, compulsory);
Configuration.ConfigBool(xmlElement, "Overwrite",
ref envConfig.Overwrite, compulsory);
Configuration.ConfigBool(xmlElement, "Private",
ref envConfig.Private, compulsory);
Configuration.ConfigBool(xmlElement, "Register",
ref envConfig.Register, compulsory);
Configuration.ConfigBool(xmlElement, "RunFatalRecovery",
ref envConfig.RunFatalRecovery, compulsory);
Configuration.ConfigBool(xmlElement, "RunRecovery",
ref envConfig.RunRecovery, compulsory);
Configuration.ConfigBool(xmlElement, "SystemMemory",
ref envConfig.SystemMemory, compulsory);
Configuration.ConfigString(xmlElement, "TempDir",
ref envConfig.TempDir, compulsory);
Configuration.ConfigBool(xmlElement, "TimeNotGranted",
ref envConfig.TimeNotGranted, compulsory);
Configuration.ConfigBool(xmlElement, "TxnNoSync",
ref envConfig.TxnNoSync, compulsory);
Configuration.ConfigBool(xmlElement, "TxnNoWait",
ref envConfig.TxnNoWait, compulsory);
Configuration.ConfigBool(xmlElement, "TxnSnapshot",
ref envConfig.TxnSnapshot, compulsory);
if (Configuration.ConfigDateTime(xmlElement, "TxnTimestamp",
ref time, compulsory))
envConfig.TxnTimestamp = time;
Configuration.ConfigBool(xmlElement, "TxnWriteNoSync",
ref envConfig.TxnWriteNoSync, compulsory);
Configuration.ConfigBool(xmlElement, "UseLocking",
ref envConfig.UseLocking, compulsory);
Configuration.ConfigBool(xmlElement, "UseLogging",
ref envConfig.UseLogging, compulsory);
Configuration.ConfigBool(xmlElement, "UseMPool",
ref envConfig.UseMPool, compulsory);
Configuration.ConfigBool(xmlElement, "UseMVCC",
ref envConfig.UseMVCC, compulsory);
Configuration.ConfigBool(xmlElement, "UseReplication",
ref envConfig.UseReplication, compulsory);
Configuration.ConfigBool(xmlElement, "UseTxns",
ref envConfig.UseTxns, compulsory);
envConfig.Verbosity = new VerboseMessages();
Configuration.ConfigVerboseMessages(xmlElement,
"Verbosity", ref envConfig.Verbosity, compulsory);
Configuration.ConfigBool(xmlElement, "YieldCPU",
ref envConfig.YieldCPU, compulsory);
}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:89,代码来源:DatabaseEnvironmentConfigTest.cs
示例19: TestSetEncryption
public void TestSetEncryption()
{
testName = "TestSetEncryption";
SetUpTest(true);
DatabaseEnvironmentConfig envConfig =
new DatabaseEnvironmentConfig();
envConfig.Create = true;
envConfig.SetEncryption("key", EncryptionAlgorithm.AES);
Assert.AreEqual("key", envConfig.EncryptionPassword);
Assert.AreEqual(EncryptionAlgorithm.AES, envConfig.EncryptAlgorithm);
DatabaseEnvironment env = DatabaseEnvironment.Open(
testHome, envConfig);
Assert.AreEqual(EncryptionAlgorithm.AES, env.EncryptAlgorithm);
env.Close();
}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:16,代码来源:DatabaseEnvironmentConfigTest.cs
示例20: TestConfigReplication
public void TestConfigReplication()
{
testName = "TestConfigReplication";
SetUpTest(false);
XmlElement xmlElem = Configuration.TestSetUp(
testFixtureName, testName);
DatabaseEnvironmentConfig cfg =
new DatabaseEnvironmentConfig();
cfg.RepSystemCfg = new ReplicationConfig();
ReplicationConfigTest.Config(xmlElem,
ref cfg.RepSystemCfg, true);
ReplicationConfigTest.Confirm(xmlElem,
cfg.RepSystemCfg, true);
}
开发者ID:balagopalraj,项目名称:clearlinux,代码行数:14,代码来源:DatabaseEnvironmentConfigTest.cs
注:本文中的BerkeleyDB.DatabaseEnvironmentConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论