@Override public String toString() { return root.toString(); }
void insert(byte[] k, long v) throws IOException { if (n == capacity) { int t = capacity / 2; Page left = allocate(leaf); Page right = allocate(leaf); left.copyFrom(this, 0, t); left.n = t; right.copyFrom(this, t, capacity - t); right.n = capacity - t; leaf = false; set(0, left.k(0), left.number); set(1, right.k(0), right.number); n = 2; left.write(); right.write(); } insertNonFull(k, v); }
public void toString(StringBuilder sb, String indent) throws IOException { for (int i = 0; i < n; i++) { sb.append(String.format("%s %02d:%02d %20s %s %d%n", indent, number, i, hex(k(i), 0, 4), leaf ? "==" : "->", c(i))); if (!leaf) { long c = c(i); Page sub = getPage((int) c); sub.toString(sb, indent + " "); } } }
public Iterator<byte[]> iterator() { return root.iterator(); } }
int pos(int i) { return START_OFFSET + size(i); }
public long search(byte[] k) throws Exception { return root.search(k); }
public void insert(byte[] k, long v) throws Exception { root.insert(k, v); }
QueryOptions options = QueryOptions.newBuilder().setOffset(0).setLimit(50); IndexSpec indexSpec = IndexSpec.newBuilder().setName("Beneficiaries").build(); Index index = SearchServiceFactory.getSearchService().getIndex(indexSpec); Results<ScoredDocument>results = index.search(query);
void insert(byte[] k, long v) throws IOException { if (n == capacity) { int t = capacity / 2; Page left = allocate(leaf); Page right = allocate(leaf); left.copyFrom(this, 0, t); left.n = t; right.copyFrom(this, t, capacity - t); right.n = capacity - t; leaf = false; set(0, left.k(0), left.number); set(1, right.k(0), right.number); n = 2; left.write(); right.write(); } insertNonFull(k, v); }
public Iterator<byte[]> iterator() { return root.iterator(); } }
@Override public String toString() { return root.toString(); }
int pos(int i) { return START_OFFSET + size(i); }
public long search(byte[] k) throws Exception { return root.search(k); }
public void insert(byte[] k, long v) throws Exception { root.insert(k, v); }
public Iterator<byte[]> iterator() { return root.iterator(); } }