Skip to content

Conversation

@bbakerman
Copy link
Member

This is a small fix really - but it means that field sub selection is an immutable collection and not copied inside the ES

@bbakerman bbakerman added this to the 20.0 milestone Oct 5, 2022
MergedSelectionSet fields = parameters.getFields();
Set<String> fieldNames = fields.keySet();
List<String> fieldNames = fields.getKeys();
Async.CombinedBuilder<FieldValueInfo> futures = Async.ofExpectedSize(fields.size());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the implementation is ImmutabeList.copyOf and hence backed by the original structure

public class MergedSelectionSet {

private final Map<String, MergedField> subFields;
private final ImmutableMap<String, MergedField> subFields;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make an immutable map of the merged selection set of fields

This preserves order if the original map was a LinkedHashMap (which it is)

@bbakerman bbakerman merged commit 066c751 into master Oct 6, 2022
@dondonz dondonz deleted the avoid_copy_of_fields_in_es branch April 7, 2023 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants