Examples of locate()


Examples of org.infinispan.distribution.ConsistentHash.locate()

   }

   private Address getAddressForKey(Object key) {
      DistributionManager distributionManager = getDistributionManager();
      ConsistentHash hash = distributionManager.getConsistentHash();
      List<Address> addressList = hash.locate(key, 1);
      if (addressList.size() == 0) {
         throw new IllegalStateException("Empty address list returned by consistent hash " + hash + " for key " + key);
      }
      return addressList.get(0);
   }
View Full Code Here

Examples of org.infinispan.distribution.DistributionManager.locate()

   protected <K> Map<Address, List<K>> mapKeysToNodes(K... input) {
      DistributionManager dm = cache.getDistributionManager();
      Map<Address, List<K>> addressToKey = new HashMap<Address, List<K>>();
      for (K key : input) {
         List<Address> nodesForKey = dm.locate(key);
         Address ownerOfKey = nodesForKey.get(0);
         List<K> keysAtNode = addressToKey.get(ownerOfKey);
         if (keysAtNode == null) {
            keysAtNode = new ArrayList<K>();
            addressToKey.put(ownerOfKey, keysAtNode);
View Full Code Here

Examples of org.infinispan.distribution.DistributionManager.locate()

            // since keys and values are on all nodes, lets just pick randomly
            Collections.shuffle(members);
            ownerOfKey = members.get(0);
         } else {
            // DIST mode
            List<Address> owners = dm.locate(key);
            List<Address> filtered = filterMembers(policy, owners);
            if(!filtered.isEmpty()){
               ownerOfKey = filtered.get(0);
            } else {
               ownerOfKey = owners.get(0);
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locate()

   }

   private Address getAddressForKey(Object key) {
      DistributionManager distributionManager = getDistributionManager();
      ConsistentHash hash = distributionManager.getConsistentHash();
      List<Address> addressList = hash.locate(key, 1);
      if (addressList.size() == 0) {
         throw new IllegalStateException("Empty address list returned by consistent hash " + hash + " for key " + key);
      }
      return addressList.get(0);
   }
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locate()

   }

   private Address getAddressForKey(Object key) {
      DistributionManager distributionManager = getDistributionManager();
      ConsistentHash hash = distributionManager.getConsistentHash();
      List<Address> addressList = hash.locate(key, 1);
      if (addressList.size() == 0) {
         throw new IllegalStateException("Empty address list returned by consistent hash " + hash + " for key " + key);
      }
      return addressList.get(0);
   }
View Full Code Here

Examples of org.infinispan.distribution.ch.ConsistentHash.locate()

         if (!joiners.isEmpty()) {
            // roll back local transactions if their main data owner has changed
            if (configuration.isEagerLockingSingleNodeInUse()) {
               for (LocalTransaction localTx : localTransactions.values()) {
                  for (Object k : localTx.getAffectedKeys()) {
                     Address newMainOwner = chNew.locate(k, 1).get(0);
                     if (joiners.contains(newMainOwner)) {
                        localTx.markForRollback(true);
                        if (trace) log.tracef("Marked local transaction for rollback, as the main data " +
                                                   "owner has changed %s", localTx);
                        break;
View Full Code Here

Examples of org.infinispan.distribution.ch.DefaultConsistentHash.locate()

      // Making use of Mock Objects for non-critical components helps isolate the problem you are trying to test.
      dch.setCaches(new HashSet(Arrays.asList(EasyMock.createNiceMock(Address.class),
                                  EasyMock.createNiceMock(Address.class),
                                  EasyMock.createNiceMock(Address.class))));

      List<Address> a = dch.locate("somekey", 2);
      assert a.size() == 2 : "Was expecting 2 entries in the location list";
   }
}
View Full Code Here

Examples of org.jpox.StateManager.locate()

            StateManager sm = om.findStateManager(pc);
            if (om.getApiAdapter().isDeleted(pc))
            {
                try
                {
                    sm.locate();
                }
                catch (JPOXObjectNotFoundException ex)
                {
                    // the instance has been flushed, and it was not found, so we return null
                    return null;
View Full Code Here

Examples of org.objectstyle.wolips.locate.Locate.locate()

            IFile wodFile = null;
            try {
              ComponentLocateScope componentLocateScope = ComponentLocateScope.createLocateScope(javaProject.getProject(), fileName);
              LocalizedComponentsLocateResult localizedComponentsLocateResult = new LocalizedComponentsLocateResult();
              Locate locate = new Locate(componentLocateScope, localizedComponentsLocateResult);
              locate.locate();
              wodFile = localizedComponentsLocateResult.getFirstWodFile();
            } catch (CoreException e) {
              LaunchingPlugin.getDefault().log(e);
            } catch (LocateException e) {
              LaunchingPlugin.getDefault().log(e);
View Full Code Here

Examples of org.openide.modules.InstalledFileLocator.locate()

        return userDir;*/
       
        URL url;
        try {
            InstalledFileLocator locator = InstalledFileLocator.getDefault();
            File directory = locator.locate("modules/lib", "org.tod", false);
            return directory.getAbsolutePath() + File.separator;
        } catch (Exception ex) {
            Logger.getLogger(TODUtils.class.getName()).log(Level.SEVERE, null, ex);
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.