ibessonov commented on a change in pull request #208:
URL: https://github.com/apache/ignite-3/pull/208#discussion_r670402209
##########
File path:
modules/configuration/src/main/java/org/apache/ignite/internal/configuration/util/ConfigurationUtil.java
##########
@@ -268,14 +281,50 @@ private InnerConfigurationSource(Map<String, ?> map) {
else
node.construct(key, null);
}
- else if (val instanceof Map)
+ else if (val instanceof Map) {
+ if (nodeIsNamedList) {
+ // For every named list entry modification we must
take its index into account.
+ // We do this by modifying "orderedKeys" when
index is explicitly passed.
+ Object idxObj = ((Map<?,
?>)val).get(NamedListNode.ORDER_IDX);
+
+ if (idxObj != null) {
+ assert idxObj instanceof Integer : val;
+
+ int idx = (Integer)idxObj;
+
+ if (idx >= orderedKeys.size()) {
+ // Updates can come in arbitrary order.
This means that array may be too small
+ // during batch creation. In this case we
have to insert enough nulls before
+ // invoking "add" method for actual key.
+
((ArrayList<?>)orderedKeys).ensureCapacity(idx + 1);
Review comment:
I think my code is a little bit simpler
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]