Package org.infinispan.remoting.transport

Examples of org.infinispan.remoting.transport.DistributedSync


         if (txLogActivated) transactionLog.deactivate();
      }
   }

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.tracef("Transaction log size is %s", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.tracef("Tx Log remaining entries = %d", size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock(true);
      }
   }
View Full Code Here


         if (txLogActivated) transactionLog.deactivate();
      }
   }

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.tracef("Transaction log size is %s", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.tracef("Tx Log remaining entries = %d", size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock(true);
      }
   }
View Full Code Here

         if (txLogActivated) transactionLog.deactivate();
      }
   }

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is {0}", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock();
      }
   }
View Full Code Here

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      // todo this should be configurable
      int maxNonProgressingLogWrites = 100;
      int flushTimeout = 60000;

      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is {0}", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock();
      }
   }
View Full Code Here

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      // todo this should be configurable
      int maxNonProgressingLogWrites = 100;
      int flushTimeout = 60000;

      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is {0}", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock();
      }
   }
View Full Code Here

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      // todo this should be configurable
      int maxNonProgressingLogWrites = 100;
      int flushTimeout = 60000;

      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is {0}", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock();
      }
   }
View Full Code Here

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      // todo this should be configurable
      int maxNonProgressingLogWrites = 100;
      int flushTimeout = 60000;

      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is {0}", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock();
      }
   }
View Full Code Here

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      // todo this should be configurable
      int maxNonProgressingLogWrites = 100;
      int flushTimeout = 60000;

      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is {0}", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock();
      }
   }
View Full Code Here

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      // todo this should be configurable
      int maxNonProgressingLogWrites = 100;
      int flushTimeout = 60000;

      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is {0}", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock();
      }
   }
View Full Code Here

         if (txLogActivated) transactionLog.deactivate();
      }
   }

   private void generateTransactionLog(ObjectOutput oo) throws Exception {
      DistributedSync distributedSync = rpcManager.getTransport().getDistributedSync();

      try {
         if (trace) log.trace("Transaction log size is %s", transactionLog.size());
         for (int nonProgress = 0, size = transactionLog.size(); size > 0;) {
            if (trace) log.trace("Tx Log remaining entries = " + size);
            transactionLog.writeCommitLog(marshaller, oo);
            int newSize = transactionLog.size();

            // If size did not decrease then we did not make progress, and could be wasting
            // our time. Limit this to the specified max.
            if (newSize >= size && ++nonProgress >= maxNonProgressingLogWrites)
               break;

            size = newSize;
         }

         // Wait on incoming and outgoing threads to line-up in front of
         // the distributed sync.
         distributedSync.acquireProcessingLock(true, configuration.getStateRetrievalTimeout(), MILLISECONDS);

         // Signal to sender that we need a flush to get a consistent view
         // of the remaining transactions.
         delimit(oo);
         oo.flush();
         if (trace) log.trace("Waiting for a distributed sync block");
         distributedSync.blockUntilAcquired(flushTimeout, MILLISECONDS);

         if (trace) log.trace("Distributed sync block received, proceeding with writing commit log");
         // Write remaining transactions
         transactionLog.writeCommitLog(marshaller, oo);
         delimit(oo);

         // Write all non-completed prepares
         transactionLog.writePendingPrepares(marshaller, oo);
         delimit(oo);
         oo.flush();
      }
      finally {
         distributedSync.releaseProcessingLock(true);
      }
   }
View Full Code Here

TOP

Related Classes of org.infinispan.remoting.transport.DistributedSync

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.