/** * Caller must hold any latch. */ boolean hasKeys() { return searchVecEnd() >= searchVecStart(); }
/** * Returns the highest possible key position, which is an even number. If * node has no keys, return value is negative. Caller must hold any latch. */ int highestKeyPos() { return searchVecEnd() - searchVecStart(); }
/** * Returns the highest possible leaf key position, which is an even * number. If leaf node is empty, return value is negative. Caller must * hold any latch. */ int highestLeafPos() { return searchVecEnd() - searchVecStart(); }
/** * Caller must hold any latch. */ boolean hasKeys() { return searchVecEnd() >= searchVecStart(); }
/** * Returns the highest possible internal node position, which is an even * number. Highest position doesn't correspond to a valid key, but instead * a child node position. If internal node has no keys, node has one child * at position zero. Caller must hold any latch. */ int highestInternalPos() { return searchVecEnd() - searchVecStart() + 2; }
/** * Caller must hold any latch. * * @see #countNonGhostKeys */ int numKeys() { return (searchVecEnd() - searchVecStart() + 2) >> 1; }
/** * Caller must hold any latch. */ boolean hasKeys() { return searchVecEnd() >= searchVecStart(); }
/** * @param pos position as provided by binarySearch; must be positive */ void updateChildRefId(int pos, long id) { p_longPutLE(mPage, searchVecEnd() + 2 + (pos << 2), id); }
/** * Returns the highest possible key position, which is an even number. If * node has no keys, return value is negative. Caller must hold any latch. */ int highestKeyPos() { return searchVecEnd() - searchVecStart(); }
/** * @param pos position as provided by binarySearch; must be positive */ long retrieveChildRefId(int pos) { return p_uint48GetLE(mPage, searchVecEnd() + 2 + (pos << 2)); }
/** * Returns highest leaf or internal position. Caller must hold any latch. */ int highestPos() { int pos = searchVecEnd() - searchVecStart(); if (!isLeaf()) { pos += 2; } return pos; }
/** * Applicable only to leaf nodes. Caller must hold any latch. */ int countNonGhostKeys() { return countNonGhostKeys(searchVecStart(), searchVecEnd()); }
/** * Returns highest leaf or internal position. Caller must hold any latch. */ int highestPos() { int pos = searchVecEnd() - searchVecStart(); if (!isLeaf()) { pos += 2; } return pos; }
/** * Caller must hold any latch. */ int availableLeafBytes() { return garbage() + searchVecStart() - searchVecEnd() - leftSegTail() + rightSegTail() + (1 - 2); }
/** * Caller must hold any latch. */ int availableLeafBytes() { return garbage() + searchVecStart() - searchVecEnd() - leftSegTail() + rightSegTail() + (1 - 2); }
/** * Caller must hold any latch. */ int availableInternalBytes() { return garbage() + 5 * (searchVecStart() - searchVecEnd()) - leftSegTail() + rightSegTail() + (1 - (5 * 2 + 8)); }
/** * Caller must hold any latch. */ int availableLeafBytes() { return garbage() + searchVecStart() - searchVecEnd() - leftSegTail() + rightSegTail() + (1 - 2); }
private void clearEntries() { garbage(0); leftSegTail(TN_HEADER_SIZE); int pageSize = pageSize(mPage); rightSegTail(pageSize - 1); // Search vector location must be even. searchVecStart((TN_HEADER_SIZE + ((pageSize - TN_HEADER_SIZE) >> 1)) & ~1); searchVecEnd(searchVecStart() - 2); // inclusive }
private void clearEntries() { garbage(0); leftSegTail(TN_HEADER_SIZE); int pageSize = pageSize(mPage); rightSegTail(pageSize - 1); // Search vector location must be even. searchVecStart((TN_HEADER_SIZE + ((pageSize - TN_HEADER_SIZE) >> 1)) & ~1); searchVecEnd(searchVecStart() - 2); // inclusive }
private void clearEntries() { garbage(0); leftSegTail(TN_HEADER_SIZE); int pageSize = pageSize(mPage); rightSegTail(pageSize - 1); // Search vector location must be even. searchVecStart((TN_HEADER_SIZE + ((pageSize - TN_HEADER_SIZE) >> 1)) & ~1); searchVecEnd(searchVecStart() - 2); // inclusive }