Examples of EnvironmentConfig


Examples of com.sleepycat.je.EnvironmentConfig

                attrList.add(OPEN_ATTR[i]);
            }

            /* Add attributes for an open, transactional environment. */
            try {
                EnvironmentConfig config = targetEnv.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

Examples of com.sleepycat.je.EnvironmentConfig

                return new Boolean(openConfig.getTxnSerializableIsolation());
            } else {
                /* The rest are JE environment attributes. */
                if (targetEnv != null) {

                    EnvironmentConfig config = targetEnv.getConfig();

                    if (attributeName.equals(ATT_IS_READ_ONLY)) {
                        return new Boolean(config.getReadOnly());
                    } else if (attributeName.equals(ATT_IS_TRANSACTIONAL)) {
                        return new Boolean(config.getTransactional());
                    } else if (attributeName.equals(ATT_CACHE_SIZE)) {
                        return new Long(config.getCacheSize());
                    } else if (attributeName.equals(ATT_CACHE_PERCENT)) {
                        return new Integer(config.getCachePercent());
                    } else if (attributeName.equals(ATT_LOCK_TIMEOUT)) {
                        return new Long(config.getLockTimeout());
                    } else if (attributeName.equals(ATT_IS_SERIALIZABLE)) {
                        return new
                            Boolean(config.getTxnSerializableIsolation());
                    } else if (attributeName.equals(ATT_TXN_TIMEOUT)) {
                        return new Long(config.getTxnTimeout());
                    } else {
                        throw new AttributeNotFoundException
                            ("attribute " + attributeName + " is not valid.");
                    }
                }
View Full Code Here

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

Examples of com.sleepycat.je.EnvironmentConfig

    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

Examples of com.sleepycat.je.EnvironmentConfig

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

Examples of com.sleepycat.je.EnvironmentConfig

        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

Examples of com.sleepycat.je.EnvironmentConfig

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

Examples of com.sleepycat.je.EnvironmentConfig

            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

Examples of com.sleepycat.je.EnvironmentConfig

            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

Examples of com.sleepycat.je.EnvironmentConfig

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