Skip to content

Commit b811a52

Browse files
authored
Merge branch 'main' into main
2 parents fa22e6c + 9daa870 commit b811a52

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

qa/vector/src/main/java/org/elasticsearch/test/knn/CmdLineArgs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static CmdLineArgs fromXContent(XContentParser parser) throws IOException {
8787
return builder.build();
8888
}
8989

90-
static final ObjectParser<CmdLineArgs.Builder, Void> PARSER = new ObjectParser<>("cmd_line_args", true, Builder::new);
90+
static final ObjectParser<CmdLineArgs.Builder, Void> PARSER = new ObjectParser<>("cmd_line_args", false, Builder::new);
9191

9292
static {
9393
PARSER.declareStringArray(Builder::setDocVectors, DOC_VECTORS_FIELD);

qa/vector/src/main/java/org/elasticsearch/test/knn/KnnIndexer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,11 @@ public void run() {
270270

271271
private void _run() throws IOException {
272272
while (true) {
273-
int id = numDocsIndexed.getAndIncrement();
274-
if (id >= numDocsToIndex) {
273+
int id = numDocsIndexed.get();
274+
if (id == numDocsToIndex) {
275275
break;
276+
} else if (numDocsIndexed.compareAndSet(id, id + 1) == false) {
277+
continue;
276278
}
277279

278280
Document doc = new Document();

0 commit comments

Comments
 (0)