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

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

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

origin: i2p/i2p.i2p

/**
 *  This is fast and doesn't use synchronization,
 *  but it includes both routerinfos and leasesets.
 *  Use it to avoid deadlocks.
 *  No - not true - the KBS contains RIs only.
 */
protected int getKBucketSetSize() {  
  if (_kb == null) return 0;
  return _kb.size();
}

origin: i2p/i2p.i2p

  @Override
  public String toString() {
    StringBuilder buf = new StringBuilder(1024);
    buf.append("<div class=\"debug_container buckets\">");
    buf.append("<hr><b>Bucket set rooted on:</b> ").append(_us.toString())
      .append(" K=").append(BUCKET_SIZE)
      .append(" B=").append(B_VALUE)
      .append(" with ").append(size())
      .append(" keys in ").append(_buckets.size()).append(" buckets:<br>\n");
    getReadLock();
    try {
      int len = _buckets.size();
      for (int i = 0; i < len; i++) {
        KBucket<T> b = _buckets.get(i);
        buf.append("<b>Bucket ").append(i).append("/").append(len).append(":</b> ");
        buf.append(b.toString()).append("<br>\n");
      }
    } finally { releaseReadLock(); }
    buf.append("</div>");
    return buf.toString();
  }
}
origin: i2p/i2p.i2p

               ((ROUTER_INFO_EXPIRATION - ROUTER_INFO_EXPIRATION_MIN) * MIN_ROUTERS / (_kb.size() + 1)));
int existing = _kb.size();
if (existing >= MIN_REMAINING_ROUTERS) {
  if (_log.shouldLog(Log.INFO))
net.i2p.kademliaKBucketSetsize

Javadoc

The current number of entries.

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.
  • remove
  • createBucket
  • createBuckets
  • createBucket,
  • createBuckets,
  • getBucket,
  • getBuckets,
  • getReadLock,
  • getWriteLock,
  • locked_split,
  • makeKey,
  • pickBucket

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • CodeWhisperer alternatives
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