private int lookupOrCreateIdForValue(@NotNull V value) throws IOException {
    int hash = valueDescriptor.getHashCode(value);
    int valueHash = HashUtils.adjustHash(hash);
    return valueHashToId.lookupOrInsert(
      valueHash,
      candidateId -> {
        V candidateValue = valuesLog.read(candidateId, valueDescriptor::read);
        return valueDescriptor.isEqual(candidateValue, value);
      },
      _valueHash_ -> {
        DataExternalizerEx.KnownSizeRecordWriter writer = valueDescriptor.writerFor(value);
        long logRecordId = valuesLog.append(writer, writer.recordSize());
        return convertLogIdToEnumeratorId(logRecordId);
      });
  }
private int lookupOrCreateIdForValue(@NotNull V value)