Package org.infinispan.remoting.transport

Examples of org.infinispan.remoting.transport.Address


         start();
   }

   @Override
   public Object getCollocatedKey(Object otherKey) {
      Address address = getAddressForKey(otherKey);
      return getKeyForAddress(address);
   }
View Full Code Here


      private void generateKeys() {
         maxNumberInvariant.readLock().lock();
         try {
            while (maxNumberOfKeys.get() != exitingNumberOfKeys.get()) {
               Object key = keyGenerator.getKey();
               Address addressForKey = getAddressForKey(key);
               if (interestedInAddress(addressForKey)) {
                  tryAddKey(addressForKey, key);
               }
            }
            keyProducerStartLatch.close();
View Full Code Here

    * If none exists, will be created first.
    */
   public LocalTransaction getOrCreateLocalTransaction(Transaction transaction, InvocationContext ctx) {
      LocalTransaction current = localTransactions.get(transaction);
      if (current == null) {
         Address localAddress = rpcManager != null ? rpcManager.getTransport().getAddress() : null;
         GlobalTransaction tx = gtf.newGlobalTransaction(localAddress, false);
         if (trace) log.trace("Created a new GlobalTransaction {0}", tx);
         current = new LocalTransaction(transaction, tx);
         localTransactions.put(transaction, current);
         notifier.notifyTransactionRegistered(tx, ctx);
View Full Code Here

         start();
   }

   @Override
   public Object getCollocatedKey(Object otherKey) {
      Address address = getAddressForKey(otherKey);
      return getKeyForAddress(address);
   }
View Full Code Here

      private void generateKeys() {
         maxNumberInvariant.readLock().lock();
         try {
            while (!Thread.currentThread().isInterrupted() && exitingNumberOfKeys.get() < maxNumberOfKeys.get()) {
               Object key = keyGenerator.getKey();
               Address addressForKey = getAddressForKey(key);
               if (interestedInAddress(addressForKey)) {
                  tryAddKey(addressForKey, key);
               }
            }
            keyProducerStartLatch.close();
View Full Code Here

      @Override
      public void emitNotification(List<Address> oldMembers, View newView) {
         MergeView mv = (MergeView) newView;

         final Address address = getAddress();
         final int viewId = (int) newView.getVid().getId();
         notifier.notifyMerge(members, oldMembers, address, viewId, getSubgroups(mv.getSubgroups()));
      }
View Full Code Here

   }

   private void abortIfRemoteTransactionInvalid(TxInvocationContext ctx, AbstractTransactionBoundaryCommand c) {
      // this check fixes ISPN-777
      if (!ctx.isOriginLocal()) {
         Address origin = c.getGlobalTransaction().getAddress();
         if (!transport.getMembers().contains(origin))
            throw new CacheException("Member " + origin + " no longer in cluster. Forcing tx rollback for " + c.getGlobalTransaction());
      }
   }
View Full Code Here

      if (isVirtualNodesEnabled()) {
         for (Address a : newCaches) {
            for (int i = 1; i < numVirtualNodes; i++) {
               // we get the normalized hash from the VirtualAddress, but we store the real address in the positions map
               Address va = new VirtualAddress(a, i);
               addNode(positions, a, getNormalizedHash(va));
            }
         }
      }
View Full Code Here

    */
   private List<Address> locateInternal(Object key, int replCount, Address target) {
      int actualReplCount = Math.min(replCount, caches.size());
      int keyNormalizedHash = getNormalizedHash(getGrouping(key));
      int firstOwnerIndex = getPositionIndex(keyNormalizedHash);
      Address firstOwner = positionValues[firstOwnerIndex];

      List<Address> owners = new ArrayList<Address>(actualReplCount);
      owners.add(firstOwner);
      if (owners.size() >= actualReplCount)
         return owners;
View Full Code Here

      }
      return state;
   }
  
   private boolean shouldTransferOwnershipFromLeftNodes(Object k) {     
      Address self = transport.getAddress();     
      int numCopies = configuration.getNumOwners();
     
      List<Address> oldList = oldCH.locate(k, numCopies);
      boolean localToThisNode = oldList.indexOf(self) >= 0;
      boolean senderIsNewOwner = newCH.isKeyLocalToAddress(sender, k, numCopies);
View Full Code Here

TOP

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

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.