mirror of
https://github.com/apache/lucene.git
synced 2025-02-09 03:25:15 +00:00
add infostream status messages to HnswGraphBuilder.connectComponents (#13849)
This commit is contained in:
parent
4a1653c220
commit
3f6e91e87b
@ -439,7 +439,11 @@ public class HnswGraphBuilder implements HnswBuilder {
|
|||||||
maxConn *= 2;
|
maxConn *= 2;
|
||||||
}
|
}
|
||||||
List<Component> components = HnswUtil.components(hnsw, level, notFullyConnected, maxConn);
|
List<Component> components = HnswUtil.components(hnsw, level, notFullyConnected, maxConn);
|
||||||
// System.out.println("HnswGraphBuilder.connectComponents level=" + level + ": " + components);
|
if (infoStream.isEnabled(HNSW_COMPONENT)) {
|
||||||
|
infoStream.message(
|
||||||
|
HNSW_COMPONENT, "connect " + components.size() + " components on level=" + level);
|
||||||
|
}
|
||||||
|
// System.out.println("HnswGraphBuilder. level=" + level + ": " + components);
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
if (components.size() > 1) {
|
if (components.size() > 1) {
|
||||||
// connect other components to the largest one
|
// connect other components to the largest one
|
||||||
@ -457,6 +461,10 @@ public class HnswGraphBuilder implements HnswBuilder {
|
|||||||
if (c.start() == NO_MORE_DOCS) {
|
if (c.start() == NO_MORE_DOCS) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (infoStream.isEnabled(HNSW_COMPONENT)) {
|
||||||
|
infoStream.message(HNSW_COMPONENT, "connect component " + c + " to " + c0);
|
||||||
|
}
|
||||||
|
|
||||||
beam.clear();
|
beam.clear();
|
||||||
eps[0] = c0.start();
|
eps[0] = c0.start();
|
||||||
RandomVectorScorer scorer = scorerSupplier.scorer(c.start());
|
RandomVectorScorer scorer = scorerSupplier.scorer(c.start());
|
||||||
@ -475,8 +483,14 @@ public class HnswGraphBuilder implements HnswBuilder {
|
|||||||
// System.out.println("link " + c0 + "." + c0node + " to " + c + "." + c.start());
|
// System.out.println("link " + c0 + "." + c0node + " to " + c + "." + c.start());
|
||||||
link(level, c0node, c.start(), score, notFullyConnected);
|
link(level, c0node, c.start(), score, notFullyConnected);
|
||||||
linked = true;
|
linked = true;
|
||||||
|
if (infoStream.isEnabled(HNSW_COMPONENT)) {
|
||||||
|
infoStream.message(HNSW_COMPONENT, "connected ok " + c0node + " -> " + c.start());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!linked) {
|
if (!linked) {
|
||||||
|
if (infoStream.isEnabled(HNSW_COMPONENT)) {
|
||||||
|
infoStream.message(HNSW_COMPONENT, "not connected; no free nodes found");
|
||||||
|
}
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user