Package com.sleepycat.je

Examples of com.sleepycat.je.Durability


                       int commitMasterNodeId)
        throws DatabaseException {

        LoggerUtils.fine(logger, envImpl, "commit called for " + getId());
        setRepContext(clientRepContext);
        Durability durability = null;
        if (syncPolicy == SyncPolicy.SYNC) {
            durability = Durability.COMMIT_SYNC;
        } else if (syncPolicy == SyncPolicy.NO_SYNC) {
            durability = Durability.COMMIT_NO_SYNC;
        } else if (syncPolicy == SyncPolicy.WRITE_NO_SYNC) {
View Full Code Here


     *
     * @see DbResetRepGroup
     */
     public void reset() {

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

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setAllowCreate(true);
View Full Code Here

               DatabaseException,
               InterruptedException,
               ChecksumException {

        /* Create a single replicator */
        Durability durability = new Durability(SyncPolicy.NO_SYNC,
                                               SyncPolicy.NO_SYNC,
                                               ReplicaAckPolicy.NONE);

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setAllowCreate(false);
View Full Code Here

        /*
         * Set the ReplicaAckPolicy to ALL, so that all the replicas can get
         * into a same sync point.
         */
        Durability durability =
            new Durability(Durability.SyncPolicy.WRITE_NO_SYNC,
                           Durability.SyncPolicy.WRITE_NO_SYNC,
                           Durability.ReplicaAckPolicy.ALL);

        envConfig.setDurability(durability);
        repConfig.setHelperHosts(helperHost);
View Full Code Here

            DatabaseImpl newDbImpl = null;
            Txn txn = null;
            try {
                TransactionConfig txnConfig = new TransactionConfig();
                txnConfig.setDurability(new Durability(SyncPolicy.SYNC,
                                                       SyncPolicy.SYNC,
                                                       ReplicaAckPolicy.NONE));
                txnConfig.setConsistencyPolicy(NO_CONSISTENCY);
                txn = new MasterTxn(this,
                                    txnConfig,
View Full Code Here

        autoCommitTxnConfig = new TransactionConfig();
        autoCommitNoWaitTxnConfig = new TransactionConfig();
        autoCommitNoWaitTxnConfig.setNoWait(true);
        /* <!-- begin JE only --> */
        if (!storeConfig.getReplicated()) {
            final Durability envDurability = env.getConfig().getDurability();
            configForNonRepDb(autoCommitTxnConfig, envDurability);
            configForNonRepDb(autoCommitNoWaitTxnConfig, envDurability);
        }
        /* <!-- end JE only --> */

 
View Full Code Here

     * - ReplicaAckPolicy.NONE to avoid consistency checks on the Master
     * - Consistency.NONE to avoid consistency checks on the Replica
     */
    private static void configForNonRepDb(TransactionConfig config,
                                          Durability envDurability) {
        config.setDurability(new Durability
            (envDurability.getLocalSync(), envDurability.getReplicaSync(),
             Durability.ReplicaAckPolicy.NONE));
        config.setConsistencyPolicy
            (NoConsistencyRequiredPolicy.NO_CONSISTENCY);
    }
View Full Code Here

     * Modify the log files in the environment directory to add a modicum of
     * replication required metadata.
     */
     public void convert() {

        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);
View Full Code Here

     * Modify the log files in the environment directory to add a modicum of
     * replication required metadata.
     */
     public void convert() {

        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);
View Full Code Here

    public void testSetMessageStoreDurability() throws Exception
    {
        ReplicatedEnvironmentFacade master = createMaster();
        assertEquals("Unexpected message store durability",
                new Durability(Durability.SyncPolicy.NO_SYNC, Durability.SyncPolicy.NO_SYNC, Durability.ReplicaAckPolicy.SIMPLE_MAJORITY),
                master.getRealMessageStoreDurability());
        assertEquals("Unexpected durability", TEST_DURABILITY, master.getMessageStoreDurability());
        assertTrue("Unexpected coalescing sync", master.isCoalescingSync());

        master.setMessageStoreDurability(Durability.SyncPolicy.WRITE_NO_SYNC, Durability.SyncPolicy.SYNC, Durability.ReplicaAckPolicy.ALL);
        assertEquals("Unexpected message store durability",
                new Durability(Durability.SyncPolicy.WRITE_NO_SYNC, Durability.SyncPolicy.SYNC, Durability.ReplicaAckPolicy.ALL),
                master.getRealMessageStoreDurability());
        assertFalse("Coalescing sync committer is still running", master.isCoalescingSync());
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.je.Durability

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.