Package com.sleepycat.je

Examples of com.sleepycat.je.EnvironmentConfig


            operationList.add(OP_DB_STAT_INFO);

            /* Add checkpoint only for transactional environments. */
            boolean isTransactional = false;
            try {
                EnvironmentConfig config = targetEnv.getConfig();
                isTransactional = config.getTransactional();
            } catch (DatabaseException e) {
                /* Don't make any operations available. */
                return new ArrayList<MBeanOperationInfo>();
            }

View Full Code Here


    private void dumpCount() {

        /*
         * Initialize an environment configuration, and create an environment.
         */
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setReadOnly(true);
        envConfig.setAllowCreate(false);
        Environment env = new Environment(envHome, envConfig);

        List<String> databaseNames = new LinkedList<String>();
        databaseNames.addAll(env.getDatabaseNames());
        for (String dbName : databaseNames) {
View Full Code Here

                       "-verifyStream");
        }
    }

    public void run() {
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setReadOnly(true);
        Environment env = new Environment(envHome, envConfig);
        EnvironmentImpl envImpl = DbInternal.getEnvironmentImpl(env);

        try {
            FileReader reader;
View Full Code Here

        ReplicationConfig repConfig = new ReplicationConfig();
        repConfig.setNodeName(nodeName);
        repConfig.setGroupName(groupName);
        repConfig.setNodeHostPort(nodeHost);

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);

        return RepInternal.createDetachedEnv(envHome,
                                             repConfig,
                                             envConfig);
View Full Code Here

     */
    synchronized void doSetMutableConfig(EnvironmentMutableConfig config)
        throws DatabaseException {

        /* Clone the current config. */
        EnvironmentConfig newConfig =
            configManager.getEnvironmentConfig().clone();

        /* Copy in the mutable props. */
        DbInternal.copyMutablePropsTo(config, newConfig);

View Full Code Here

            throw new AttributeNotFoundException
                ("Attribute name can't be null.");
        }

        try {
            EnvironmentConfig envConfig = env.getConfig();
            if (attributeName.equals(ATT_ENV_HOME)) {
                return env.getHome().getCanonicalPath();
            } else if (attributeName.equals(ATT_IS_READ_ONLY)) {
                return new Boolean(envConfig.getReadOnly());
            } else if (attributeName.equals(ATT_IS_TRANSACTIONAL)) {
                return new Boolean(envConfig.getTransactional());
            } else if (attributeName.equals(ATT_CACHE_SIZE)) {
                return new Long(envConfig.getCacheSize());
            } else if (attributeName.equals(ATT_CACHE_PERCENT)) {
                return new Integer(envConfig.getCachePercent());
            } else if (attributeName.equals(ATT_LOCK_TIMEOUT)) {
                return new Long(envConfig.getLockTimeout());
            } else if (attributeName.equals(ATT_IS_SERIALIZABLE)) {
                return new
                    Boolean(envConfig.getTxnSerializableIsolation());
            } else if (attributeName.equals(ATT_TXN_TIMEOUT)) {
                return new Long(envConfig.getTxnTimeout());
            } else {
                throw new AttributeNotFoundException
                    ("Attribute " + attributeName + " is not valid.");
            }
        } catch (DatabaseException e) {
View Full Code Here

            attrList.add(OPEN_ATTR[i]);
        }

        /* Add attributes for an open, transactional Environment. */
        try {
            EnvironmentConfig config = env.getConfig();
            if (config.getTransactional()) {
                for (int i = 0; i < TRANSACTIONAL_ATTR.length; i++) {
                    attrList.add(TRANSACTIONAL_ATTR[i]);
                }
            }
        } catch (DatabaseException ignore) {
View Full Code Here

        return block;
    }

    public static Environment openEnv(String envDir) {
        /* Open the database environment. */
        EnvironmentConfig envConfig = new EnvironmentConfig();
        /* envConfig.setTransactional(false); */
        envConfig.setAllowCreate(false);
        envConfig.setReadOnly(true);
        try {
            return new Environment(new File(envDir), envConfig);
        } catch (EnvironmentLockedException e) {
            e.printStackTrace();
        } catch (DatabaseException e) {
View Full Code Here

     * 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

                        (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

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.