Examples of EnvironmentConfig


Examples of com.sleepycat.db.EnvironmentConfig

      defaultTxnConfig.setReadCommitted(false);
      break;
  default:
      throw new AssertionError();
  }
  EnvironmentConfig config = new EnvironmentConfig();
  config.setAllowCreate(true);
  config.setCacheSize(cacheSize);
  config.setErrorHandler(new LoggingErrorHandler());
  config.setInitializeCache(true);
  config.setInitializeLocking(true);
  config.setInitializeLogging(true);
  config.setLockDetectMode(LockDetectMode.YOUNGEST);
  config.setLockTimeout(lockTimeoutMicros);
  config.setLogAutoRemove(removeLogs);
  config.setMessageHandler(new LoggingMessageHandler());
  config.setRunRecovery(true);
  config.setTransactional(true);
  config.setTxnWriteNoSync(!flushToDisk);
  try {
      env = new Environment(new File(directory), config);
  } catch (FileNotFoundException e) {
      throw new DbDatabaseException(
    "DataStore directory does not exist: " + directory);
View Full Code Here

Examples of com.sleepycat.db.EnvironmentConfig

                if (name.startsWith("__") || name.startsWith("log."))
                    files[i].delete();
            }
        }

        EnvironmentConfig envConfig = new EnvironmentConfig();
        DatabaseConfig dbConfig = new DatabaseConfig();

        envConfig.setTransactional(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        envConfig.setInitializeLogging(true);
        envConfig.setAllowCreate(true);
        envConfig.setThreaded(true);
        dbConfig.setAllowCreate(true);
        dbConfig.setType(DatabaseType.BTREE);

        env = new Environment(dbHome, envConfig);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

    File folder = new File(storageFolder);
    if (!folder.exists()) {
      folder.mkdirs();
    }

    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setAllowCreate(true);
    envConfig.setTransactional(resumable);
    envConfig.setLocking(resumable);

    File envHome = new File(storageFolder + "/frontier");
    if (!envHome.exists()) {
      envHome.mkdir();
    }
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

{
  this.DBDIR = dirname;
  if (env != null) return false;
  try
  {
   EnvironmentConfig econfig = new EnvironmentConfig();
   econfig.setAllowCreate(!readOnly); econfig.setReadOnly(readOnly);
   //econfig.setTransactional(true);
   env = new Environment( new File (dirname), econfig);

   //*-- initializes the database hash with the list of databases in the environment
   dbMap = new HashMap<String,Database>();
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

                if (name.endsWith("jdb") || name.equals("je.lck"))
                    files[i].delete();
            }
        }

        EnvironmentConfig envConfig = new EnvironmentConfig();
        DatabaseConfig dbConfig = new DatabaseConfig();

        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        dbConfig.setAllowCreate(true);
        dbConfig.setTransactional(true);

        env = new Environment(dbHome, envConfig);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        replicationConfig.setHelperHosts(_helperHostPort);
        replicationConfig.setDesignatedPrimary(_designatedPrimary);
        setReplicationConfigProperties(replicationConfig);

        final EnvironmentConfig envConfig = createEnvironmentConfig();
        envConfig.setDurability(_durability);

        ReplicatedEnvironment replicatedEnvironment = null;
        try
        {
            replicatedEnvironment = new ReplicatedEnvironment(environmentPath, replicationConfig, envConfig);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

                                                                        + "storeB").exists()));
    }

    @Test
    public void testUnsharedCache() throws DatabaseException {
        EnvironmentConfig environmentConfig = new EnvironmentConfig();
        environmentConfig.setDurability(Durability.COMMIT_NO_SYNC);
        environmentConfig.setAllowCreate(true);
        environmentConfig.setTransactional(true);
        environmentConfig.setSharedCache(false);
        environmentConfig.setCacheSize(CACHE_SIZE);

        DatabaseConfig databaseConfig = new DatabaseConfig();
        databaseConfig.setAllowCreate(true);
        databaseConfig.setTransactional(true);
        databaseConfig.setSortedDuplicates(true);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        assertEquals("MaxCacheSize < 2 * CACHE_SIZE", true, maxCacheSize < 2 * CACHE_SIZE);
    }

    @Test
    public void testSharedCache() throws DatabaseException {
        EnvironmentConfig environmentConfig = new EnvironmentConfig();
        environmentConfig.setDurability(Durability.COMMIT_NO_SYNC);
        environmentConfig.setAllowCreate(true);
        environmentConfig.setTransactional(true);
        environmentConfig.setSharedCache(true);
        environmentConfig.setCacheSize(CACHE_SIZE);

        DatabaseConfig databaseConfig = new DatabaseConfig();
        databaseConfig.setAllowCreate(true);
        databaseConfig.setTransactional(true);
        databaseConfig.setSortedDuplicates(true);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        final int totalSize = Integer.parseInt(args[2]);
        final int increment = Integer.parseInt(args[3]);
        final int threads = Integer.parseInt(args[4]);

        Environment environment;
        EnvironmentConfig environmentConfig;
        DatabaseConfig databaseConfig;

        environmentConfig = new EnvironmentConfig();
        environmentConfig.setCacheSize(cacheSize);
        environmentConfig.setDurability(Durability.COMMIT_NO_SYNC);
        environmentConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX, "1000000000");
        environmentConfig.setConfigParam(EnvironmentConfig.CLEANER_MAX_BATCH_FILES, "100");
        environmentConfig.setConfigParam(EnvironmentConfig.CLEANER_READ_SIZE, "52428800");
        environmentConfig.setAllowCreate(true);
        environmentConfig.setTransactional(true);
        databaseConfig = new DatabaseConfig();
        databaseConfig.setAllowCreate(true);
        // databaseConfig.setDeferredWrite(true);
        databaseConfig.setTransactional(true);
        databaseConfig.setNodeMaxEntries(1024);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        String storeName = args[1];
        String serverProperties = args[2];

        VoldemortConfig config = new VoldemortConfig(new Props(new File(serverProperties)));

        EnvironmentConfig environmentConfig = new EnvironmentConfig();
        environmentConfig.setDurability(Durability.COMMIT_NO_SYNC);
        environmentConfig.setAllowCreate(true);
        environmentConfig.setTransactional(config.isBdbWriteTransactionsEnabled());
        Environment environment = new Environment(new File(bdbDir), environmentConfig);
        DatabaseConfig databaseConfig = new DatabaseConfig();
        databaseConfig.setAllowCreate(true);
        databaseConfig.setTransactional(config.isBdbWriteTransactionsEnabled());
        databaseConfig.setSortedDuplicates(false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.