Package net.tomp2p.message

Examples of net.tomp2p.message.TrackerData


        //not there anymore
        i--;
      }
    }
   
    TrackerData data = new TrackerData(retVal, peers.peerAddresses().size() > size);
    return data;
  }
View Full Code Here


    TrackerData data = new TrackerData(retVal, peers.peerAddresses().size() > size);
    return data;
  }

  public static TrackerData disjunction(TrackerData meshPeers, SimpleBloomFilter<Number160> knownPeers) {
    TrackerData trackerData = new TrackerData(new HashMap<PeerStatistic, Data>());
    for (Map.Entry<PeerStatistic, Data> entry : meshPeers.peerAddresses().entrySet()) {
      if (!knownPeers.contains(entry.getKey().peerAddress().peerId())) {
        trackerData.put(entry.getKey(), entry.getValue());
      }
    }
    return trackerData;
  }
View Full Code Here

            throw new IllegalArgumentException("Message content is wrong");
        }
        final Number160 locationKey = message.key(0);
        final Number160 domainKey = message.key(1);
        Number320 key = new Number320(locationKey, domainKey);
        final TrackerData tmp = message.trackerData(0);
        peerExchange.put(key, tmp, message.sender());
      
        if(message.isUdp()) {
            responder.responseFireAndForget();
        } else {
View Full Code Here

    builder.futureChannelCreator().addListener(new BaseFutureAdapter<FutureChannelCreator>() {
      @Override
      public void operationComplete(final FutureChannelCreator futureChannelCreator2) throws Exception {
        if (futureChannelCreator2.isSuccess()) {
             
          TrackerData peers = trackerStorage.peers(new Number320(builder.locationKey(), builder
                  .domainKey()));
          NavigableSet<PeerAddress> queue = new TreeSet<PeerAddress>(PeerMap.createComparator(stableRandom));
          if(peers != null && peers.peerAddresses()!=null) {
            for (PeerStatistic peerAddress : peers.peerAddresses().keySet()) {
              queue.add(peerAddress.peerAddress());
            }
          }

          if (queue.size() > MIN_TRACKER_PEERS) {
View Full Code Here

                && futureResponse.responseMessage().type() == Type.PARTIALLY_OK;
        if (future.isSuccess() || isFull) {
          if (!isFull) {
            successAsked.add(futureResponse.request().recipient());
          }
          TrackerData newDataMap = futureResponse.responseMessage().trackerData(0);
          if (newDataMap != null) {
            Collection<PeerStatistic> newPeers = newDataMap.peerAddresses().keySet();
            mergeDiff(secondaryQueue, newPeers, alreadyAsked, queueToAsk);
            storeResult(peerOnTracker, newDataMap, futureResponse.request().recipient(), knownPeers);
            for(PeerStatistic peerStatatistic:newPeers) {
              secondaryQueue.add(peerStatatistic.peerAddress());
            }
View Full Code Here

      Collection<Number320> keys = trackerStorage.keys();
      if (keys == null || keys.size() == 0) {
        return null;
      }
      Number320 key = Utils.pollRandom(keys, rnd);
      TrackerData trackerData = trackerStorage.peers(key);
      if (trackerData == null) {
        return null;
      }
      Collection<PeerStatistic> peerStatatistics = trackerData.peerAddresses().keySet();
      if (peerStatatistics == null || peerStatatistics.size() == 0) {
        return null;
      }
      peerStatatistics.remove(new PeerStatistic(self));
      if (peerStatatistics.size() == 0) {
View Full Code Here

TOP

Related Classes of net.tomp2p.message.TrackerData

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.