in modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/ItTableCreationTest.java [71:205]
void setUp(TestInfo testInfo) {
String node0Name = testNodeName(testInfo, PORTS[0]);
String node1Name = testNodeName(testInfo, PORTS[1]);
String node2Name = testNodeName(testInfo, PORTS[2]);
nodesBootstrapCfg.put(
node0Name,
"{\n"
+ " network: {\n"
+ " port: " + PORTS[0] + ",\n"
+ " nodeFinder: {\n"
+ " netClusterNodes: [ \"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " },\n"
+ " \"table\": {\n"
+ " \"tables\": {\n"
+ " \"tbl1\": {\n"
+ " \"partitions\":10,\n"
+ " \"replicas\":2,\n"
+ " \"columns\": { \n"
+ " \"key\": {\n"
+ " \"type\": {"
+ " \"type\":UUID\n"
+ " },\n"
+ " \"nullable\":false\n"
+ " },\n"
+ " \"affKey\": {\n"
+ " \"type\": {"
+ " \"type\":INT64\n"
+ " },\n"
+ " \"nullable\":false\n"
+ " },\n"
+ " \"valString\": {\n"
+ " \"type\": {"
+ " \"type\":String\n"
+ " },\n"
+ " \"nullable\":false\n"
+ " },\n"
+ " \"valInt\": {\n"
+ " \"type\": {"
+ " \"type\":INT32\n"
+ " },\n"
+ " \"nullable\":false\n"
+ " },\n"
+ " \"valNullable\": {\n"
+ " \"type\": {"
+ " \"type\":String\n"
+ " },\n"
+ " \"nullable\":true\n"
+ " }\n"
+ " },\n"
+ " \"indices\": {\n" /* Columns. */
+ " \"PK\": {\n"
+ " \"type\":PRIMARY,\n"
+ " \"columns\": {\n"
+ " \"key\": {\n"
+ " \"asc\":true\n"
+ " },\n"
+ " \"affKey\": {}\n"
+ " },\n" /* Columns. */
+ " \"affinityColumns\":[ \"affKey\" ]\n"
+ " }\n"
+ " }\n" /* Indices. */
+ " },\n" /* Table. */
+ "\n"
+ " \"tbl2\": {\n" // Table minimal configuration.
+ " \"columns\": { \n"
+ " \"key\": {\n"
+ " \"type\": {"
+ " \"type\":INT64\n"
+ " },\n"
+ " },\n"
+ " \"val\": {\n"
+ " \"type\": {"
+ " \"type\":INT64\n"
+ " },\n"
+ " }\n"
+ " },\n" /* Columns. */
+ " \"indices\": {\n"
+ " \"PK\": {\n"
+ " \"type\":PRIMARY,\n"
+ " \"columns\": {\n"
+ " \"key\": {}\n"
+ " },\n" /* Columns. */
+ " }\n"
+ " }\n" /* Indices. */
+ " }\n" /* Table. */
+ " }\n" /* Tables. */
+ " }\n" /* Root. */
+ "}"
);
nodesBootstrapCfg.put(
node1Name,
"{\n"
+ " network: {\n"
+ " port: " + PORTS[1] + ",\n"
+ " nodeFinder: {\n"
+ " netClusterNodes: [ \"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " }\n"
+ "}"
);
nodesBootstrapCfg.put(
node2Name,
"{\n"
+ " network: {\n"
+ " port: " + PORTS[2] + ",\n"
+ " nodeFinder: {\n"
+ " netClusterNodes: [ \"localhost:3344\", \"localhost:3345\", \"localhost:3346\" ]\n"
+ " }\n"
+ " }\n"
+ "}"
);
List<CompletableFuture<Ignite>> futures = nodesBootstrapCfg.entrySet().stream()
.map(e -> TestIgnitionManager.start(e.getKey(), e.getValue(), workDir.resolve(e.getKey())))
.collect(toList());
String metaStorageNode = nodesBootstrapCfg.keySet().iterator().next();
InitParameters initParameters = InitParameters.builder()
.destinationNodeName(metaStorageNode)
.metaStorageNodeNames(List.of(metaStorageNode))
.clusterName("cluster")
.build();
TestIgnitionManager.init(initParameters);
for (CompletableFuture<Ignite> future : futures) {
assertThat(future, willCompleteSuccessfully());
clusterNodes.add(future.join());
}
}