com.sleepycat.je.Durability.ReplicaAckPolicy Java Examples

The following examples show how to use com.sleepycat.je.Durability.ReplicaAckPolicy. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReplicatedEnvironmentFacade.java    From qpid-broker-j with Apache License 2.0 6 votes vote down vote up
/**
 * This method should only be invoked from configuration thread on virtual host activation.
 * Otherwise, invocation of this method whilst coalescing committer is committing transactions might result in transaction aborts.
 */
public void setMessageStoreDurability(SyncPolicy localTransactionSynchronizationPolicy, SyncPolicy remoteTransactionSynchronizationPolicy, ReplicaAckPolicy replicaAcknowledgmentPolicy)
{
    if (_messageStoreDurability == null || localTransactionSynchronizationPolicy != _messageStoreDurability.getLocalSync()
            || remoteTransactionSynchronizationPolicy != _messageStoreDurability.getReplicaSync()
            || replicaAcknowledgmentPolicy != _messageStoreDurability.getReplicaAck())
    {
        _messageStoreDurability = new Durability(localTransactionSynchronizationPolicy, remoteTransactionSynchronizationPolicy, replicaAcknowledgmentPolicy);

        if (_coalescingCommiter != null)
        {
            _coalescingCommiter.stop();
            _coalescingCommiter = null;
        }

        if (localTransactionSynchronizationPolicy == LOCAL_TRANSACTION_SYNCHRONIZATION_POLICY)
        {
            localTransactionSynchronizationPolicy = SyncPolicy.NO_SYNC;
            _coalescingCommiter = new CoalescingCommiter(_configuration.getGroupName(), this);
            _coalescingCommiter.start();
        }
        _realMessageStoreDurability = new Durability(localTransactionSynchronizationPolicy, remoteTransactionSynchronizationPolicy, replicaAcknowledgmentPolicy);
    }
}