Skip to content

Commit 895c5cb

Browse files
committed
test
1 parent 33f26ee commit 895c5cb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

server/src/main/java/org/opensearch/index/engine/Engine.java

+10
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ public abstract static class Result {
479479
private final SetOnce<Boolean> freeze = new SetOnce<>();
480480
private final Mapping requiredMappingUpdate;
481481
private Translog.Location translogLocation;
482+
private InternalEngine.IndexingStrategy indexingStrategy;
482483
private long took;
483484

484485
protected Result(Operation.TYPE operationType, Exception failure, long version, long term, long seqNo) {
@@ -492,6 +493,10 @@ protected Result(Operation.TYPE operationType, Exception failure, long version,
492493
}
493494

494495
protected Result(Operation.TYPE operationType, long version, long term, long seqNo) {
496+
this(operationType, version, term, seqNo, null);
497+
}
498+
499+
protected Result(Operation.TYPE operationType, long version, long term, long seqNo, InternalEngine.IndexingStrategy indexingStrategy) {
495500
this.operationType = operationType;
496501
this.version = version;
497502
this.seqNo = seqNo;
@@ -604,6 +609,11 @@ public static class IndexResult extends Result {
604609

605610
private final boolean created;
606611

612+
public IndexResult(long version, long term, long seqNo, boolean created, InternalEngine.IndexingStrategy plan) {
613+
super(Operation.TYPE.INDEX, version, term, seqNo, plan);
614+
this.created = created;
615+
}
616+
607617
public IndexResult(long version, long term, long seqNo, boolean created) {
608618
super(Operation.TYPE.INDEX, version, term, seqNo);
609619
this.created = created;

server/src/main/java/org/opensearch/index/engine/InternalEngine.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ private IndexResult indexIntoLucene(Index index, IndexingStrategy plan) throws I
11301130
assert assertDocDoesNotExist(index, canOptimizeAddDocument(index) == false);
11311131
addDocs(index.docs(), indexWriter);
11321132
}
1133-
return new IndexResult(plan.versionForIndexing, index.primaryTerm(), index.seqNo(), plan.currentNotFoundOrDeleted);
1133+
return new IndexResult(plan.versionForIndexing, index.primaryTerm(), index.seqNo(), plan.currentNotFoundOrDeleted, plan);
11341134
} catch (Exception ex) {
11351135
if (ex instanceof AlreadyClosedException == false
11361136
&& indexWriter.getTragicException() == null

0 commit comments

Comments
 (0)