/** * When binding to a node which is in a split state, the position must be adjusted in order * for rebindFrame to work properly. The position cannot be used for accessing entries * until after rebindFrame is called, or if retrieveLeafValue is called. * * @param pos non-negative bind position * @return adjusted bind position */ final int adjustBindPosition(int pos) { if (!mSplitRight) { // To prevent the rebind operation from breaking things, the position must be // defined as though it was created before the node was split. When rebindFrame is // called, the position is moved to the correct location. Node sibling = latchSibling(); pos += sibling.highestPos() + 2; sibling.releaseShared(); } return pos; }
/** * When binding to a node which is in a split state, the position must be adjusted in order * for rebindFrame to work properly. The position cannot be used for accessing entries * until after rebindFrame is called, or if retrieveLeafValue is called. * * @param pos non-negative bind position * @return adjusted bind position */ final int adjustBindPosition(int pos) { if (!mSplitRight) { // To prevent the rebind operation from breaking things, the position must be // defined as though it was created before the node was split. When rebindFrame is // called, the position is moved to the correct location. Node sibling = latchSibling(); pos += sibling.highestPos() + 2; sibling.releaseShared(); } return pos; }
/** * When binding to a node which is in a split state, the position must be adjusted in order * for rebindFrame to work properly. The position cannot be used for accessing entries * until after rebindFrame is called, or if retrieveLeafValue is called. * * @param pos non-negative bind position * @return adjusted bind position */ final int adjustBindPosition(int pos) { if (!mSplitRight) { // To prevent the rebind operation from breaking things, the position must be // defined as though it was created before the node was split. When rebindFrame is // called, the position is moved to the correct location. Node sibling = latchSibling(); pos += sibling.highestPos() + 2; sibling.releaseShared(); } return pos; }
int highestPos = node.highestPos(); if (pos > highestPos) { Node sibling = latchSibling(); try { return sibling.retrieveLeafValue(pos - highestPos - 2); Node sibling = latchSibling(); try { int highestPos = sibling.highestPos();
int highestPos = node.highestPos(); if (pos > highestPos) { Node sibling = latchSibling(); try { return sibling.retrieveLeafValue(pos - highestPos - 2); Node sibling = latchSibling(); try { int highestPos = sibling.highestPos();
int highestPos = node.highestPos(); if (pos > highestPos) { Node sibling = latchSibling(); try { return sibling.retrieveLeafValue(pos - highestPos - 2); Node sibling = latchSibling(); try { int highestPos = sibling.highestPos();
/** * Returns the highest position within the original node as if it had not split. */ final int highestPos(Node node) { int pos; Node sibling = latchSibling(); if (node.isLeaf()) { pos = node.highestLeafPos() + 2 + sibling.highestLeafPos(); } else { pos = node.highestInternalPos() + 2 + sibling.highestInternalPos(); } sibling.releaseShared(); return pos; }
/** * Returns the highest position within the original node as if it had not split. */ final int highestPos(Node node) { int pos; Node sibling = latchSibling(); if (node.isLeaf()) { pos = node.highestLeafPos() + 2 + sibling.highestLeafPos(); } else { pos = node.highestInternalPos() + 2 + sibling.highestInternalPos(); } sibling.releaseShared(); return pos; }
/** * Returns the highest position within the original node as if it had not split. */ final int highestPos(Node node) { int pos; Node sibling = latchSibling(); if (node.isLeaf()) { pos = node.highestLeafPos() + 2 + sibling.highestLeafPos(); } else { pos = node.highestInternalPos() + 2 + sibling.highestInternalPos(); } sibling.releaseShared(); return pos; }
/** * 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; }
final Node sibling = split.latchSibling();
Node sibling = child.mSplit.latchSibling(); count += sibling.countNonGhostKeys(); sibling.releaseShared();
final Node sibling = split.latchSibling();
final Node sibling = split.latchSibling();