• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CheckpointConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: onWakeup

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

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

    doCheckpoint(CheckpointConfig.DEFAULT, "daemon");
}
 
开发者ID:prat0318,项目名称:dbms,代码行数:14,代码来源:Checkpointer.java


示例17: env_checkpoint

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
@Override
protected void env_checkpoint(int kBytes, int minutes) throws Exception {
    CheckpointConfig cc = new CheckpointConfig();
    setIntParam(cc, "setKBytes", kBytes);
    setIntParam(cc, "setMinutes", minutes);
    mEnv.checkpoint(cc);
}
 
开发者ID:Carbonado,项目名称:CarbonadoSleepycatJE,代码行数:8,代码来源:JE_Repository.java


示例18: startup

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
public void startup(HGStore store, HGConfiguration config) {
	this.store = store;
	this.handleFactory = config.getHandleFactory();
	this.linkBinding = new LinkBinding(handleFactory);
	EnvironmentConfig envConfig = configuration.getEnvironmentConfig();
	envConfig.setConfigParam(EnvironmentConfig.CLEANER_THREADS, "5");
	if (config.isTransactional()) {
		configuration.configureTransactional();
	}
	
	File envDir = new File(store.getDatabaseLocation());
	envDir.mkdirs();
	
	try {
		env = new Environment(envDir, envConfig);
		data_db = env.openDatabase(null, DATA_DB_NAME, configuration.getDatabaseConfig().clone());
		primitive_db = env.openDatabase(null, PRIMITIVE_DB_NAME, configuration.getDatabaseConfig().clone());

		DatabaseConfig incConfig = configuration.getDatabaseConfig().clone();
		incConfig.setSortedDuplicates(true);
		incidence_db = env.openDatabase(null, INCIDENCE_DB_NAME, incConfig);

		openIndices = new HashMap<String, HGIndex<?,?>>();  //force reset since startup can follow a shutdown on same opened class
     
		if (config.isTransactional()) {
			CheckpointConfig ckptConfig = new CheckpointConfig();
			System.out.println("checkpoint kbytes:" + ckptConfig.getKBytes());
			System.out.println("checkpoint minutes:" + ckptConfig.getMinutes());
			env.checkpoint(null);
			checkPointThread = new CheckPointThread();
			checkPointThread.start();
		}
	}
	catch (Exception ex) {
		throw new HGException("Failed to initialize HyperGraph data store: " + ex.toString(), ex);
	}
}
 
开发者ID:armatys,项目名称:hypergraphdb-android,代码行数:38,代码来源:BJEStorageImplementation.java


示例19: checkpoint

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
/**
 * @see Environment#checkpoint(CheckpointConfig)
 */
public void checkpoint(CheckpointConfig ckptConfig) throws DatabaseException {
    delegate().checkpoint(ckptConfig);
}
 
开发者ID:jronrun,项目名称:benayn,代码行数:7,代码来源:Berkeley.java


示例20: startup

import com.sleepycat.je.CheckpointConfig; //导入依赖的package包/类
public void startup(HGStore store, HGConfiguration config)
{
	this.store = store;
	this.handleFactory = config.getHandleFactory();
	this.linkBinding = new LinkBinding(handleFactory);
	EnvironmentConfig envConfig = configuration.getEnvironmentConfig();
	envConfig.setConfigParam(EnvironmentConfig.CLEANER_THREADS, "5");
	envConfig.setClassLoader(new HGClassLoaderDelegate(config));
	if (config.isTransactional())
	{
		configuration.configureTransactional();
	}

	File envDir = new File(store.getDatabaseLocation());
	envDir.mkdirs();

	try
	{
		env = new Environment(envDir, envConfig);
		data_db = env.openDatabase(null, DATA_DB_NAME, configuration.getDatabaseConfig().clone());
		primitive_db = env.openDatabase(null, PRIMITIVE_DB_NAME, configuration.getDatabaseConfig().clone());

		DatabaseConfig incConfig = configuration.getDatabaseConfig().clone();
		incConfig.setSortedDuplicates(true);
		incidence_db = env.openDatabase(null, INCIDENCE_DB_NAME, incConfig);

		openIndices = new HashMap<String, HGIndex<?, ?>>(); // force reset
															// since startup
															// can follow a
															// shutdown on
															// same opened
															// class

		if (config.isTransactional())
		{
			CheckpointConfig ckptConfig = new CheckpointConfig();
			// System.out.println("checkpoint kbytes:" +
			// ckptConfig.getKBytes());
			// System.out.println("checkpoint minutes:" +
			// ckptConfig.getMinutes());
			env.checkpoint(null);
			checkPointThread = new CheckPointThread();
			checkPointThread.start();
		}
	}
	catch (Exception ex)
	{
		throw new HGException("Failed to initialize HyperGraph data store: " + ex.toString(), ex);
	}
}
 
开发者ID:hypergraphdb,项目名称:hypergraphdb,代码行数:51,代码来源:BJEStorageImplementation.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AnnotationMemberDeclaration类代码示例发布时间:2022-05-22
下一篇:
Java MessageId类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap