tkalkirill commented on code in PR #1461: URL: https://github.com/apache/ignite-3/pull/1461#discussion_r1058235342
########## modules/runner/src/integrationTest/java/org/apache/ignite/internal/Cluster.java: ########## @@ -0,0 +1,346 @@ +/* + * 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; + +import static java.util.stream.Collectors.toList; +import static org.apache.ignite.internal.testframework.IgniteTestUtils.testNodeName; +import static org.apache.ignite.internal.testframework.IgniteTestUtils.waitForCondition; +import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.file.Path; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.IntStream; +import java.util.stream.Stream; +import org.apache.ignite.IgnitionManager; +import org.apache.ignite.internal.app.IgniteImpl; +import org.apache.ignite.internal.logger.IgniteLogger; +import org.apache.ignite.internal.logger.Loggers; +import org.apache.ignite.internal.raft.RaftNodeId; +import org.apache.ignite.internal.raft.server.impl.JraftServerImpl; +import org.apache.ignite.internal.table.distributed.replicator.TablePartitionId; +import org.apache.ignite.lang.IgniteStringFormatter; +import org.apache.ignite.raft.jraft.RaftGroupService; +import org.apache.ignite.raft.jraft.util.concurrent.ConcurrentHashSet; +import org.apache.ignite.sql.Session; +import org.jetbrains.annotations.Nullable; +import org.junit.jupiter.api.TestInfo; + +/** + * Cluster of nodes used for testing. + */ +@SuppressWarnings("resource") +public class Cluster { + private static final IgniteLogger LOG = Loggers.forClass(Cluster.class); + + /** Base port number. */ + private static final int BASE_PORT = 3344; + + private static final String CONNECT_NODE_ADDR = "\"localhost:" + BASE_PORT + '\"'; + + /** Timeout for SQL queries (in milliseconds). */ + private static final int QUERY_TIMEOUT_MS = 10_000; + + private final TestInfo testInfo; + + private final Path workDir; + + private final String nodeBootstrapConfig; + + /** Cluster nodes. */ + private final List<IgniteImpl> nodes = new CopyOnWriteArrayList<>(); + + private volatile boolean started = false; + + /** Indices of nodes that have been knocked out. */ Review Comment: For me it sounds like SQL indices, I think it can be reformulated. -- 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]
