We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d36dc1 commit 3184d64Copy full SHA for 3184d64
src/main/knn/IndexerThread.java
@@ -74,16 +74,15 @@ public void run() {
74
}
75
76
private void _run() throws IOException {
77
- int docsIndexed = 0;
78
while (true) {
79
- int id = numDocsIndexed.getAndIncrement();
80
- if (id >= numDocsToIndex) {
81
- // yay, done!
82
- break;
83
- }
84
-
+ int id;
85
Document doc = new Document();
86
synchronized (vectorReader) {
+ id = numDocsIndexed.getAndIncrement();
+ if (id >= numDocsToIndex) {
+ // yay, done!
+ break;
+ }
87
switch (vectorEncoding) {
88
case BYTE -> {
89
byte[] bytes = ((VectorReaderByte) vectorReader).nextBytes();
0 commit comments