alievmirza commented on code in PR #6902:
URL: https://github.com/apache/ignite-3/pull/6902#discussion_r2554819882


##########
modules/distribution-zones/src/main/java/org/apache/ignite/internal/distributionzones/DataNodesManager.java:
##########
@@ -913,12 +919,14 @@ public CompletableFuture<Set<String>> dataNodes(int 
zoneId, HybridTimestamp time
     }
 
     /**
-     * Unlike {@link #dataNodes} this method recalculates the data nodes, 
writes it to metastorage and history, and returns them.
+     * Unlike {@link #dataNodes} this method recalculates the  data nodes for 
given zone and writes them to metastorage.
      *
      * @param zoneName Zone name.
-     * @return Recalculated data nodes for the given zone.
+     * @return The future with recalculated data nodes for the given zone.
      */
     public CompletableFuture<Set<String>> recalculateDataNodes(String 
zoneName) {

Review Comment:
   When we really need it, we can implement it, now it brings 0 functionality. 
   You just ignore the result in 
`DistributionZoneManager#recalculateDataNodes()`
   and this `.thenAccept(v -> {});` looks ugly.
   
   Regarding `recalculateZoneDataNodesManuallyAndWaitForDataNodes`, you can 
call for example `DistributionZoneManager#currentDataNodes()` method to assert 
data nodes and from my point of view it is more correct way to assert data 
nodes. 



##########
modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/cluster/ItDataNodesControllerTest.java:
##########
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.rest.cluster;
+
+import static org.apache.ignite.internal.TestWrappers.unwrapIgniteImpl;
+import static 
org.apache.ignite.internal.distributionzones.DataNodesTestUtil.assertDistributionZoneScaleTimersAreNotScheduled;
+import static 
org.apache.ignite.internal.distributionzones.DataNodesTestUtil.assertScaleDownScheduledOrDone;
+import static 
org.apache.ignite.internal.distributionzones.DataNodesTestUtil.assertScaleUpScheduledOrDone;
+import static 
org.apache.ignite.internal.distributionzones.DataNodesTestUtil.createZoneWithInfiniteTimers;
+import static 
org.apache.ignite.internal.distributionzones.DataNodesTestUtil.waitForDataNodes;
+import static 
org.apache.ignite.internal.distributionzones.DistributionZonesTestUtil.alterZone;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import io.micronaut.core.type.Argument;
+import io.micronaut.http.HttpRequest;
+import io.micronaut.http.HttpResponse;
+import io.micronaut.http.HttpStatus;
+import io.micronaut.http.client.HttpClient;
+import io.micronaut.http.client.annotation.Client;
+import io.micronaut.http.client.exceptions.HttpClientResponseException;
+import io.micronaut.test.extensions.junit5.annotation.MicronautTest;
+import jakarta.inject.Inject;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.internal.ClusterConfiguration;
+import org.apache.ignite.internal.ClusterPerTestIntegrationTest;
+import org.apache.ignite.internal.app.IgniteImpl;
+import 
org.apache.ignite.internal.cluster.management.topology.api.LogicalTopologyService;
+import org.apache.ignite.internal.rest.constants.HttpCode;
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+/** Test for distributed zones data nodes controller. */
+@MicronautTest
+public class ItDataNodesControllerTest extends ClusterPerTestIntegrationTest {

Review Comment:
   could you please add test for case-sensitivity? API says 
`@Schema(description = "Case-sensitive zone name to recalculate datanodes 
for.")` and etc 



-- 
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]

Reply via email to