Package org.infinispan.client.hotrod.impl.transport.tcp

Examples of org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory$FailoverToRequestBalancingStrategyDelegate


      assertEquals(0, c4.size());

   }

   private RoundRobinBalancingStrategy getBalancer() {
      TcpTransportFactory transportFactory = (TcpTransportFactory) TestingUtil.extractField(remoteCache.getRemoteCacheManager(), "transportFactory");
      return (RoundRobinBalancingStrategy) TestingUtil.extractField(transportFactory, "balancer");
   }
View Full Code Here


      RemoteCacheManager rcm = client(0);
      RemoteCache<Object, Object> cache = rcm.getCache();
      // This will initialize the consistent hash
      cache.put("k", "v");

      TcpTransportFactory transportFactory = (TcpTransportFactory) TestingUtil.extractField(rcm, "transportFactory");
      ConsistentHash ch = transportFactory.getConsistentHash();
      byte[][] keys = new byte[NUM_KEYS][];

      for (int i = 0; i < NUM_KEYS; i++) {
         keys[i] = String.valueOf(i).getBytes("UTF-8");
      }
View Full Code Here

      RemoteCacheManager rcm = client(0);
      RemoteCache<Object, Object> cache = rcm.getCache();
      // This will initialize the consistent hash
      cache.put("k", "v");

      TcpTransportFactory transportFactory = (TcpTransportFactory) TestingUtil.extractField(rcm, "transportFactory");
      ConsistentHash ch = transportFactory.getConsistentHash();
      byte[][] keys = new byte[NUM_KEYS][];

      for (int i = 0; i < NUM_KEYS; i++) {
         keys[i] = String.valueOf(i).getBytes("UTF-8");
      }
View Full Code Here

      runTest(2);
      runTest(3);
   }

   private org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash extractClientConsistentHash() {
      TcpTransportFactory transport = (TcpTransportFactory) TestingUtil.extractField(remoteCacheManager, "transport");
      return transport.getConsistentHash();
   }
View Full Code Here

      ex.shutdownNow();
      kaf.stop();

      remoteCache.put(key, "v");
      assertOnlyServerHit(getAddress(hotRodServer2));
      TcpTransportFactory tcpTp = (TcpTransportFactory) TestingUtil.extractField(remoteCacheManager, "transportFactory");

      Marshaller sm = new JBossMarshaller();
      TcpTransport transport = (TcpTransport) tcpTp.getTransport(sm.objectToByteBuffer(key, 64));
      try {
      assertEquals(transport.getServerAddress(), new InetSocketAddress("localhost", hotRodServer2.getPort()));
      } finally {
         tcpTp.releaseTransport(transport);
      }


      log.info("About to stop Hot Rod server 2");
      hotRodServer2.stop();
View Full Code Here

      RemoteCacheManager rcm = client(0);
      RemoteCache<Object, Object> cache = rcm.getCache();
      // This will initialize the consistent hash
      cache.put("k", "v");

      TcpTransportFactory transportFactory = TestingUtil.extractField(rcm, "transportFactory");
      ConsistentHash ch = transportFactory.getConsistentHash(RemoteCacheManager.cacheNameBytes());
      byte[][] keys = new byte[NUM_KEYS][];

      for (int i = 0; i < NUM_KEYS; i++) {
         keys[i] = String.valueOf(i).getBytes("UTF-8");
      }
View Full Code Here

      hotrodClientConf.setProperty("infinispan.client.hotrod.ping_on_startup", "false");

      remoteCacheManager = new RemoteCacheManager(hotrodClientConf);
      remoteCache = remoteCacheManager.getCache();

      TcpTransportFactory tcpConnectionFactory = (TcpTransportFactory) extractField(remoteCacheManager, "transportFactory");
      connectionPool = (GenericKeyedObjectPool<?, ?>) extractField(tcpConnectionFactory, "connectionPool");
      workerThread1 = new WorkerThread(remoteCache);
      workerThread2 = new WorkerThread(remoteCache);
      workerThread3 = new WorkerThread(remoteCache);
      workerThread4 = new WorkerThread(remoteCache);
View Full Code Here

      assertEquals(0, c4.size());

   }

   private RoundRobinBalancingStrategy getBalancer() {
      TcpTransportFactory transportFactory = TestingUtil.extractField(remoteCache.getRemoteCacheManager(), "transportFactory");
      Map<byte[], RoundRobinBalancingStrategy> balancers = TestingUtil.extractField(transportFactory, "balancers");
      return balancers.get(RemoteCacheManager.cacheNameBytes());
   }
View Full Code Here

      withRemoteCacheManager(new RemoteCacheManagerCallable(
            new RemoteCacheManager(props)) {
         @Override
         public void call() {
            TcpTransportFactory tcpConnectionFactory = (TcpTransportFactory)
                  TestingUtil.extractField(rcm, "transportFactory");
            for (int i = 0; i < 10; i++) {
               if (tcpConnectionFactory.getServers().size() == 1) {
                  TestingUtil.sleepThread(1000);
               } else {
                  break;
               }
            }
            assertEquals(2, tcpConnectionFactory.getServers().size());
         }
      });
   }
View Full Code Here

      withRemoteCacheManager(new RemoteCacheManagerCallable(
            new RemoteCacheManager(props)) {
         @Override
         public void call() {
            TcpTransportFactory tcpConnectionFactory = (TcpTransportFactory)
                  TestingUtil.extractField(rcm, "transportFactory");
            assertEquals(1, tcpConnectionFactory.getServers().size());
         }
      });
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory$FailoverToRequestBalancingStrategyDelegate

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.