Examples of EnvironmentConfig


Examples of com.sleepycat.je.EnvironmentConfig

    @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

Examples of com.sleepycat.je.EnvironmentConfig

    // 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

Examples of com.sleepycat.je.EnvironmentConfig

      defaultTxnConfig.setSerializableIsolation(true);
      break;
  default:
      throw new AssertionError();
  }
  EnvironmentConfig config = new EnvironmentConfig();
  config.setAllowCreate(true);
  config.setExceptionListener(new LoggingExceptionListener());
  /*
   * Note that it seems that the lock timeout value needs to be set on
   * the BDB JE environment in order to control how quickly deadlocks are
   * detected.  Setting the value on the transaction appears to have no
   * effect on deadlock detection.  -tjb@sun.com (11/05/2007)
   */
   config.setLockTimeout(lockTimeoutMicros);
  config.setTransactional(true);
  config.setTxnWriteNoSync(!flushToDisk);
  for (Enumeration<?> names = propertiesWithDefaults.propertyNames();
       names.hasMoreElements(); )
  {
      Object key = names.nextElement();
      if (key instanceof String) {
    String property = (String) key;
    if (property.startsWith("je.")) {
        config.setConfigParam(
      property,
      propertiesWithDefaults.getProperty(property));
    }
      }
  }
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

            try {

                File dir = new File(data.dataDir);
                FileUtils.mkdir(dir, true);
                final EnvironmentConfig dbEnvConfig = new EnvironmentConfig();
                dbEnvConfig.setTransactional(true);
                dbEnvConfig.setAllowCreate(true);
                dbEnvConfig.setLockTimeout(5, TimeUnit.SECONDS);
                environment = new Environment(dir, dbEnvConfig);
                final DatabaseConfig dbConfig = new DatabaseConfig();
                dbConfig.setTransactional(true);
                dbConfig.setAllowCreate(true);
                database = environment.openDatabase(null, name, dbConfig);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

      listener.onInfo(Thread.currentThread(), null, "file -> " + f.getAbsolutePath() + " delete success !");
    }
   
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    EnvironmentConfig ec = new EnvironmentConfig();
    ec.setAllowCreate(true);
    env = new Environment(dir, ec);
    db = env.openDatabase(null, name, dbConfig);
    lastDocID = 0;
  }
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        Durability durability =
            new Durability(Durability.SyncPolicy.SYNC,
                           Durability.SyncPolicy.SYNC,
                           Durability.ReplicaAckPolicy.NONE);

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setAllowCreate(true);
        envConfig.setTransactional(true);
        envConfig.setDurability(durability);

        ReplicationConfig repConfig =
            new ReplicationConfig(groupName, nodeName, nodeHostPort);
        repConfig.setHelperHosts(repConfig.getNodeHostPort());
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

     */
    public static EnvironmentImpl makeUtilityEnvironment(File envHome,
                                                         boolean readOnly)
        throws EnvironmentNotFoundException, EnvironmentLockedException {

        EnvironmentConfig config = new EnvironmentConfig();
        config.setReadOnly(readOnly);

        /* Don't debug log to the database log. */
        config.setConfigParam(EnvironmentParams.JE_LOGGING_DBLOG.getName(),
                              "false");

        /* Don't run recovery. */
        config.setConfigParam(EnvironmentParams.ENV_RECOVERY.getName(),
                              "false");

        /* Apply the configuration in the je.properties file. */
        DbConfigManager.applyFileConfig
            (envHome, DbInternal.getProps(config), false);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

     */
    protected void openEnv(boolean doRecovery)
        throws EnvironmentNotFoundException, EnvironmentLockedException {

        if (env == null) {
            EnvironmentConfig envConfiguration = new EnvironmentConfig();
            envConfiguration.setReadOnly(true);
            /* Don't run recovery. */
            envConfiguration.setConfigParam
                (EnvironmentParams.ENV_RECOVERY.getName(),
                 doRecovery ? "true" : "false");
            /* Even without recovery, scavenger needs comparators. */
            envConfiguration.setConfigParam
                (EnvironmentParams.ENV_COMPARATORS_REQUIRED.getName(), "true");
       
            env = new Environment(envHome, envConfiguration);
        }
    }
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

            }
        }
    }

    private Environment openMeasureEnvironment(final boolean createNew) {
        final EnvironmentConfig config = envConfig.clone();
        config.setCachePercent(90);
        return openEnvironment(config, createNew);
    }
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        config.setCachePercent(90);
        return openEnvironment(config, createNew);
    }

    private Environment openCalcEnvironment(final boolean createNew) {
        final EnvironmentConfig config = envConfig.clone();
        return openEnvironment(config, createNew);
    }
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.