pos = node.highestPos() + 2; } else { pos = node.binarySearch(highKey); if (pos < 0) { // highKey is not found pos = ~pos; int lowPos = node.binarySearch(lowKey); if (!node.isLeaf()) { lowPos = Node.internalPos(lowPos);
/** * Performs a binary search against the split, returning the position * within the original node as if it had not split. */ final int binarySearchLeaf(Node node, byte[] key) throws IOException { Node sibling = latchSibling(); Node left, right; if (mSplitRight) { left = node; right = sibling; } else { left = sibling; right = node; } int searchPos; if (compare(key) < 0) { searchPos = left.binarySearch(key); } else { int highestPos = left.highestLeafPos(); searchPos = right.binarySearch(key); if (searchPos < 0) { searchPos = searchPos - highestPos - 2; } else { searchPos = highestPos + 2 + searchPos; } } sibling.releaseShared(); return searchPos; }
/** * Performs a binary search against the split, returning the position * within the original node as if it had not split. */ final int binarySearchLeaf(Node node, byte[] key) throws IOException { Node sibling = latchSibling(); Node left, right; if (mSplitRight) { left = node; right = sibling; } else { left = sibling; right = node; } int searchPos; if (compare(key) < 0) { searchPos = left.binarySearch(key); } else { int highestPos = left.highestLeafPos(); searchPos = right.binarySearch(key); if (searchPos < 0) { searchPos = searchPos - highestPos - 2; } else { searchPos = highestPos + 2 + searchPos; } } sibling.releaseShared(); return searchPos; }
/** * Performs a binary search against the split, returning the position * within the original node as if it had not split. */ final int binarySearchLeaf(Node node, byte[] key) throws IOException { Node sibling = latchSibling(); Node left, right; if (mSplitRight) { left = node; right = sibling; } else { left = sibling; right = node; } int searchPos; if (compare(key) < 0) { searchPos = left.binarySearch(key); } else { int highestPos = left.highestLeafPos(); searchPos = right.binarySearch(key); if (searchPos < 0) { searchPos = searchPos - highestPos - 2; } else { searchPos = highestPos + 2 + searchPos; } } sibling.releaseShared(); return searchPos; }
pos = node.highestPos() + 2; } else { pos = node.binarySearch(highKey); if (pos < 0) { // highKey is not found pos = ~pos; int lowPos = node.binarySearch(lowKey); if (!node.isLeaf()) { lowPos = Node.internalPos(lowPos);
pos = node.highestPos() + 2; } else { pos = node.binarySearch(highKey); if (pos < 0) { // highKey is not found pos = ~pos; int lowPos = node.binarySearch(lowKey); if (!node.isLeaf()) { lowPos = Node.internalPos(lowPos);
throws IOException int pos = binarySearch(okey); if (!forInsert) { if (pos < 0) {
throws IOException int pos = binarySearch(okey); if (!forInsert) { if (pos < 0) {
throws IOException int pos = binarySearch(okey); if (!forInsert) { if (pos < 0) {
if (node.mSplit == null) { try { pos = node.binarySearch(key); } catch (Throwable e) { node.releaseShared(); int childPos; try { childPos = Node.internalPos(node.binarySearch(key)); } catch (Throwable e) { node.releaseShared(); if (split.compare(key) < 0) { selected = left; selectedPos = Node.internalPos(left.binarySearch(key)); frame.bind(node, selectedPos); right.releaseShared(); } else { selected = right; selectedPos = Node.internalPos(right.binarySearch(key)); frame.bind(node, left.highestInternalPos() + 2 + selectedPos); left.releaseShared();
if (node.mSplit == null) { try { pos = node.binarySearch(key); } catch (Throwable e) { node.releaseShared(); int childPos; try { childPos = Node.internalPos(node.binarySearch(key)); } catch (Throwable e) { node.releaseShared(); if (split.compare(key) < 0) { selected = left; selectedPos = Node.internalPos(left.binarySearch(key)); frame.bind(node, selectedPos); right.releaseShared(); } else { selected = right; selectedPos = Node.internalPos(right.binarySearch(key)); frame.bind(node, left.highestInternalPos() + 2 + selectedPos); left.releaseShared();
if (node.mSplit == null) { try { pos = node.binarySearch(key); } catch (Throwable e) { node.releaseShared(); int childPos; try { childPos = Node.internalPos(node.binarySearch(key)); } catch (Throwable e) { node.releaseShared(); if (split.compare(key) < 0) { selected = left; selectedPos = Node.internalPos(left.binarySearch(key)); frame.bind(node, selectedPos); right.releaseShared(); } else { selected = right; selectedPos = Node.internalPos(right.binarySearch(key)); frame.bind(node, left.highestInternalPos() + 2 + selectedPos); left.releaseShared();
int childPos; try { childPos = Node.internalPos(node.binarySearch(key)); } catch (Throwable e) { node.releaseShared(); int pos = node.binarySearch(key);
int childPos; try { childPos = Node.internalPos(node.binarySearch(key)); } catch (Throwable e) { node.releaseShared();
int pos = node.binarySearch(key, startPos); pos = Node.internalPos(node.binarySearch(key, frame.mNodePos)); } catch (Throwable e) { node.releaseShared();
int pos = node.binarySearch(key, startPos); pos = Node.internalPos(node.binarySearch(key, frame.mNodePos)); } catch (Throwable e) { node.releaseShared();
int pos = node.binarySearch(key, startPos); pos = Node.internalPos(node.binarySearch(key, frame.mNodePos)); } catch (Throwable e) { node.releaseShared();
int spos = 0; if (lowKey != null) { spos = Node.internalPos(node.binarySearch(lowKey));
int spos = 0; if (lowKey != null) { spos = Node.internalPos(node.binarySearch(lowKey));
int spos = 0; if (lowKey != null) { spos = Node.internalPos(node.binarySearch(lowKey));