Examples of EnvironmentConfig


Examples of com.sleepycat.je.EnvironmentConfig

     * separate environments or databases in the same environment.
     */
    private boolean diff()
        throws Exception {

        EnvironmentConfig envConfiguration = new EnvironmentConfig();
        envConfiguration.setReadOnly(true);
        envConfiguration.setCachePercent(40);
        Environment env1 = new Environment(home1, envConfiguration);

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setReadOnly(true);
        DbInternal.setUseExistingConfig(dbConfig, true);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

                        (nextArg + " is not a supported option.");
                }
                whichArg++;
            }

            EnvironmentConfig envConfig = new EnvironmentConfig();

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

                envConfig.setReadOnly(true);
            }

            /*
             * If evicting, scan the given database first and don't run the
             * background evictor.
             */
            if (doAction == EVICT) {
                envConfig.setConfigParam
                    (EnvironmentParams.ENV_RUN_EVICTOR.getName(), "false");
                envConfig.setConfigParam
                    (EnvironmentParams.EVICTOR_CRITICAL_PERCENTAGE.getName(),
                     "1000");
            }

            /*
             * If cleaning, disable the daemon cleaner threads.  The work being
             * done by these threads is aborted when the environment is closed,
             * which can result in incomplete log cleaning.
             */
            if (doAction == BATCH_CLEAN) {
                envConfig.setConfigParam
                    (EnvironmentParams.ENV_RUN_CLEANER.getName(), "false");
            }

            recoveryStart = System.currentTimeMillis();

View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

                progressInterval = totalLoadBytes / 20;
            }
        }
        BufferedReader reader = new BufferedReader(new InputStreamReader(is));

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setAllowCreate(true);
        Environment env = new Environment(envHome, envConfig);
        ret.setEnv(env);
        ret.setDbName(dbName);
        ret.setInputReader(reader);
        ret.setNoOverwrite(noOverwrite);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        Durability durability =
            new Durability(Durability.SyncPolicy.WRITE_NO_SYNC,
                           Durability.SyncPolicy.WRITE_NO_SYNC,
                           Durability.ReplicaAckPolicy.SIMPLE_MAJORITY);

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

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

Examples of com.sleepycat.je.EnvironmentConfig

    private Set<Environment> unreservedStores;
    private AggregatedBdbEnvironmentStats aggBdbStats;

    public BdbStorageConfiguration(VoldemortConfig config) {
        this.voldemortConfig = config;
        environmentConfig = new EnvironmentConfig();
        environmentConfig.setTransactional(true);
        if(config.isBdbWriteTransactionsEnabled() && config.isBdbFlushTransactionsEnabled()) {
            environmentConfig.setDurability(Durability.COMMIT_SYNC);
        } else if(config.isBdbWriteTransactionsEnabled() && !config.isBdbFlushTransactionsEnabled()) {
            environmentConfig.setDurability(Durability.COMMIT_WRITE_NO_SYNC);
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

                          int nodeMax) throws Exception {
        this.cluster = new ClusterMapper().readCluster(new File(clusterXmlPath));
        this.storeName = storeName;

        // Configure src environment handle
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);
        envConfig.setAllowCreate(false);
        envConfig.setReadOnly(false);
        envConfig.setCacheSize(1024 * 1024 * 1024);

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(false);
        dbConfig.setSortedDuplicates(areDuplicatesNeededForSrc());
        dbConfig.setReadOnly(true);

        srcEnv = new Environment(new File(sourceEnvPath), envConfig);
        srcDB = srcEnv.openDatabase(null, storeName, dbConfig);

        // Configure dest environment handle
        File newEnvDir = new File(destEnvPath);
        if(!newEnvDir.exists()) {
            newEnvDir.mkdirs();
        }

        envConfig = new EnvironmentConfig();
        envConfig.setTransactional(false);
        envConfig.setAllowCreate(true);
        envConfig.setReadOnly(false);
        envConfig.setCacheSize(1024 * 1024 * 1024);
        envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX,
                                 Long.toString(logFileSize * 1024L * 1024L));
        envConfig.setDurability(Durability.COMMIT_NO_SYNC);

        dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(false);
        dbConfig.setAllowCreate(true);
        dbConfig.setSortedDuplicates(areDuplicatesNeededForDest());
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

  @Override
  public <Z, D extends Database<Z>> StateManager createStateManager(DatabaseCluster<Z, D> cluster)
  {
    String location = MessageFormat.format(this.locationPattern, cluster.getId(), Strings.HA_JDBC_HOME);
    EnvironmentConfig config = new EnvironmentConfig().setAllowCreate(true).setTransactional(true);
    return new BerkeleyDBStateManager(cluster, new File(location), config, new GenericObjectPoolFactory(this));
  }
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

  public void initializeDB(final String thePath, final String theDbName)
      throws DatabaseException {
    path = thePath;
    dbName = theDbName;

    EnvironmentConfig environmentConfig = new EnvironmentConfig();
    environmentConfig.setAllowCreate(true);
    environmentConfig.setTransactional(true);
//environmentConfig.setTransactional(false); TODO MC
//environmentConfig.setReadOnly(true); TODO MC
    environmentConfig.setConfigParam("je.log.fileMax",JE_LOG_FILEMAX);
    File file = new File(path);
    if(!file.isDirectory()) {
      if(!file.mkdirs()) {
        throw new DatabaseException("failed mkdirs(" + path + ")");
      }
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

        init();       
    }
   
    protected void init() {
        try {
            EnvironmentConfig envConf = new EnvironmentConfig();
            envConf.setAllowCreate(true);
            File envDir = new File(dir);
            if (!envDir.exists())
                envDir.mkdirs();
            env = new Environment(envDir, envConf);
           
View Full Code Here

Examples of com.sleepycat.je.EnvironmentConfig

    /** @return eg "bdbstore-v4" - used for copying store */
    protected abstract String getStoreDirectoryName();

    protected Environment createEnvironment(File storeLocation)
    {
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setAllowCreate(true);
        envConfig.setTransactional(true);
        envConfig.setConfigParam("je.lock.nLockTables", "7");
        envConfig.setReadOnly(false);
        envConfig.setSharedCache(false);
        envConfig.setCacheSize(0);
        return new Environment(storeLocation, envConfig);
    }
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.