@Override public void dispose() { try { myPersistentEnumerator.close(); } catch (IOException e) { LOG.warn(e); } }
@Nullable Hash findHash(@NotNull final Condition<Hash> condition) throws IOException { final Ref<Hash> hashRef = Ref.create(); myPersistentEnumerator.iterateData( new CommonProcessors.FindProcessor<Hash>() { @Override protected boolean accept(Hash hash) { boolean matches = condition.value(hash); if (matches) { hashRef.set(hash); } return matches; } }); return hashRef.get(); }
private int getOrPut(@NotNull Hash hash) throws IOException { return myPersistentEnumerator.enumerate(hash); }
public void flush() { myPersistentEnumerator.force(); }
@Nullable private Hash doGetHash(int index) throws IOException { return myPersistentEnumerator.valueOf(index); }