tkalkirill commented on code in PR #910:
URL: https://github.com/apache/ignite-3/pull/910#discussion_r926693110
##########
modules/configuration/src/main/java/org/apache/ignite/internal/configuration/NamedListConfiguration.java:
##########
@@ -122,6 +123,15 @@ public T getByInternalId(UUID internalId) {
return (T) members.get(value.keyByInternalId(internalId));
}
+ /**
+ * Returns all internal ids of the elements from the list.
+ */
+ public List<UUID> internalIds() {
+ NamedListView<VIEWT> value = value();
+
+ return new ArrayList<>(((NamedListNode) value).internalIds());
Review Comment:
How about an immutable list?
##########
modules/configuration/src/main/java/org/apache/ignite/internal/configuration/util/ConfigurationUtil.java:
##########
@@ -834,6 +834,10 @@ public T visitNamedListNode(String key, NamedListNode<?>
node) {
assert pathNode.namedListEntry;
+ if (!pathNode.unresolvedName &&
KeyPathNode.INTERNAL_IDS.equals(pathNode.key)) {
+ return (T) new ArrayList<>(node.internalIds());
Review Comment:
How about an immutable list?
##########
modules/configuration/src/test/java/org/apache/ignite/internal/configuration/direct/DirectPropertiesTest.java:
##########
@@ -246,6 +247,27 @@ public void testNamedListDirectInternalId() throws
Exception {
assertThat(directProxy(getByInternalId(cfg.children(),
fooId).id()).value(), is(equalTo(fooId)));
}
+ /**
+ * Checks simple scenarios of getting internalIds of named list.
+ */
+ @Test
+ public void testNamedListDirectInternalIds() throws Exception {
+ DirectConfiguration cfg =
registry.getConfiguration(DirectConfiguration.KEY);
+
+ cfg.children()
+ .change(change -> change.create("foo", value -> {
+ }))
Review Comment:
```suggestion
.change(change -> change.create("foo", value -> { }))
```
--
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]