Package org.infinispan.remoting

Examples of org.infinispan.remoting.ReplicationQueue


         }
      }
   }

   private static void clearReplicationQueues(Cache cache) {
      ReplicationQueue queue = TestingUtil.extractComponent(cache, ReplicationQueue.class);
      if (queue != null) queue.reset();
   }
View Full Code Here


         }
      }
   }

   private static void clearReplicationQueues(Cache cache) {
      ReplicationQueue queue = TestingUtil.extractComponent(cache, ReplicationQueue.class);
      if (queue != null) queue.reset();
   }
View Full Code Here

               .replQueueInterval(config.clustering().async().replQueueInterval())
               .replQueueMaxElements(config.clustering().async().replQueueMaxElements())
               .useReplQueue(config.clustering().async().useReplQueue());


         ReplicationQueue replQueue = config.clustering().async().replQueue();
         if (replQueue != null) {
            legacy.clustering().async().replQueueClass(replQueue.getClass());
         }
      }

      if (config.clustering().hash().hash() != null) {
         legacy.clustering()
View Full Code Here

         }
      }
   }

   private static void clearReplicationQueues(Cache cache) {
      ReplicationQueue queue = TestingUtil.extractComponent(cache, ReplicationQueue.class);
      if (queue != null) queue.reset();
   }
View Full Code Here

         }
      }
   }

   private static void clearReplicationQueues(Cache cache) {
      ReplicationQueue queue = TestingUtil.extractComponent(cache, ReplicationQueue.class);
      if (queue != null) queue.reset();
   }
View Full Code Here

         }
      }
   }

   private static void clearReplicationQueues(Cache cache) {
      ReplicationQueue queue = TestingUtil.extractComponent(cache, ReplicationQueue.class);
      if (queue != null) queue.reset();
   }
View Full Code Here

      verifyInitialData(cache3);

      int count = writerThread.result();

      // Wait for the replication queue to be emptied
      final ReplicationQueue replQueue1 = cache1.getAdvancedCache().getComponentRegistry().getComponent(ReplicationQueue.class);
      eventually(new Condition() {
         @Override
         public boolean isSatisfied() throws Exception {
            return replQueue1.getElementsCount() == 0;
         }
      });

      // Wait a little longer, even the replication queue sends the commands asynchronously
      Thread.sleep(1000);
View Full Code Here

    * <tt>replQueueInterval</tt> is reached.
    */
   public void testReplicationBasedOnTime() throws Exception {
      //only place one element, queue size is 10.
      cache1.put("key", "value");
      ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class);
      assertNotNull(replicationQueue);
      assertEquals(1, replicationQueue.getElementsCount());
      assertNull(cache2.get("key"));
      assertEquals("value", cache1.get("key"));

      replicationQueue.flush();

      // Now wait until values are replicated properly
      eventually(new Condition() {
         @Override
         public boolean isSatisfied() throws Exception {
            return cache2.get("key") != null;
         }
      });
      assertEquals(cache2.get("key"), "value");
      assertEquals(0, replicationQueue.getElementsCount());
   }
View Full Code Here

      TransactionManager transactionManager = TestingUtil.getTransactionManager(cache1);
      transactionManager.begin();
      cache1.put("key", "value");
      transactionManager.commit();

      ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class);
      assertNotNull(replicationQueue);
      assertEquals(replicationQueue.getElementsCount(), 1);
      assertNull(cache2.get("key"));
      assertEquals(cache1.get("key"), "value");

      replicationQueue.flush();

      // Now wait until values are replicated properly
      eventually(new Condition() {
         @Override
         public boolean isSatisfied() throws Exception {
            return cache2.get("key") != null;
         }
      });
      assertEquals(cache2.get("key"), "value");
      assertEquals(0, replicationQueue.getElementsCount());
   }
View Full Code Here

         @Override
         public boolean isSatisfied() throws Exception {
            return cache2.size() == numThreads * numLoopsPerThread;
         }
      });
      ReplicationQueue replicationQueue = TestingUtil.extractComponent(cache1, ReplicationQueue.class);
      assertEquals(0, replicationQueue.getElementsCount());
   }
View Full Code Here

TOP

Related Classes of org.infinispan.remoting.ReplicationQueue

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.