/** * Add a row. If it is possible this method returns -1, otherwise * the split point. It is always possible to add two rows. * * @param row the now to add * @return the split point of this page, or -1 if no split is required */ private int addChildTry(SearchRow row) { if (entryCount < 4) { return -1; } int startData; if (onlyPosition) { // if we only store the position, we may at most store as many // entries as there is space for keys, because the current data area // might get larger when _removing_ a child (if the new key needs // more space) - and removing a child can't split this page startData = entryCount + 1 * MAX_KEY_LENGTH; } else { int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; startData = last - rowLength; } if (startData < start + CHILD_OFFSET_PAIR_LENGTH) { return entryCount / 2; } return -1; }
int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; o -= index.getRowSize(data, getRow(i), true); offsets[i] = o; rowLength = index.getRowSize(data, row, true); if (SysProperties.CHECK && last - rowLength < start + CHILD_OFFSET_PAIR_LENGTH) {
private int addRow(SearchRow row, boolean tryOnly) { int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; o -= index.getRowSize(data, getRow(i), true); offsets[i] = o; rowLength = index.getRowSize(data, row, true); if (SysProperties.CHECK && last - rowLength < start + OFFSET_LENGTH) { throw DbException.throwInternalError();
/** * Add a row. If it is possible this method returns -1, otherwise * the split point. It is always possible to add two rows. * * @param row the now to add * @return the split point of this page, or -1 if no split is required */ private int addChildTry(SearchRow row) { if (entryCount < 4) { return -1; } int startData; if (onlyPosition) { // if we only store the position, we may at most store as many // entries as there is space for keys, because the current data area // might get larger when _removing_ a child (if the new key needs // more space) - and removing a child can't split this page startData = entryCount + 1 * MAX_KEY_LENGTH; } else { int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; startData = last - rowLength; } if (startData < start + CHILD_OFFSET_PAIR_LENGTH) { return entryCount / 2; } return -1; }
/** * Add a row. If it is possible this method returns -1, otherwise * the split point. It is always possible to add two rows. * * @param row the now to add * @return the split point of this page, or -1 if no split is required */ private int addChildTry(SearchRow row) { if (entryCount < 4) { return -1; } int startData; if (onlyPosition) { // if we only store the position, we may at most store as many // entries as there is space for keys, because the current data area // might get larger when _removing_ a child (if the new key needs // more space) - and removing a child can't split this page startData = entryCount + 1 * MAX_KEY_LENGTH; } else { int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; startData = last - rowLength; } if (startData < start + CHILD_OFFSET_PAIR_LENGTH) { return entryCount / 2; } return -1; }
int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; o -= index.getRowSize(data, getRow(i), true); offsets[i] = o; rowLength = index.getRowSize(data, row, true); if (SysProperties.CHECK && last - rowLength < start + CHILD_OFFSET_PAIR_LENGTH) {
int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; o -= index.getRowSize(data, getRow(i), true); offsets[i] = o; rowLength = index.getRowSize(data, row, true); if (SysProperties.CHECK && last - rowLength < start + CHILD_OFFSET_PAIR_LENGTH) {
private int addRow(SearchRow row, boolean tryOnly) { int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; o -= index.getRowSize(data, getRow(i), true); offsets[i] = o; rowLength = index.getRowSize(data, row, true); if (SysProperties.CHECK && last - rowLength < start + OFFSET_LENGTH) { throw DbException.throwInternalError();
private int addRow(SearchRow row, boolean tryOnly) { int rowLength = index.getRowSize(data, row, onlyPosition); int pageSize = index.getPageStore().getPageSize(); int last = entryCount == 0 ? pageSize : offsets[entryCount - 1]; o -= index.getRowSize(data, getRow(i), true); offsets[i] = o; rowLength = index.getRowSize(data, row, true); if (SysProperties.CHECK && last - rowLength < start + OFFSET_LENGTH) { throw DbException.throwInternalError();