/** * Returns true if leaf is not split and underutilized. If so, it should be * merged with its neighbors, and possibly deleted. Caller must hold any latch. */ boolean shouldLeafMerge() { return shouldMerge(availableLeafBytes()); }
/** * Returns true if leaf is not split and underutilized. If so, it should be * merged with its neighbors, and possibly deleted. Caller must hold any latch. */ boolean shouldLeafMerge() { return shouldMerge(availableLeafBytes()); }
/** * Returns true if leaf is not split and underutilized. If so, it should be * merged with its neighbors, and possibly deleted. Caller must hold any latch. */ boolean shouldLeafMerge() { return shouldMerge(availableLeafBytes()); }
/** * Caller must hold any latch. */ int availableBytes() { return isLeaf() ? availableLeafBytes() : availableInternalBytes(); }
/** * Caller must hold any latch. */ int availableBytes() { return isLeaf() ? availableLeafBytes() : availableInternalBytes(); }
/** * Caller must hold any latch. */ int availableBytes() { return isLeaf() ? availableLeafBytes() : availableInternalBytes(); }
long avail = node.availableLeafBytes() - growth; if (avail < 0) { throw new Error("split 1: " + node.availableLeafBytes() + ", " + growth);
long avail = node.availableLeafBytes() - growth; if (avail < 0) { throw new Error("split 1: " + node.availableLeafBytes() + ", " + growth);
if (!node.shouldMerge(nodeAvail = node.availableLeafBytes())) { if (leftNode != null) { leftNode.releaseExclusive(); int leftAvail = leftNode == null ? -1 : leftNode.availableLeafBytes(); int rightAvail = rightNode == null ? -1 : rightNode.availableLeafBytes();
if (!node.shouldMerge(nodeAvail = node.availableLeafBytes())) { node.releaseExclusive(); parentNode.releaseExclusive(); int leftAvail = leftNode == null ? -1 : leftNode.availableLeafBytes(); int rightAvail = rightNode == null ? -1 : rightNode.availableLeafBytes();
int nodeAvail = node.availableLeafBytes(); if (!node.shouldMerge(nodeAvail)) { node.releaseExclusive(); leftAvail = leftNode.availableLeafBytes(); rightAvail = rightNode.availableLeafBytes();
int leftAvail = leftNode.availableLeafBytes(); int rightAvail = rightNode.availableLeafBytes();
int leftAvail = left.availableLeafBytes(); if (leftAvail >= moveAmount) {
int rightAvail = right.availableLeafBytes(); if (rightAvail >= moveAmount) {
int rightAvail = right.availableLeafBytes(); if (rightAvail >= moveAmount) {
int leftAvail = left.availableLeafBytes(); if (leftAvail >= moveAmount) {
int leftAvail = left.availableLeafBytes(); if (leftAvail >= moveAmount) {
int rightAvail = right.availableLeafBytes(); if (rightAvail >= moveAmount) {
int avail = availableLeafBytes();
int avail = availableLeafBytes();