Skip to content

Commit a08afb8

Browse files
committed
Don't copy source
1 parent dc1fc58 commit a08afb8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/src/main/java/org/elasticsearch/ingest/IngestCtxMap.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.elasticsearch.script.Metadata;
1414

1515
import java.time.ZonedDateTime;
16-
import java.util.HashMap;
1716
import java.util.Map;
1817

1918
/**
@@ -32,7 +31,9 @@
3231
class IngestCtxMap extends CtxMap {
3332

3433
/**
35-
* Create an IngestCtxMap with the given metadata, source and default validators
34+
* Create an IngestCtxMap with the given metadata, source and default validators.
35+
*
36+
* Source is not copied, callers can observe changes to source.
3637
*/
3738
IngestCtxMap(
3839
String index,
@@ -43,7 +44,7 @@ class IngestCtxMap extends CtxMap {
4344
ZonedDateTime timestamp,
4445
Map<String, Object> source
4546
) {
46-
super(new HashMap<>(source), new IngestDocMetadata(index, id, version, routing, versionType, timestamp));
47+
super(source, new IngestDocMetadata(index, id, version, routing, versionType, timestamp));
4748
}
4849

4950
/**

0 commit comments

Comments
 (0)