Ejemplo n.º 1
0
        public static void Config(XmlElement
                                  xmlElement, ref LogConfig logConfig, bool compulsory)
        {
            uint uintValue = new uint();
            int  intValue  = new int();

            Configuration.ConfigBool(xmlElement, "AutoRemove",
                                     ref logConfig.AutoRemove, compulsory);
            if (Configuration.ConfigUint(xmlElement, "BufferSize",
                                         ref uintValue, compulsory))
            {
                logConfig.BufferSize = uintValue;
            }
            Configuration.ConfigString(xmlElement, "Dir",
                                       ref logConfig.Dir, compulsory);
            if (Configuration.ConfigInt(xmlElement, "FileMode",
                                        ref intValue, compulsory))
            {
                logConfig.FileMode = intValue;
            }
            Configuration.ConfigBool(xmlElement, "ForceSync",
                                     ref logConfig.ForceSync, compulsory);
            Configuration.ConfigBool(xmlElement, "InMemory",
                                     ref logConfig.InMemory, compulsory);
            Configuration.ConfigBool(xmlElement,
                                     "LogExternalFileContent",
                                     ref logConfig.LogExternalFileContent, compulsory);
            if (Configuration.ConfigUint(xmlElement, "MaxFileSize",
                                         ref uintValue, compulsory))
            {
                logConfig.MaxFileSize = uintValue;
            }
            Configuration.ConfigBool(xmlElement, "NoBuffer",
                                     ref logConfig.NoBuffer, compulsory);
            Configuration.ConfigBool(xmlElement, "NoSync",
                                     ref logConfig.NoSync, compulsory);
            if (Configuration.ConfigUint(xmlElement, "RegionSize",
                                         ref uintValue, compulsory))
            {
                logConfig.RegionSize = uintValue;
            }
            Configuration.ConfigBool(xmlElement, "ZeroOnCreate",
                                     ref logConfig.ZeroOnCreate, compulsory);
        }
Ejemplo n.º 2
0
        public static void Config(XmlElement xmlElement,
                                  ref DatabaseConfig dbConfig, bool compulsory)
        {
            uint pageSize = new uint();

            Configuration.ConfigBool(xmlElement, "AutoCommit",
                                     ref dbConfig.AutoCommit, compulsory);
            Configuration.ConfigByteOrder(xmlElement, "ByteOrder",
                                          ref dbConfig.ByteOrder, compulsory);
            Configuration.ConfigCacheInfo(xmlElement, "CacheSize",
                                          ref dbConfig.CacheSize, compulsory);
            Configuration.ConfigBool(xmlElement, "DoChecksum",
                                     ref dbConfig.DoChecksum, compulsory);
            Configuration.ConfigString(xmlElement, "ErrorPrefix",
                                       ref dbConfig.ErrorPrefix, compulsory);
            Configuration.ConfigBool(xmlElement, "FreeThreaded",
                                     ref dbConfig.FreeThreaded, compulsory);
            Configuration.ConfigBool(xmlElement, "NoMMap",
                                     ref dbConfig.NoMMap, compulsory);
            Configuration.ConfigBool(xmlElement, "NonDurableTxns",
                                     ref dbConfig.NonDurableTxns, compulsory);
            if (Configuration.ConfigUint(xmlElement, "PageSize",
                                         ref pageSize, compulsory))
            {
                dbConfig.PageSize = pageSize;
            }
            Configuration.ConfigCachePriority(xmlElement,
                                              "Priority", ref dbConfig.Priority, compulsory);
            Configuration.ConfigBool(xmlElement, "ReadOnly",
                                     ref dbConfig.ReadOnly, compulsory);
            Configuration.ConfigBool(xmlElement, "ReadUncommitted",
                                     ref dbConfig.ReadUncommitted, compulsory);
            Configuration.ConfigEncryption(xmlElement,
                                           "Encryption", dbConfig, compulsory);
            Configuration.ConfigBool(xmlElement, "Truncate",
                                     ref dbConfig.Truncate, compulsory);
            Configuration.ConfigBool(xmlElement, "UseMVCC",
                                     ref dbConfig.UseMVCC, compulsory);
        }
        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);
        }