Package com.sleepycat.je

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


{
  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

                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

        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

                                                                        + "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

        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

        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

        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

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        this.envConfig = new EnvironmentConfig();
        this.envConfig.setDurability(Durability.COMMIT_NO_SYNC);
        this.envConfig.setAllowCreate(true);
        this.envConfig.setTransactional(true);
        this.tempDir = TestUtils.createTempDir();
        this.environment = new Environment(this.tempDir, envConfig);
View Full Code Here

    // STORAGE_PATH = storagePath + "/" + hostname ;
    _storagePath = storagePath;
  }

  private void createStore() {
    final EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setAllowCreate(true);
    envConfig.setLocking(false); // no concurrent accesses
    envConfig.setTransactional(false);
    envConfig.setConfigParam("je.env.runCheckpointer", "false");
    envConfig.setConfigParam("je.cleaner.minUtilization", "25");
    // envConfig.setConfigParam("je.env.runCleaner", "false");
    // envConfig.ENV_DUP_CORRECT_PRELOAD_ALL false
    // envConfig.setConfigParam("je.log.fileMax", "100000000"); // 100MB
   
    // Disk space grows exponentially for skewed data
    //   independently of cacheSize, cacheMode
    //   BerkeleyDBStoreSkewed reduces the effect, but not completely
    // Keep in mind that it's impossible to obtain strong scalability with fixed amount of cache memory
    //   as the proportion of data in disk in cache grows in disk favor, and disk is slower
    // When scaling, it is important to keep the number of disk readers/writers constant per blade
    envConfig.setCacheSize(512 * 1024 * 1024);
   
    final File envDir = new File(_storagePath);
    if (!envDir.exists())
      envDir.mkdirs();
    _env = new Environment(envDir, envConfig);
View Full Code Here

TOP

Related Classes of com.sleepycat.je.EnvironmentConfig

Copyright © 2018 www.massapicom. 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.