@Override
  public int getSize(int record) throws IOException {
    final Lock readLock = myStorage.getStorageLockContext().readLock();
    readLock.lock();
    try {
      int currentValue = myStorage.getInt(getOffset(record, SIZE_AND_CAPACITY_OFFSET));
      if (currentValue < 0) {
        // read size from indirect record
        return myStorage.getInt(getOffset(-currentValue, SIZE_OFFSET_IN_INDIRECT_RECORD));
      }
      int i = currentValue & SIZE_MASK;
      if (i == SPECIAL_POSITIVE_VALUE_FOR_SPECIAL_NEGATIVE_SIZE) i = SPECIAL_NEGATIVE_SIZE_FOR_REMOVED_RECORD;
      return i;
    }
    finally {
      readLock.unlock();
    }
  }
@Override
  public int getSize(int record)