zhaih commented on code in PR #12660: URL: https://github.com/apache/lucene/pull/12660#discussion_r1367955644
########## lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphBuilder.java: ########## @@ -151,61 +159,124 @@ public OnHeapHnswGraph build(int maxOrd) throws IOException { return hnsw; } - /** Set info-stream to output debugging information * */ + @Override public void setInfoStream(InfoStream infoStream) { this.infoStream = infoStream; } + @Override public OnHeapHnswGraph getGraph() { return hnsw; } - private void addVectors(int maxOrd) throws IOException { + protected void addVectors(int minOrd, int maxOrd) throws IOException { long start = System.nanoTime(), t = start; - for (int node = 0; node < maxOrd; node++) { + if (infoStream.isEnabled(HNSW_COMPONENT)) { + infoStream.message(HNSW_COMPONENT, "addVectors [" + minOrd + " " + maxOrd + ")"); + } + // System.out.println("addVectors [" + minOrd + " " + maxOrd + ") initialized.size=" + + // initializedNodes.size()); + for (int node = minOrd; node < maxOrd; node++) { + // System.out.println("add node " + node + " t=" + Thread.currentThread().getName()); addGraphNode(node); + // System.out.println("entry node " + hnsw.entryNode()); + // System.out.println("node " + node + " nbrs.size()=" + hnsw.getNeighbors(0, node).size()); if ((node % 10000 == 0) && infoStream.isEnabled(HNSW_COMPONENT)) { t = printGraphBuildStatus(node, start, t); } } + // System.out.println("addVectors [" + minOrd + " " + maxOrd + ") done + graph.size=" + + // hnsw.size()); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) Review Comment: It was previous code that's causing the warning. I'll remove it. -- 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