當前位置: 首頁>>代碼示例>>Java>>正文


Java EnvironmentConfig.setConfigParam方法代碼示例

本文整理匯總了Java中com.sleepycat.je.EnvironmentConfig.setConfigParam方法的典型用法代碼示例。如果您正苦於以下問題:Java EnvironmentConfig.setConfigParam方法的具體用法?Java EnvironmentConfig.setConfigParam怎麽用?Java EnvironmentConfig.setConfigParam使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.sleepycat.je.EnvironmentConfig的用法示例。


在下文中一共展示了EnvironmentConfig.setConfigParam方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: commonConfig

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void commonConfig(EnvironmentConfig envConfig) {
    System.setProperty("JEMonitor", "true");
    envConfig.setConfigParam(EnvironmentConfig.NODE_MAX_ENTRIES, "256");
    envConfig.setConfigParam(EnvironmentConfig.EVICTOR_EVICT_BYTES, (1024 * 1024 * 2) + "");
    envConfig.setConfigParam(EnvironmentConfig.EVICTOR_NODES_PER_SCAN, "10");
    envConfig.setConfigParam(EnvironmentConfig.EVICTOR_LRU_ONLY, "false");
    envConfig.setConfigParam(EnvironmentConfig.EVICTOR_FORCED_YIELD, "true");
    envConfig.setConfigParam(EnvironmentConfig.EVICTOR_CORE_THREADS, Runtime.getRuntime().availableProcessors()
                                                                     + "");
    envConfig.setConfigParam(EnvironmentConfig.EVICTOR_MAX_THREADS, Runtime.getRuntime().availableProcessors() + "");
    envConfig.setConfigParam(EnvironmentConfig.CHECKPOINTER_BYTES_INTERVAL, 1024 * 1024 * 200 + "");
    envConfig.setConfigParam(EnvironmentConfig.CLEANER_LAZY_MIGRATION, "true");
    envConfig.setConfigParam(EnvironmentConfig.CLEANER_THREADS, Runtime.getRuntime().availableProcessors() + "");
    envConfig.setConfigParam(EnvironmentConfig.CLEANER_LOOK_AHEAD_CACHE_SIZE, 1024 * 8 + "");
    envConfig.setConfigParam(EnvironmentConfig.CLEANER_READ_SIZE, 1024 * 1024 + "");
    envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX, 1024 * 1024 * 200 + "");
    envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_CACHE_SIZE, "1024");
    envConfig.setConfigParam(EnvironmentConfig.LOG_USE_WRITE_QUEUE, "true");
    envConfig.setConfigParam(EnvironmentConfig.LOG_WRITE_QUEUE_SIZE, 1024 * 1024 * 2 + "");
    // envConfig.setConfigParam(EnvironmentConfig.HALT_ON_COMMIT_AFTER_CHECKSUMEXCEPTION,
    // "true");
    envConfig.setConfigParam(EnvironmentConfig.LOG_ITERATOR_READ_SIZE, 1024 * 8 + "");
    envConfig.setConfigParam(EnvironmentConfig.LOCK_TIMEOUT, 2000 + "\tMILLISECONDS");
    envConfig.setConfigParam(EnvironmentConfig.ENV_RECOVERY_FORCE_CHECKPOINT, "true");
}
 
開發者ID:loye168,項目名稱:tddl5,代碼行數:26,代碼來源:JE_Repository.java

示例2: tempBufferInitEnvInternal

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
private void tempBufferInitEnvInternal(String buffSize, String cacheSize)
throws DatabaseException {

       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
       envConfig.setTransactional(true);
       envConfig.setAllowCreate(true);
if (!buffSize.equals("0")) {
    envConfig.setConfigParam("je.log.totalBufferBytes", buffSize);
}

if (!cacheSize.equals("0")) {
    envConfig.setConfigParam("je.maxMemory", cacheSize);
}
       env = new Environment(envHome, envConfig);

       DatabaseConfig dbConfig = new DatabaseConfig();
       dbConfig.setAllowCreate(true);
       dbConfig.setSortedDuplicates(true);
dbConfig.setTransactional(true);
       db = env.openDatabase(null, "InsertAndDelete", dbConfig);
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:22,代碼來源:LogBufferPoolTest.java

示例3: setUp

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void setUp() throws IOException, DatabaseException {
    TestUtils.removeFiles("Setup", envHome, FileManager.JE_SUFFIX);

    /*
     * Properties for creating an environment.  Disable the evictor for
     * this test, use larger BINS.
     */
    EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    envConfig.setTransactional(true);
    envConfig.setConfigParam
 (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "true");
    envConfig.setConfigParam
 (EnvironmentParams.NODE_MAX.getName(), "50");
    envConfig.setConfigParam
 (EnvironmentParams.BIN_DELTA_PERCENT.getName(), "50");
    envConfig.setAllowCreate(true);
    env = new Environment(envHome, envConfig);
    logManager = DbInternal.envGetEnvironmentImpl(env).getLogManager();
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:20,代碼來源:BinDeltaTest.java

示例4: createEnv

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
private Environment createEnv(boolean readOnly, File envDir) 
    throws DatabaseException {

    EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    DbInternal.disableParameterValidation(envConfig);
    envConfig.setAllowCreate(true);
    envConfig.setReadOnly(readOnly);
    envConfig.setConfigParam(EnvironmentParams.LOG_FILE_MAX.getName(),
                             "400");
    envConfig.setConfigParam(EnvironmentParams.ENV_RUN_CLEANER.getName(),
                             "false");

    Environment env = new Environment(envDir, envConfig);

    return env;
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:17,代碼來源:DbBackupTest.java

示例5: setUp

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void setUp()
throws DatabaseException {

       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
       envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "6");
       envConfig.setConfigParam(EnvironmentParams.N_LOCK_TABLES.getName(),
                                "11");
       envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
       env = new EnvironmentImpl(envHome, envConfig);

       TxnManager txnManager = env.getTxnManager();
lockManager = txnManager.getLockManager();
txn1 = new BasicLocker(env);
txn2 = new BasicLocker(env);
txn3 = new BasicLocker(env);
txn4 = new BasicLocker(env);
nid = new Long(1);
sequence = 0;
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:21,代碼來源:LockManagerTest.java

示例6: setUp

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void setUp()
throws DatabaseException {

       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
       envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "6");
       envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
       env = new EnvironmentImpl(envHome, envConfig);

       TxnManager txnManager = env.getTxnManager();
lockManager = txnManager.getLockManager();
txn1 = new BasicLocker(env);
txn2 = new BasicLocker(env);
txn3 = new BasicLocker(env);
txn4 = new BasicLocker(env);
nid = new Long(1);
sequence = 0;
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:19,代碼來源:LockManagerTest.java

示例7: setUp

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void setUp()
       throws IOException, DatabaseException {

       /*
        * Note that we use the official Environment class to make the
        * environment, so that everything is set up, but we then go a backdoor
        * route to get to the underlying EnvironmentImpl class so that we
        * don't require that the Environment.getDbEnvironment method be
        * unnecessarily public.
        */
       TestUtils.removeLogFiles("Setup", envHome, false);
       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
DbInternal.disableParameterValidation(envConfig);
envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "6");
       envConfig.setConfigParam
    (EnvironmentParams.LOG_FILE_MAX.getName(), "1024");
       envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
       env = new Environment(envHome, envConfig);

       envImpl = DbInternal.envGetEnvironmentImpl(env);
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:23,代碼來源:LNFileReaderTest.java

示例8: setUp

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void setUp()
       throws IOException, DatabaseException {

IN.ACCUMULATED_LIMIT = 0;
Txn.ACCUMULATED_LIMIT = 0;

       TestUtils.removeFiles("Setup", envHome, FileManager.JE_SUFFIX);

       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
       envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "6");
       envConfig.setTransactional(true);
       envConfig.setAllowCreate(true);
       env = new Environment(envHome, envConfig);

       DatabaseConfig dbConfig = new DatabaseConfig();
       dbConfig.setTransactional(true);
       dbConfig.setAllowCreate(true);
       db = env.openDatabase(null, "foo", dbConfig);
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:20,代碼來源:TxnTest.java

示例9: openEnv

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
private void openEnv()
       throws DatabaseException {

       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
DbInternal.disableParameterValidation(envConfig);
       envConfig.setTransactional(true);
       envConfig.setAllowCreate(true);
       envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
       envConfig.setConfigParam
           (EnvironmentParams.CLEANER_MIN_UTILIZATION.getName(), "80");
       envConfig.setConfigParam
           (EnvironmentParams.LOG_FILE_MAX.getName(),
            Integer.toString(FILE_SIZE));
       envConfig.setConfigParam
           (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false");
       envConfig.setConfigParam
    (EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");

       env = new Environment(envHome, envConfig);
       envImpl = DbInternal.envGetEnvironmentImpl(env);

       DatabaseConfig dbConfig = new DatabaseConfig();
       dbConfig.setTransactional(true);
       dbConfig.setAllowCreate(true);
       db = env.openDatabase(null, "ReadOnlyLockingTest", dbConfig);
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:27,代碼來源:ReadOnlyLockingTest.java

示例10: createTransientBackend

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
@Override
public PersistenceBackend createTransientBackend() {
    NeoLogger.debug("createTransientBackend()");
    BerkeleyDbPersistenceBackend backend = null;

    try {
        File temporaryFolder = Files.createTempDirectory("neoemf").toFile();
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setAllowCreate(true);
        envConfig.setConfigParam(EnvironmentConfig.LOG_MEM_ONLY, "true");

        File dir = new File(BerkeleyDbURI.createFileURI(temporaryFolder).toFileString());
        backend = new BerkeleyDbPersistenceBackend(dir, envConfig);
        backend.open();

    }
    catch (IOException e) {
        NeoLogger.error(e);
    }
    return backend;
}
 
開發者ID:atlanmod,項目名稱:NeoEMF,代碼行數:22,代碼來源:BerkeleyDbPersistenceBackendFactory.java

示例11: initEnv

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
void initEnv(boolean duplicatesAllowed)
    throws DatabaseException {

    EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    envConfig.setConfigParam(EnvironmentParams.ENV_RUN_EVICTOR.getName(),
                             "false");
    envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(),
                             Integer.toString(MAX_ENTRIES_PER_NODE));
    envConfig.setAllowCreate(true);
    envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
    env = new Environment(envHome, envConfig);

    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    dbConfig.setSortedDuplicates(duplicatesAllowed);
    db = env.openDatabase(null, "foo", dbConfig);

    tree = DbInternal.dbGetDatabaseImpl(db).getTree();
    minKey = null;
    maxKey = null;
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:22,代碼來源:TreeTestBase.java

示例12: setUp

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
public void setUp()
    throws Exception {

    TestUtils.removeFiles("Setup", envHome, FileManager.JE_SUFFIX);
    sequencer = 0;
    EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    envConfig.setAllowCreate(true);
    envConfig.setConfigParam(EnvironmentParams.ENV_RUN_EVICTOR.getName(),
                             "false");
    env = new Environment(envHome, envConfig);
    envImpl = DbInternal.envGetEnvironmentImpl(env);

    inList1 = new INList(envImpl);
    db = env.openDatabase(null, DB_NAME, dbConfig);
    dbImpl = DbInternal.dbGetDatabaseImpl(db);
}
 
開發者ID:nologic,項目名稱:nabs,代碼行數:17,代碼來源:INListTest.java

示例13: openEnv

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
    * Opens the environment and database.
    */
   private void openEnv()
       throws DatabaseException {

       EnvironmentConfig config = TestUtils.initEnvConfig();
DbInternal.disableParameterValidation(config);
       config.setAllowCreate(true);
       /* Do not run the daemons. */
       config.setConfigParam
           (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false");
       config.setConfigParam
           (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "false");
       config.setConfigParam
    (EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");
       config.setConfigParam
           (EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(), "false");
       /* Use a small log file size to make cleaning more frequent. */
       config.setConfigParam(EnvironmentParams.LOG_FILE_MAX.getName(),
                             Integer.toString(1024));
       /* Use a small memory size to force eviction. */
       config.setConfigParam(EnvironmentParams.MAX_MEMORY.getName(),
                             Integer.toString(1024 * 96));
       /* Don't track detail with a tiny cache size. */
       config.setConfigParam
           (EnvironmentParams.CLEANER_TRACK_DETAIL.getName(), "false");
       config.setConfigParam(EnvironmentParams.NUM_LOG_BUFFERS.getName(),
                             Integer.toString(2));
       /* Set log buffers large enough for trace messages. */
       config.setConfigParam(EnvironmentParams.LOG_MEM_SIZE.getName(),
                             Integer.toString(7000));

       env = new Environment(envHome, config);

       openDb();
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:38,代碼來源:SR10553Test.java

示例14: open

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
    * Opens the environment and database.
    */
   private void open()
       throws DatabaseException {

       EnvironmentConfig config = TestUtils.initEnvConfig();
DbInternal.disableParameterValidation(config);
       config.setAllowCreate(true);
       /* Do not run the daemons. */
       config.setConfigParam
           (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false");
       config.setConfigParam
           (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "false");
       config.setConfigParam
    (EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");
       config.setConfigParam
           (EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(), "false");
       /* Configure to make cleaning more frequent. */
       config.setConfigParam
           (EnvironmentParams.LOG_FILE_MAX.getName(), "10240");
       config.setConfigParam
           (EnvironmentParams.CLEANER_MIN_UTILIZATION.getName(), "90");
       
       env = new Environment(envHome, config);

       DatabaseConfig dbConfig = new DatabaseConfig();
       dbConfig.setAllowCreate(true);
       dbConfig.setSortedDuplicates(true);
       db = env.openDatabase(null, DB_NAME, dbConfig);
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:32,代碼來源:SR12978Test.java

示例15: testFaultingIn

import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
    * Log and retrieve objects, with some of log flushed to disk, some
    * of log in memory. Force the read buffer to be very small
    */
   public void testFaultingIn()
throws Throwable {

       try {

           /* 
            * Force the buffers and files to be small. The log buffer is
            * actually too small, will have to grow dynamically. We read in 32
            * byte chunks, will have to re-read only holds one test item (each
            * test item is 50 bytes)
            */
           EnvironmentConfig envConfig = TestUtils.initEnvConfig();
    DbInternal.disableParameterValidation(envConfig);
           envConfig.setConfigParam
    (EnvironmentParams.LOG_MEM_SIZE.getName(),
     EnvironmentParams.LOG_MEM_SIZE_MIN_STRING);
           envConfig.setConfigParam
    (EnvironmentParams.NUM_LOG_BUFFERS.getName(), "2");
           envConfig.setConfigParam
    (EnvironmentParams.LOG_FILE_MAX.getName(), "200");
           envConfig.setConfigParam
    (EnvironmentParams.LOG_FAULT_READ_SIZE.getName(), "32");
           envConfig.setConfigParam
    (EnvironmentParams.NODE_MAX.getName(), "6");
           envConfig.setAllowCreate(true);
           env = new EnvironmentImpl(envHome, envConfig);
           fileManager = env.getFileManager();
           logManager = env.getLogManager();

           logAndRetrieve();
       } catch (Throwable t) {
           t.printStackTrace();
           throw t;
       } finally {
           env.close();
       }
   }
 
開發者ID:nologic,項目名稱:nabs,代碼行數:42,代碼來源:LogManagerTest.java


注:本文中的com.sleepycat.je.EnvironmentConfig.setConfigParam方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。