Tabnine Logo
KBucketSet.remove
Code IndexAdd Tabnine to your IDE (free)

How to use
remove
method
in
net.i2p.kademlia.KBucketSet

Best Java code snippets using net.i2p.kademlia.KBucketSet.remove (Showing top 4 results out of 315)

origin: i2p/i2p.i2p

public NodeInfo remove(NID nid) {
  _kad.remove(nid);
  return _nodeMap.remove(nid);
}
origin: i2p/i2p.i2p

/**
 *  Final remove for a router info.
 *  Do NOT use for leasesets.
 */
void dropAfterLookupFailed(Hash peer) {
  _context.peerManager().removeCapabilities(peer);
  _kb.remove(peer);
  //if (removed) {
  //    if (_log.shouldLog(Log.INFO))
  //        _log.info("Removed kbucket entry for " + peer);
  //}
  
  _ds.remove(peer);
}

origin: i2p/i2p.i2p

  public void timeReached() {
    if (!_isRunning)
      return;
    long now = _context.clock().now();
    int peerCount = 0;
    for (Iterator<NodeInfo> iter = DHTNodes.this.values().iterator(); iter.hasNext(); ) {
       NodeInfo peer = iter.next();
       if (peer.lastSeen() < now - _expireTime) {
         iter.remove();
         _kad.remove(peer.getNID());
       } else {
         peerCount++;
      }
    }
    if (peerCount > MAX_PEERS)
      _expireTime = Math.max(_expireTime - DELTA_EXPIRE_TIME, MIN_EXPIRE_TIME);
    else
      _expireTime = Math.min(_expireTime + DELTA_EXPIRE_TIME, MAX_EXPIRE_TIME);
    if (_log.shouldLog(Log.DEBUG))
      _log.debug("DHT storage cleaner done, now with " +
           peerCount + " peers, " +
           DataHelper.formatDuration(_expireTime) + " expiration");
    schedule(CLEAN_TIME);
  }
}
origin: i2p/i2p.i2p

/**
 *   Final remove for a leaseset.
 *   For a router info, will look up in the network before dropping.
 */
public void fail(Hash dbEntry) {
  if (!_initialized) return;
  DatabaseEntry o = _ds.get(dbEntry);
  if (o == null) {
    // if we dont know the key, lets make sure it isn't a now-dead peer
    _kb.remove(dbEntry);
    _context.peerManager().removeCapabilities(dbEntry);
    return;
  }
  if (o.getType() == DatabaseEntry.KEY_TYPE_ROUTERINFO) {
    lookupBeforeDropping(dbEntry, (RouterInfo)o);
    return;
  }
  // we always drop leaseSets that are failed [timed out],
  // regardless of how many routers we have.  this is called on a lease if
  // it has expired *or* its tunnels are failing and we want to see if there
  // are any updates
  if (_log.shouldLog(Log.INFO))
    _log.info("Dropping a lease: " + dbEntry);
  _ds.remove(dbEntry, false);
}

net.i2p.kademliaKBucketSetremove

Popular methods of KBucketSet

  • <init>
    Use the supplied trim strategy.
  • add
  • getClosest
    The keys closest to the key. Returned list will never contain us.
  • getExploreKeys
    For every bucket that hasn't been updated in this long, or isn't close to full, generate a random ke
  • toString
  • clear
  • generateRandomKey
    Generate a random key to go within this bucket Package private for testing only. Others shouldn't ne
  • getAll
  • getRange
    The number of bits minus 1 (range number) for the xor of the key. Package private for testing only.
  • size
    The current number of entries.
  • createBucket
  • createBuckets
  • createBucket,
  • createBuckets,
  • getBucket,
  • getBuckets,
  • getReadLock,
  • getWriteLock,
  • locked_split,
  • makeKey,
  • pickBucket

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now