You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/07/21 13:45:41 UTC

[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #910: IGNITE-17278 TableManager#directTableIds optimized

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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org