Package com.sleepycat.je

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


            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

      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

        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

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

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

            }
        }
    }

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

        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

        throws Exception {

        DbSpace space = new DbSpace();
        space.parseArgs(argv);

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setReadOnly(true);
        Environment env = new Environment(space.envHome, envConfig);
        space.initEnv(DbInternal.getEnvironmentImpl(env));

        try {
            space.print(System.out);
View Full Code Here

    void openEnv()
        throws Exception {

        if (env == null) {
            EnvironmentConfig envConfig = new EnvironmentConfig();
            envConfig.setReadOnly(openReadOnly);
            env = new Environment(envHome, 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.