private void doubleSegmentsTable() throws IOException {
    int hashSuffixDepth = header.globalHashSuffixDepth();
    int oldTableSize = header.segmentTableSize();
    if (oldTableSize * 2 > header.maxSegmentTableSize()) {
      throw new IllegalStateException(
        "Can't expand table: currentSize=" + header.segmentTableSize() +
        " x2 > maxSize=" + header.maxSegmentTableSize() +
        " -> try increase segmentSize(=" + header.segmentSize() + ") if you need to store more keys"
      );
    }
    header.globalHashSuffixDepth(hashSuffixDepth + 1);
    for (int i = 0; i < oldTableSize; i++) {
      int segmentIndex = header.segmentIndex(i);
      header.updateSegmentIndex(oldTableSize + i, segmentIndex);
    }
  }
private void doubleSegmentsTable()