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


Java CheckpointConfig类代码示例

本文整理汇总了Java中com.sleepycat.je.CheckpointConfig的典型用法代码示例。如果您正苦于以下问题:Java CheckpointConfig类的具体用法?Java CheckpointConfig怎么用?Java CheckpointConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testBasic

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
public void testBasic()
    throws DatabaseException {

    init();
    insertRecords();
    rmwModify();

    UtilizationProfile up =
        DbInternal.envGetEnvironmentImpl(env).getUtilizationProfile();

    /*
     * Checkpoint the environment to flush all utilization tracking
     * information before verifying.
     */
    CheckpointConfig ckptConfig = new CheckpointConfig();
    ckptConfig.setForce(true);
    env.checkpoint(ckptConfig);

    assertTrue(up.verifyFileSummaryDatabase());
}
 
开发者ID:nologic,项目名称:nabs,代码行数:21,代码来源:RMWLockingTest.java

示例2: batchClean

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
private void batchClean()
    throws DatabaseException {

    int cleaned = 0;
    int cleanedThisRound = 0;
    do {
        cleanedThisRound = env.cleanLog();
        cleaned += cleanedThisRound;
    } while (cleanedThisRound > 0);

    if (DEBUG) {
        System.out.println("numCleaned = " + cleaned);
    }

    assertTrue("cleaned must be > 0, was only " + cleaned +
               " but may vary on machine to machine", cleaned > 0);

    if (cleaned > 0) {
        CheckpointConfig force = new CheckpointConfig();
        force.setForce(true);
        env.checkpoint(force);
    }
}
 
开发者ID:nologic,项目名称:nabs,代码行数:24,代码来源:DeferredWriteTest.java

示例3: testBasic

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
public void testBasic()
    throws DatabaseException {

    init();
    insertRecords();
    rmwModify();

    UtilizationProfile up =
        DbInternal.envGetEnvironmentImpl(env).getUtilizationProfile();

    /* 
     * Checkpoint the environment to flush all utilization tracking
     * information before verifying.
     */
    CheckpointConfig ckptConfig = new CheckpointConfig();
    ckptConfig.setForce(true);
    env.checkpoint(ckptConfig);

    assertTrue(up.verifyFileSummaryDatabase());
}
 
开发者ID:nologic,项目名称:nabs,代码行数:21,代码来源:RMWLockingTest.java

示例4: invokeCheckpoint

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
/**
 * Invoke a checkpoint programatically. Note that only one checkpoint may
 * run at a time.
 */
public boolean invokeCheckpoint(CheckpointConfig config,
                                boolean flushAll,
                                String invokingSource)
    throws DatabaseException {

    if (checkpointer != null) {
        checkpointer.doCheckpoint(config, flushAll, invokingSource);
        return true;
    } else {
        return false;
    }
}
 
开发者ID:nologic,项目名称:nabs,代码行数:17,代码来源:EnvironmentImpl.java

示例5: onWakeup

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
/**
 * Called whenever the DaemonThread wakes up from a sleep.
 */
protected void onWakeup()
    throws DatabaseException {

    if (envImpl.isClosed()) {
        return;
    }

    doCheckpoint(CheckpointConfig.DEFAULT,
                 false, // flushAll
                 "daemon");
}
 
开发者ID:nologic,项目名称:nabs,代码行数:15,代码来源:Checkpointer.java

示例6: doAction

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
void doAction(ReleaseLatchesTest test, int exceptionCount)
    throws DatabaseException {

    test.modify(exceptionCount);
    CheckpointConfig config = new CheckpointConfig();
    config.setForce(true);
    if (DEBUG) {
        System.out.println("Got to checkpoint");
    }
    test.getEnv().checkpoint(config);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:12,代码来源:ReleaseLatchesTest.java

示例7: deleteAndLazyCompress

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
private void deleteAndLazyCompress(boolean doDups)
       throws DatabaseException {

       /* Position the cursor at the first BIN and delete both keys. */
       Cursor cursor = db.openCursor(null, null);
       OperationStatus status = cursor.getFirst(keyFound, dataFound, null);
       assertEquals(OperationStatus.SUCCESS, status);
       checkBinEntriesAndCursors(bin, 2, 1);

       status = cursor.delete();
       assertEquals(OperationStatus.SUCCESS, status);
       status = cursor.getNext(keyFound, dataFound, null);
       assertEquals(OperationStatus.SUCCESS, status);
status = cursor.delete();
assertEquals(OperationStatus.SUCCESS, status);
if (doDups) {
    status = cursor.getNext(keyFound, dataFound, null);
    assertEquals(OperationStatus.SUCCESS, status);
    status = cursor.delete();
    assertEquals(OperationStatus.SUCCESS, status);
}
       cursor.close();

       /*
 * Do lazy compression, leaving behind an empty BIN (and DBIN if dups.)
 */
       checkINCompQueueSize(doDups ? 2 : 1);
       CheckpointConfig config = new CheckpointConfig();
       config.setForce(true);
       env.checkpoint(config);
       checkBinEntriesAndCursors((doDups ? dbin : bin), 0, 0);

       /* BIN is empty but tree pruning hasn't happened. */
       assertEquals(2, in.getNEntries());
       checkINCompQueueSize(1);
   }
 
开发者ID:nologic,项目名称:nabs,代码行数:37,代码来源:INCompressorTest.java

示例8: init

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
private void init() {
    envHome = new File(System.getProperty(TestUtils.DEST_DIR));
    Key.DUMP_TYPE = DumpType.BINARY;
    envConfig = TestUtils.initEnvConfig();
    forceConfig = new CheckpointConfig();
    forceConfig.setForce(true);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:8,代码来源:RecoveryTestBase.java

示例9: invokeCheckpoint

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
/**
 * Invoke a checkpoint programatically. Note that only one checkpoint may
 * run at a time.
 */
public boolean invokeCheckpoint(CheckpointConfig config,
                                boolean flushAll,
                                String invokingSource) 
    throws DatabaseException {

    if (checkpointer != null) {
        checkpointer.doCheckpoint(config, flushAll, invokingSource);
        return true;
    } else {
        return false; 
    }
}
 
开发者ID:nologic,项目名称:nabs,代码行数:17,代码来源:EnvironmentImpl.java

示例10: onWakeup

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
/**
 * Called whenever the DaemonThread wakes up from a sleep.  
 */
protected void onWakeup()
    throws DatabaseException {

    if (envImpl.isClosed()) {
        return;
    }

    doCheckpoint(CheckpointConfig.DEFAULT,
                 false, // flushAll
                 "daemon");
}
 
开发者ID:nologic,项目名称:nabs,代码行数:15,代码来源:Checkpointer.java

示例11: doAction

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
void doAction(ReleaseLatchesTest test, int exceptionCount) 
    throws DatabaseException { 

    test.modify(exceptionCount);
    CheckpointConfig config = new CheckpointConfig();
    config.setForce(true);
    if (DEBUG) {
        System.out.println("Got to checkpoint");
    }
    test.getEnv().checkpoint(config);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:12,代码来源:ReleaseLatchesTest.java

示例12: deleteAndLazyCompress

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
private void deleteAndLazyCompress(boolean doDups)
       throws DatabaseException {

       /* Position the cursor at the first BIN and delete both keys. */
       Cursor cursor = db.openCursor(null, null);
       OperationStatus status = cursor.getFirst(keyFound, dataFound, null);
       assertEquals(OperationStatus.SUCCESS, status);
       checkBinEntriesAndCursors(bin, 2, 1);

       status = cursor.delete();
       assertEquals(OperationStatus.SUCCESS, status);
       status = cursor.getNext(keyFound, dataFound, null);
       assertEquals(OperationStatus.SUCCESS, status);
status = cursor.delete();
assertEquals(OperationStatus.SUCCESS, status);
if (doDups) {
    status = cursor.getNext(keyFound, dataFound, null);
    assertEquals(OperationStatus.SUCCESS, status);
    status = cursor.delete();
    assertEquals(OperationStatus.SUCCESS, status);
}
       cursor.close();

       /* 
 * Do lazy compression, leaving behind an empty BIN (and DBIN if dups.)
 */
       checkINCompQueueSize(doDups ? 2 : 1);
       CheckpointConfig config = new CheckpointConfig();
       config.setForce(true);
       env.checkpoint(config);
       checkBinEntriesAndCursors((doDups ? dbin : bin), 0, 0);

       /* BIN is empty but tree pruning hasn't happened. */
       assertEquals(2, in.getNEntries());
       checkINCompQueueSize(1);
   }
 
开发者ID:nologic,项目名称:nabs,代码行数:37,代码来源:INCompressorTest.java

示例13: init

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
private void init() {
    envHome = new File(System.getProperty(TestUtils.DEST_DIR));
    Key.DUMP_BINARY = true;
    envConfig = TestUtils.initEnvConfig();
    forceConfig = new CheckpointConfig();
    forceConfig.setForce(true);
}
 
开发者ID:nologic,项目名称:nabs,代码行数:8,代码来源:RecoveryTestBase.java

示例14: invokeCheckpoint

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
/**
 * Invoke a checkpoint programmatically. Note that only one checkpoint may
 * run at a time.
 */
public boolean invokeCheckpoint(CheckpointConfig config,
                                String invokingSource)
    throws DatabaseException {

    if (checkpointer != null) {
        checkpointer.doCheckpoint(config, invokingSource);
        return true;
    }
    return false;
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:15,代码来源:EnvironmentImpl.java

示例15: removeAndClean

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
private static void removeAndClean(Environment env,
                                   String name,
                                   boolean doCleaning)
    throws Exception {

    long a, c, d, e, f;

    Transaction txn = null;
    CheckpointConfig force = new CheckpointConfig();
    force.setForce(true);

    a = System.currentTimeMillis();
    env.removeDatabase(txn, name);
    c = System.currentTimeMillis();

    int cleanedCount = 0;
    if (doCleaning) {
        while (env.cleanLog() > 0) {
            cleanedCount++;
        }
    }
    d = System.currentTimeMillis();

    System.out.println("cleanedCount=" + cleanedCount);
    e = 0;
    f = 0;
    if (cleanedCount > 0) {
        e = System.currentTimeMillis();
        env.checkpoint(force);
        f = System.currentTimeMillis();
    }

    System.out.println("Remove of " + name  +
                       " remove: " + getSecs(a, c) +
                       " clean: " + getSecs(c, d) +
                       " checkpoint: " + getSecs(e, f));
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:38,代码来源:DbRunAction.java


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