Tabnine Logo
KBucketSet.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
net.i2p.kademlia.KBucketSet
constructor

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

origin: i2p/i2p.i2p

public DHTNodes(I2PAppContext ctx, NID me) {
  _context = ctx;
  _expireTime = MAX_EXPIRE_TIME;
  _log = _context.logManager().getLog(DHTNodes.class);
  _nodeMap = new ConcurrentHashMap<NID, NodeInfo>();
  _kad = new KBucketSet<NID>(ctx, me, KAD_K, KAD_B, new KBTrimmer(ctx, KAD_K));
}
origin: i2p/i2p.i2p

public void setUp(){
  context = I2PAppContext.getGlobalContext();
  log = context.logManager().getLog(KBucketSet.class);
  byte[] us = new byte[Hash.HASH_LENGTH];
  context.random().nextBytes(us);
  usHash = new Hash(us);
      // We use the default RandomTrimmer so add() will never fail
  set = new KBucketSet<Hash>(context, usHash, K, B);
  // tests may be run in any order so prime it
  addRandom(1000);
}

origin: i2p/i2p.i2p

RouterInfo ri = _context.router().getRouterInfo();
String dbDir = _context.getProperty(PROP_DB_DIR, DEFAULT_DB_DIR);
_kb = new KBucketSet<Hash>(_context, ri.getIdentity().getHash(),
              BUCKET_SIZE, KAD_B, new RejectTrimmer<Hash>());
try {
net.i2p.kademliaKBucketSet<init>

Javadoc

Use the default trim strategy, which removes a random entry.

Popular methods of KBucketSet

  • 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
  • size
    The current number of entries.
  • createBucket
  • createBuckets
  • createBucket,
  • createBuckets,
  • getBucket,
  • getBuckets,
  • getReadLock,
  • getWriteLock,
  • locked_split,
  • makeKey,
  • pickBucket

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • startActivity (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • JCheckBox (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Best plugins for Eclipse
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