MCPcopy Create free account
hub / github.com/BaseXdb/basex / purge

Method purge

basex-core/src/main/java/org/basex/index/IndexCache.java:116–131  ·  view source on GitHub ↗

Purges stale entries from the cache.

()

Source from the content-addressed store, hash-verified

114 * Purges stale entries from the cache.
115 */
116 private void purge() {
117 for(Object x; (x = queue.poll()) != null;) {
118 final BucketEntry e = (BucketEntry) x;
119 final int i = indexFor(e.hash, buckets.length);
120 BucketEntry prev = buckets[i], p = prev;
121 while(p != null) {
122 final BucketEntry next = p.next;
123 if(p == e) {
124 delete(i, e, prev, next);
125 break;
126 }
127 prev = p;
128 p = next;
129 }
130 }
131 }
132
133 /**
134 * Add a new index entry to the bucket with the specified index.

Callers 3

addMethod · 0.95
deleteMethod · 0.95
rehashMethod · 0.95

Calls 2

indexForMethod · 0.95
deleteMethod · 0.95

Tested by

no test coverage detected