msokolov commented on code in PR #12683: URL: https://github.com/apache/lucene/pull/12683#discussion_r1362245604
########## lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraph.java: ########## @@ -59,11 +60,26 @@ protected HnswGraph() {} * * @param level level of the graph * @param target ordinal of a node in the graph, must be ≥ 0 and < {@link - * FloatVectorValues#size()}. + * HnswGraph#size()}. */ public abstract void seek(int level, int target) throws IOException; - /** Returns the number of nodes in the graph */ + public interface NeighborIterator extends Closeable { + int nextNeighbor() throws IOException; + int size(); + } + + /** + * Retrieve an iterator over the neighbors of a graph node, acquiring a read lock. Closing the iterator + * releases the lock. + * @param level level of the graph + * @param node ordinal of a node in the graph, must be ≥ 0 and < {@link HnswGraph#size()}. + */ + public NeighborIterator lockNeighbors(int level, int node) throws IOException { + throw new UnsupportedOperationException("concurrent access not implemented"); Review Comment: ah true. I think the impl for Lucene95HnswVectorsReader.OffHeapHnswGraph can be moved up to here -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org