本文整理匯總了Java中com.sleepycat.je.EnvironmentConfig.setTxnNoSync方法的典型用法代碼示例。如果您正苦於以下問題:Java EnvironmentConfig.setTxnNoSync方法的具體用法?Java EnvironmentConfig.setTxnNoSync怎麽用?Java EnvironmentConfig.setTxnNoSync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sleepycat.je.EnvironmentConfig
的用法示例。
在下文中一共展示了EnvironmentConfig.setTxnNoSync方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initConfig
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
static EnvironmentConfig initConfig() {
EnvironmentConfig config = TestUtils.initEnvConfig();
DbInternal.disableParameterValidation(config);
config.setTransactional(true);
config.setAllowCreate(true);
config.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
config.setConfigParam(EnvironmentParams.LOG_FILE_MAX.getName(),
Integer.toString(FILE_SIZE));
config.setConfigParam(EnvironmentParams.ENV_CHECK_LEAKS.getName(),
"false");
config.setConfigParam(EnvironmentParams.ENV_RUN_CLEANER.getName(),
"false");
config.setConfigParam(EnvironmentParams.CLEANER_REMOVE.getName(),
"false");
config.setConfigParam
(EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");
config.setConfigParam
(EnvironmentParams.CLEANER_MIN_FILES_TO_DELETE.getName(), "1");
config.setConfigParam
(EnvironmentParams.CLEANER_LOCK_TIMEOUT.getName(), "1");
config.setConfigParam
(EnvironmentParams.CLEANER_MAX_BATCH_FILES.getName(), "1");
return config;
}
示例2: 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);
}
示例3: 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;
}
示例4: txnTestSuite
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
* Returns a txn test suite. If txnTypes is null, all three types are run.
*/
public static TestSuite txnTestSuite(Class testCaseClass,
EnvironmentConfig envConfig,
String[] txnTypes) {
if (txnTypes == null) {
txnTypes = new String[] { TxnTestCase.TXN_NULL,
TxnTestCase.TXN_USER,
TxnTestCase.TXN_AUTO };
}
if (envConfig == null) {
envConfig = TestUtils.initEnvConfig();
envConfig.setAllowCreate(true);
envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
}
TestSuite suite = new TestSuite();
for (int i = 0; i < txnTypes.length; i += 1) {
TestSuite baseSuite = new TestSuite(testCaseClass);
Enumeration e = baseSuite.tests();
while (e.hasMoreElements()) {
TxnTestCase test = (TxnTestCase) e.nextElement();
test.txnInit(envConfig, txnTypes[i]);
suite.addTest(test);
}
}
return suite;
}
示例5: 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;
}
示例6: 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.setTransactional(true);
config.setTxnNoSync(true);
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 tiny log file size to write one node per file. */
config.setConfigParam(EnvironmentParams.LOG_FILE_MAX.getName(),
Integer.toString(64));
env = new Environment(envHome, config);
envImpl = DbInternal.envGetEnvironmentImpl(env);
/* Speed up test that uses lots of very small files. */
envImpl.getFileManager().setSyncAtFileEnd(false);
openDb();
}
示例7: initEnv
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
private void initEnv(boolean createDb, boolean allowDups)
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.LOG_FILE_MAX.getName(),
Integer.toString(FILE_SIZE));
envConfig.setConfigParam(EnvironmentParams.ENV_CHECK_LEAKS.getName(),
"false");
envConfig.setConfigParam(EnvironmentParams.ENV_RUN_CLEANER.getName(),
"false");
envConfig.setConfigParam(EnvironmentParams.CLEANER_REMOVE.getName(),
"false");
envConfig.setConfigParam
(EnvironmentParams.CLEANER_MIN_UTILIZATION.getName(), "80");
envConfig.setConfigParam
(EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "6");
envConfig.setConfigParam(EnvironmentParams.BIN_DELTA_PERCENT.getName(),
"75");
/* Don't use detail tracking in this test. */
envConfig.setConfigParam
(EnvironmentParams.CLEANER_TRACK_DETAIL.getName(), "false");
exampleEnv = new Environment(envHome, envConfig);
String databaseName = "cleanerDb";
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setTransactional(true);
dbConfig.setAllowCreate(createDb);
dbConfig.setSortedDuplicates(allowDups);
exampleDb = exampleEnv.openDatabase(null, databaseName, dbConfig);
}
示例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);
/*
* Properties for creating an environment.
* Disable the evictor for this test, use larger BINS
*/
EnvironmentConfig envConfig = TestUtils.initEnvConfig();
envConfig.setConfigParam(EnvironmentParams.ENV_RUN_EVICTOR.getName(),
"false");
envConfig.setConfigParam(
EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(),
"false");
envConfig.setConfigParam(
EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(),
"false");
envConfig.setConfigParam(
EnvironmentParams.ENV_RUN_CLEANER.getName(),
"false");
/* Don't checkpoint utilization info for this test. */
DbInternal.setCheckpointUP(envConfig, false);
envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "4");
envConfig.setAllowCreate(true);
envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
envConfig.setTransactional(true);
env = new Environment(envHome, envConfig);
}
示例9: 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);
/*
* Properties for creating an environment.
* Disable the evictor for this test, use larger BINS
*/
EnvironmentConfig envConfig = TestUtils.initEnvConfig();
envConfig.setConfigParam(EnvironmentParams.ENV_RUN_EVICTOR.getName(),
"false");
envConfig.setConfigParam(
EnvironmentParams.ENV_RUN_INCOMPRESSOR.getName(),
"false");
envConfig.setConfigParam(
EnvironmentParams.ENV_RUN_CHECKPOINTER.getName(),
"false");
envConfig.setConfigParam(
EnvironmentParams.ENV_RUN_CLEANER.getName(),
"false");
/* Don't checkpoint utilization info for this test. */
DbInternal.setCheckpointUP(envConfig, false);
envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "4");
envConfig.setAllowCreate(true);
envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
envConfig.setTransactional(true);
env = new Environment(envHome, envConfig);
}
示例10: 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.setTransactional(true);
config.setTxnNoSync(true);
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 tiny log file size to write one LN per file. */
config.setConfigParam(EnvironmentParams.LOG_FILE_MAX.getName(),
Integer.toString(64));
/* Don't use NIO direct buffers or we run out of memory. */
config.setConfigParam
(EnvironmentParams.LOG_DIRECT_NIO.getName(), "false");
/* Obsolete LN size counting is optional per test. */
if (fetchObsoleteSize) {
config.setConfigParam
(EnvironmentParams.CLEANER_FETCH_OBSOLETE_SIZE.getName(),
"true");
}
env = new Environment(envHome, config);
/* Speed up test that uses lots of very small files. */
DbInternal.envGetEnvironmentImpl(env).
getFileManager().
setSyncAtFileEnd(false);
openDb();
}
示例11: initEnvInternal
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
private void initEnvInternal(boolean duplicatesAllowed,
boolean transactionalDatabase)
throws DatabaseException {
this.duplicatesAllowed = duplicatesAllowed;
// Set up sample data
int nKeys = simpleKeyStrings.length;
simpleKeys = new StringDbt[nKeys];
simpleData = new StringDbt[nKeys];
for (int i = 0; i < nKeys; i++) {
simpleKeys[i] = new StringDbt(simpleKeyStrings[i]);
simpleData[i] = new StringDbt(simpleDataStrings[i]);
}
// Set up an environment
EnvironmentConfig envConfig = TestUtils.initEnvConfig();
envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
envConfig.setTransactional(true);
envConfig.setConfigParam(EnvironmentParams.NODE_MAX.getName(), "6");
envConfig.setConfigParam(EnvironmentParams.MAX_MEMORY.getName(),
new Long(1 << 24).toString());
envConfig.setAllowCreate(true);
exampleEnv = new Environment(envHome, envConfig);
// Set up a database
String databaseName = "simpleDb" + dbCnt++;
DatabaseConfig dbConfig = new DatabaseConfig();
if (btreeComparisonFunction != null) {
dbConfig.setBtreeComparator(btreeComparisonFunction.getClass());
}
if (duplicateComparisonFunction != null) {
dbConfig.setDuplicateComparator
(duplicateComparisonFunction.getClass());
}
dbConfig.setAllowCreate(true);
dbConfig.setSortedDuplicates(duplicatesAllowed);
dbConfig.setTransactional(transactionalDatabase);
exampleDb = exampleEnv.openDatabase(null, databaseName, dbConfig);
// Set up cursors
cursor = exampleDb.openCursor(null, null);
cursor2 = exampleDb.openCursor(null, null);
simpleDataMap = new Hashtable();
}
示例12: openEnv
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
* Open an environment and database.
*/
private void openEnv(int floor,
int maxMem)
throws DatabaseException {
/* Convert floor percentage into bytes. */
long evictBytes = 0;
if (floor > 0) {
evictBytes = maxMem - ((maxMem * floor) / 100);
}
/* Make a non-txnal env w/no daemons and small nodes. */
EnvironmentConfig envConfig = TestUtils.initEnvConfig();
envConfig.setAllowCreate(true);
envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_EVICTOR.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_INCOMPRESSOR.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_CLEANER.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_CHECKPOINTER.getName(), "false");
if (evictBytes > 0) {
envConfig.setConfigParam(EnvironmentParams.
EVICTOR_EVICT_BYTES.getName(),
(new Long(evictBytes)).toString());
}
envConfig.setConfigParam(EnvironmentParams.
MAX_MEMORY.getName(),
new Integer(maxMem).toString());
/* Don't track detail with a tiny cache size. */
envConfig.setConfigParam
(EnvironmentParams.CLEANER_TRACK_DETAIL.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.LOG_MEM_SIZE.getName(),
EnvironmentParams.LOG_MEM_SIZE_MIN_STRING);
envConfig.setConfigParam(EnvironmentParams.NUM_LOG_BUFFERS.getName(),
"2");
/* Enable DB (MapLN) eviction for eviction tests. */
envConfig.setConfigParam(EnvironmentParams.
ENV_DB_EVICTION.getName(), "true");
/*
* Disable critical eviction, we want to test under controlled
* circumstances.
*/
envConfig.setConfigParam(EnvironmentParams.
EVICTOR_CRITICAL_PERCENTAGE.getName(),
"1000");
/* Make small nodes */
envConfig.setConfigParam(EnvironmentParams.
NODE_MAX.getName(), "4");
envConfig.setConfigParam(EnvironmentParams.
NODE_MAX_DUPTREE.getName(), "4");
env = new Environment(envHome, envConfig);
/* Open a database. */
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setAllowCreate(true);
dbConfig.setSortedDuplicates(true);
db = env.openDatabase(null, "foo", dbConfig);
}
示例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.setTransactional(true);
config.setTxnNoSync(true);
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 tiny log file size to write one LN per file. */
config.setConfigParam(EnvironmentParams.LOG_FILE_MAX.getName(),
Integer.toString(64));
/* Don't use NIO direct buffers or we run out of memory. */
config.setConfigParam
(EnvironmentParams.LOG_DIRECT_NIO.getName(), "false");
/* Obsolete LN size counting is optional per test. */
if (fetchObsoleteSize) {
config.setConfigParam
(EnvironmentParams.CLEANER_FETCH_OBSOLETE_SIZE.getName(),
"true");
}
env = new Environment(envHome, config);
/* Speed up test that uses lots of very small files. */
DbInternal.envGetEnvironmentImpl(env).
getFileManager().
setSyncAtFileEnd(false);
openDb();
}
示例14: openEnv
import com.sleepycat.je.EnvironmentConfig; //導入方法依賴的package包/類
/**
* Open an environment and database.
*/
private void openEnv(int floor,
int maxMem)
throws DatabaseException {
/* Convert floor percentage into bytes. */
long evictBytes = maxMem - ((maxMem * floor) / 100);
/* Make a non-txnal env w/no daemons and small nodes. */
EnvironmentConfig envConfig = TestUtils.initEnvConfig();
envConfig.setAllowCreate(true);
envConfig.setTxnNoSync(Boolean.getBoolean(TestUtils.NO_SYNC));
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_EVICTOR.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_INCOMPRESSOR.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_CLEANER.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.
ENV_RUN_CHECKPOINTER.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.
EVICTOR_EVICT_BYTES.getName(),
(new Long(evictBytes)).toString());
envConfig.setConfigParam(EnvironmentParams.
MAX_MEMORY.getName(),
new Integer(maxMem).toString());
/* Don't track detail with a tiny cache size. */
envConfig.setConfigParam
(EnvironmentParams.CLEANER_TRACK_DETAIL.getName(), "false");
envConfig.setConfigParam(EnvironmentParams.LOG_MEM_SIZE.getName(),
EnvironmentParams.LOG_MEM_SIZE_MIN_STRING);
envConfig.setConfigParam(EnvironmentParams.NUM_LOG_BUFFERS.getName(),
"2");
/* Enable DB (MapLN) eviction for eviction tests. */
envConfig.setConfigParam(EnvironmentParams.
ENV_DB_EVICTION.getName(), "true");
/*
* Disable critical eviction, we want to test under controlled
* circumstances.
*/
envConfig.setConfigParam(EnvironmentParams.
EVICTOR_CRITICAL_PERCENTAGE.getName(),
"1000");
/* Make small nodes */
envConfig.setConfigParam(EnvironmentParams.
NODE_MAX.getName(), "4");
envConfig.setConfigParam(EnvironmentParams.
NODE_MAX_DUPTREE.getName(), "4");
env = new Environment(envHome, envConfig);
/* Open a database. */
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setAllowCreate(true);
dbConfig.setSortedDuplicates(true);
db = env.openDatabase(null, "foo", dbConfig);
}