/** * 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(); }
@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(); } }