当前位置: 首页>>代码示例>>Java>>正文


Java DatabaseConfig.setExclusiveCreate方法代码示例

本文整理汇总了Java中com.sleepycat.je.DatabaseConfig.setExclusiveCreate方法的典型用法代码示例。如果您正苦于以下问题:Java DatabaseConfig.setExclusiveCreate方法的具体用法?Java DatabaseConfig.setExclusiveCreate怎么用?Java DatabaseConfig.setExclusiveCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sleepycat.je.DatabaseConfig的用法示例。


在下文中一共展示了DatabaseConfig.setExclusiveCreate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initEnvInternal

import com.sleepycat.je.DatabaseConfig; //导入方法依赖的package包/类
private void initEnvInternal(boolean create)
throws DatabaseException {

       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
       envConfig.setTransactional(true);
       envConfig.setAllowCreate(create);
       envConfig.setConfigParam("je.nodeMaxEntries", "4");
       envConfig.setConfigParam("je.nodeDupTreeMaxEntries", "4");
       env = new Environment(envHome, envConfig);

       DatabaseConfig dbConfig = new DatabaseConfig();
       dbConfig.setAllowCreate(create);
       dbConfig.setTransactional(true);
       dbConfig.setExclusiveCreate(create);
       db = env.openDatabase(null, "foo", dbConfig);
   }
 
开发者ID:nologic,项目名称:nabs,代码行数:17,代码来源:SplitRace_SR11144Test.java

示例2: open

import com.sleepycat.je.DatabaseConfig; //导入方法依赖的package包/类
private void open()
    throws Exception {

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

    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    dbConfig.setExclusiveCreate(true);
    dbConfig.setSortedDuplicates(dups);
    db = env.openDatabase(null, "testDb", dbConfig);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:16,代码来源:SR12641.java

示例3: open

import com.sleepycat.je.DatabaseConfig; //导入方法依赖的package包/类
private void open(boolean allowDuplicates)
       throws Exception {

       EnvironmentConfig envConfig = TestUtils.initEnvConfig();
       envConfig.setConfigParam
           (EnvironmentParams.NODE_MAX.getName(), String.valueOf(NODE_MAX));
/*
       envConfig.setConfigParam
           (EnvironmentParams.MAX_MEMORY.getName(), "10000000");
       envConfig.setConfigParam
           (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false");
       envConfig.setConfigParam
           (EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");
*/

       envConfig.setConfigParam
           (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "false");

       envConfig.setConfigParam
           (EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(), "false");

       envConfig.setTransactional(true);
       envConfig.setAllowCreate(true);
       env = new Environment(envHome, envConfig);

       DatabaseConfig dbConfig = new DatabaseConfig();
       dbConfig.setAllowCreate(true);
       dbConfig.setExclusiveCreate(false);
       dbConfig.setTransactional(true);
       dbConfig.setSortedDuplicates(allowDuplicates);
       db = env.openDatabase(null, "testDb", dbConfig);
   }
 
开发者ID:nologic,项目名称:nabs,代码行数:33,代码来源:SortedLSNTreeWalkerTest.java

示例4: keysIndex

import com.sleepycat.je.DatabaseConfig; //导入方法依赖的package包/类
/**
 * Returns a read-only keys index that maps secondary key to primary key.
 * When accessing the keys index, the primary key is returned rather than
 * the entity.  When only the primary key is needed and not the entire
 * entity, using the keys index is less expensive than using the secondary
 * index because the primary index does not have to be accessed.
 *
 * <p>Note the following in the unusual case that you are <em>not</em>
 * using an <code>EntityStore</code>: This method will open the keys
 * database, a second database handle for the secondary database, if it is
 * not already open.  In this case, if you are <em>not</em> using an
 * <code>EntityStore</code>, then you are responsible for closing the
 * database returned by {@link #getKeysDatabase} before closing the
 * environment.  If you <em>are</em> using an <code>EntityStore</code>, the
 * keys database will be closed automatically by {@link
 * EntityStore#close}.</p>
 *
 * @return the keys index.
 *
 * @throws DatabaseException the base class for all BDB exceptions.
 */
public synchronized EntityIndex<SK, PK> keysIndex()
    throws DatabaseException {

    if (keysIndex == null) {
        if (keysDb == null) {
            DatabaseConfig config = secDb.getConfig();
            config.setReadOnly(true);
            config.setAllowCreate(false);
            config.setExclusiveCreate(false);   
            keysDb = DbCompat.openDatabase
                (db.getEnvironment(), null /*txn*/,
                 DbCompat.getDatabaseFile(secDb),
                 secDb.getDatabaseName(),
                 config);
            if (keysDb == null) {
                throw new IllegalStateException
                    ("Could not open existing DB, file: " + 
                     DbCompat.getDatabaseFile(secDb) + " name: " +
                     secDb.getDatabaseName());
            }
        }
        keysIndex = new KeysIndex<SK, PK>
            (keysDb, keyClass, keyBinding,
             priIndex.getKeyClass(), priIndex.getKeyBinding());
    }
    return keysIndex;
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:49,代码来源:SecondaryIndex.java

示例5: openDatabase

import com.sleepycat.je.DatabaseConfig; //导入方法依赖的package包/类
private Database openDatabase(final Environment env,
                              final boolean createNew) {
    final DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setTransactional(true);
    dbConfig.setAllowCreate(createNew);
    dbConfig.setExclusiveCreate(createNew);
    dbConfig.setNodeMaxEntries(nodeMaxEntries);
    dbConfig.setKeyPrefixing(keyPrefix > 0);
    dbConfig.setSortedDuplicates(duplicates);
    return env.openDatabase(null, "foo", dbConfig);
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:12,代码来源:DbCacheSize.java


注:本文中的com.sleepycat.je.DatabaseConfig.setExclusiveCreate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。