diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7352454..ed36483 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: - name: Publish to Maven Central run: | - ./mvnw -B clean deploy -PsonatypeRelease -DskipTests -pl '!jacoco-coverage-aggregate-report' + ./mvnw -B clean deploy -PsonatypeRelease -DskipTests -pl '!jacoco-coverage-aggregate-report,!documentation' env: MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }} MAVEN_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index af6abeb..334e124 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -27,7 +27,7 @@ jobs: - name: Publish Snapshot to Maven Central run: | - ./mvnw -B clean deploy -PsonatypeSnapshot -DskipTests -pl '!jacoco-coverage-aggregate-report' + ./mvnw -B clean deploy -PsonatypeSnapshot -DskipTests -pl '!jacoco-coverage-aggregate-report,!documentation' env: MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USER }} MAVEN_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }} diff --git a/.gitignore b/.gitignore index 3b1e9ee..3ce9a8a 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ workbench.xmi .factorypath documentation/venv documentation/site +documentation/target diff --git a/documentation/README.md b/documentation/README.md index 3e526b3..588db08 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -1,33 +1,99 @@ -## Documentation +## Документация -### Local Build +### Локальная сборка документации -To deploy the site locally on the current branch/tag: +Чтобы собрать документацию локально на текущей ветке/теге: -1. ```bash +1. Перейдите на ветку/тег и инициализируйте python-окружение: + + ```shell git checkout - ``` -2. ```bash cd documentation - ``` -3. ```bash python3 -m venv venv - ``` -4. ```bash source venv/bin/activate - ``` -5. ```bash pip install -r requirements.txt ``` -6. ```bash - mkdocs serve + +2. Соберите или запустите сайт: + + ```shell + mkdocs build + ``` + + ```shell + mkdocs serve ``` -### Schemas +### Интернационализация + +На данный момент документация поддерживает два языка: + +- Русский 🇷🇺 - по умолчанию +- Английский 🇺🇸 + +### Правила написания новых страниц и разделов + +#### Раздел + +`Раздел` - группа страниц, описывающая одну конкретную тему. Раздел может включать подразделы. +Раздел оформаляется в отдельной директории. Каждый раздел обязан иметь страницу с именем `index.md`, +в которой описывается тематика раздела. + +`Страница` - страница с произвольным именем и расширением `.md`, написанная на `markdown`. + +При добавлении страницы и раздела, добавьте их в секцию `nav` в файле `mkdocs.yml`: -Documentation supports `.drawio` format schemas. Place your schema in the `assets` directory. In the markdown text, -refer to the schema as a regular markdown image. The path to the image must be relative: +Пример раздела: + +> ![alt](readme-images/sections.png) + +Пример оформленной навигации для этого раздела: + +> ![alt](readme-images/navigation.png) + +### Схемы + +#### Plantuml + +Документация поддерживает рендеринг `plantuml-диаграмм`. Для того чтобы добавить схему plantuml в +текст страницы `markdown` используйте блок кода с расширением `puml`: + +> \`\`\`puml +> +> @startuml +> +> Alice -> Bob: test +> +> @enduml +> +> \`\`\` + +#### Drawio + +Документация поддерживает отображение схем, написанных в `drawio` (файлы с расширением `.drawio`). +Необходимо добавить схему в директорию `assets`. В тексте markdown добавьте схему также как +добавляете обыное изображение, используя относительный путь: ```markdown ![](../../../../assets//schema.drawio) ``` + +### Code Snippets + +Документация поддерживает добавление в текст markdown включение текста из других файлов (snippets). +Для того, чтобы добавить snippet в текст markdown изучите +документацию [расширения](https://facelessuser.github.io/pymdown-extensions/extensions/snippets/). +Путь к файлам, которые будут включены вычисляется относительно директории +`docs/documentation/examples`. + +#### Дополнительные возможности + +Также поддерживаются следующие дополнения: + +- Использование [emoji](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) в + тексте страниц. +- [Табы](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/) +- [Сноски](https://squidfunk.github.io/mkdocs-material/reference/footnotes/) +- [Диаграммы mermaid](https://squidfunk.github.io/mkdocs-material/reference/diagrams/) +- [Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) +- [Аннотации](https://squidfunk.github.io/mkdocs-material/reference/annotations/) diff --git a/documentation/README_EN.md b/documentation/README_EN.md new file mode 100644 index 0000000..e0d0be2 --- /dev/null +++ b/documentation/README_EN.md @@ -0,0 +1,98 @@ +## Documentation + +### Local documentation deploy + +To deploy documentation locally on current branch/tag: + +1. Checkout branch/tag and initialize python-environment: + + ```shell + git checkout + cd documentation + python3 -m venv venv + source venv/bin/activate + pip install -r requirements.txt + ``` + +2. Build or serve site: + + ```shell + mkdocs build + ``` + + ```shell + mkdocs serve + ``` + +### Internationalization + +Documentation supports two languages: + +- Russian 🇷🇺 - by default +- English 🇺🇸 + +### New pages writing rules + +#### Section + +`Section` is group of pages, describing one certain topic. Section can include subsections. Write +section on separate directory. Each section must have page with `index.md` name that describe topic +area. + +`Page` is page with any name and `.md` extension. + +When a new section and page are being written, they should be added to the `nav` section in the +`mkdocs.yml` file. + +Section example: + +> ![alt](readme-images/sections.png) + +Example of a decorated navigation for this section: + +> ![alt](readme-images/navigation.png) + +### Схемы + +#### Plantuml + +The documentation supports the rendering of `plantuml diagrams`. To add the plantuml schema to the +text of the `markdown` page, use a block of code with the `puml` extension.: + +> \`\`\`puml +> +> @startuml +> +> Alice -> Bob: test +> +> @enduml +> +> \`\`\` + +#### Drawio + +The documentation supports the display of diagrams written in `drawio` (files with the `.drawio` +extension). It is necessary to add the schema to the `assets` directory. In the Markdown text, add a +diagram in the same way as you add an image using a relative path: + +```markdown +![](../../../../assets//schema.drawio) +``` + +### Code Snippets + +The documentation supports adding text inclusions from other files (snippets) to the Markdown text. +To add snippet to the Markdown text, read the +extension's [documentation](https://facelessuser.github.io/pymdown-extensions/extensions/snippets/). +The path to the files to be included is calculated relative to the `docs/documentation/examples` +directory. + +#### Additional extensions + +- Usage of [emoji](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/) in Markdown + pages +- [Tabs of content](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/) +- [Footnotes](https://squidfunk.github.io/mkdocs-material/reference/footnotes/) +- [Mermaid diagrams](https://squidfunk.github.io/mkdocs-material/reference/diagrams/) +- [Admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) +- [Annotations](https://squidfunk.github.io/mkdocs-material/reference/annotations/) diff --git a/documentation/docs/assets/drawio/client/balancer.drawio b/documentation/doc-src/assets/drawio/client/balancer.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/balancer.drawio rename to documentation/doc-src/assets/drawio/client/balancer.drawio diff --git a/documentation/docs/assets/drawio/client/connection-pool.drawio b/documentation/doc-src/assets/drawio/client/connection-pool.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/connection-pool.drawio rename to documentation/doc-src/assets/drawio/client/connection-pool.drawio diff --git a/documentation/docs/assets/drawio/client/distributing-round-robin.drawio b/documentation/doc-src/assets/drawio/client/distributing-round-robin.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/distributing-round-robin.drawio rename to documentation/doc-src/assets/drawio/client/distributing-round-robin.drawio diff --git a/documentation/docs/assets/drawio/client/few-connection-box.drawio b/documentation/doc-src/assets/drawio/client/few-connection-box.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/few-connection-box.drawio rename to documentation/doc-src/assets/drawio/client/few-connection-box.drawio diff --git a/documentation/docs/assets/drawio/client/heartbeat-1.drawio b/documentation/doc-src/assets/drawio/client/heartbeat-1.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/heartbeat-1.drawio rename to documentation/doc-src/assets/drawio/client/heartbeat-1.drawio diff --git a/documentation/docs/assets/drawio/client/heartbeat.drawio b/documentation/doc-src/assets/drawio/client/heartbeat.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/heartbeat.drawio rename to documentation/doc-src/assets/drawio/client/heartbeat.drawio diff --git a/documentation/docs/assets/drawio/client/high-level-arch.drawio b/documentation/doc-src/assets/drawio/client/high-level-arch.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/high-level-arch.drawio rename to documentation/doc-src/assets/drawio/client/high-level-arch.drawio diff --git a/documentation/docs/assets/drawio/client/instance-connection-group.drawio b/documentation/doc-src/assets/drawio/client/instance-connection-group.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/instance-connection-group.drawio rename to documentation/doc-src/assets/drawio/client/instance-connection-group.drawio diff --git a/documentation/docs/assets/drawio/client/round-robin.drawio b/documentation/doc-src/assets/drawio/client/round-robin.drawio similarity index 100% rename from documentation/docs/assets/drawio/client/round-robin.drawio rename to documentation/doc-src/assets/drawio/client/round-robin.drawio diff --git a/documentation/docs/assets/images/client/few-nodes-crud.svg b/documentation/doc-src/assets/images/client/few-nodes-crud.svg similarity index 100% rename from documentation/docs/assets/images/client/few-nodes-crud.svg rename to documentation/doc-src/assets/images/client/few-nodes-crud.svg diff --git a/documentation/docs/assets/images/client/few-replicas-box.svg b/documentation/doc-src/assets/images/client/few-replicas-box.svg similarity index 100% rename from documentation/docs/assets/images/client/few-replicas-box.svg rename to documentation/doc-src/assets/images/client/few-replicas-box.svg diff --git a/documentation/docs/index.en.md b/documentation/doc-src/index.en.md similarity index 100% rename from documentation/docs/index.en.md rename to documentation/doc-src/index.en.md diff --git a/documentation/docs/index.md b/documentation/doc-src/index.md similarity index 100% rename from documentation/docs/index.md rename to documentation/doc-src/index.md diff --git a/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionAbstractExample.java b/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionAbstractExample.java new file mode 100644 index 0000000..a58023c --- /dev/null +++ b/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionAbstractExample.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2025 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY + * All Rights Reserved. + */ + +package client; + +// --8<-- [start:tarantool-single-instance-abstract] + +import java.io.IOException; +import java.nio.file.Path; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.io.TempDir; +import org.testcontainers.containers.tarantool.Tarantool3Container; +import org.testcontainers.containers.tarantool.TarantoolContainer; +import org.testcontainers.utility.DockerImageName; +import testcontainers.utils.TarantoolSingleNodeConfigUtils; + +public abstract class TarantoolSingleInstanceConnectionAbstractExample { + + protected static final String TARANTOOL_TAG = "3.6.0"; + + @TempDir protected static Path TEMP_DIR; + + private static final DockerImageName image = + DockerImageName.parse("tarantool/tarantool:" + TARANTOOL_TAG); + + protected static TarantoolContainer CONTAINER; + + @BeforeAll + static void beforeAll() throws IOException { + CONTAINER = createSingleNodeContainer(TEMP_DIR); + CONTAINER.start(); + } + + @AfterAll + static void afterAll() { + CONTAINER.stop(); + } + + protected abstract void simpleConnection(); + + protected static TarantoolContainer createSingleNodeContainer(Path tempPath) + throws IOException { + final Path pathToConfig = TarantoolSingleNodeConfigUtils.createConfig(tempPath); + return new Tarantool3Container(image, "test-node").withConfigPath(pathToConfig); + } +} +// --8<-- [end:tarantool-single-instance-abstract] diff --git a/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionCartridgeDriverExample.java b/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionCartridgeDriverExample.java new file mode 100644 index 0000000..682dba6 --- /dev/null +++ b/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionCartridgeDriverExample.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2025 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY + * All Rights Reserved. + */ + +package client; + +// --8<-- [start:tarantool-single-instance-cartridge-driver] + +import java.net.InetSocketAddress; +import java.util.List; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import testcontainers.utils.TarantoolSingleNodeConfigUtils; + +import io.tarantool.driver.api.TarantoolClient; +import io.tarantool.driver.api.TarantoolClientFactory; +import io.tarantool.driver.api.TarantoolResult; +import io.tarantool.driver.api.tuple.TarantoolTuple; + +public class TarantoolSingleInstanceConnectionCartridgeDriverExample + extends TarantoolSingleInstanceConnectionAbstractExample { + + @Test + @Override + protected void simpleConnection() { + try (TarantoolClient> client = setupClient()) { + final List result = client.eval("return _TARANTOOL").join(); + + Assertions.assertEquals(1, result.size()); + + final Object object = result.get(0); + + Assertions.assertInstanceOf(String.class, object); + Assertions.assertTrue(((String) object).contains(TARANTOOL_TAG)); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static TarantoolClient> setupClient() { + // Получаем адрес и порт из докера + // Gets address and port from docker + final InetSocketAddress nodeAddress = CONTAINER.mappedAddress(); + + return TarantoolClientFactory.createClient() + .withAddress(nodeAddress.getHostName(), nodeAddress.getPort()) + .withCredentials( + TarantoolSingleNodeConfigUtils.LOGIN, TarantoolSingleNodeConfigUtils.PWD.toString()) + .build(); + } +} +// --8<-- [end:tarantool-single-instance-cartridge-driver] diff --git a/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionTJSDKExample.java b/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionTJSDKExample.java new file mode 100644 index 0000000..dc22e88 --- /dev/null +++ b/documentation/doc-src/java/src/client/TarantoolSingleInstanceConnectionTJSDKExample.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2025 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY + * All Rights Reserved. + */ + +package client; + +// --8<-- [start:tarantool-single-instance-tjsdk] + +import java.net.InetSocketAddress; +import java.util.Collections; +import java.util.List; + +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import testcontainers.utils.TarantoolSingleNodeConfigUtils; + +import io.tarantool.client.box.TarantoolBoxClient; +import io.tarantool.client.factory.TarantoolBoxClientBuilder; +import io.tarantool.client.factory.TarantoolFactory; +import io.tarantool.mapping.TarantoolResponse; +import io.tarantool.pool.InstanceConnectionGroup; + +public class TarantoolSingleInstanceConnectionTJSDKExample + extends TarantoolSingleInstanceConnectionAbstractExample { + + @Test + @Override + protected void simpleConnection() { + // Получаем адрес и порт из докера + // Gets address and port from docker + final InetSocketAddress nodeAddress = CONTAINER.mappedAddress(); + + // Настраиваем группу подключения + // Set ups connection group + final InstanceConnectionGroup connectionGroup = + InstanceConnectionGroup.builder() + .withHost(nodeAddress.getHostName()) + .withPort(nodeAddress.getPort()) + .withUser(TarantoolSingleNodeConfigUtils.LOGIN) + .withPassword(TarantoolSingleNodeConfigUtils.PWD.toString()) + .build(); + + final TarantoolBoxClientBuilder clientBuilder = + TarantoolFactory.box().withGroups(Collections.singletonList(connectionGroup)); + + try (final TarantoolBoxClient singleNodeClient = clientBuilder.build()) { + + final TarantoolResponse> response = + singleNodeClient.eval("return _TARANTOOL", String.class).join(); + final List results = response.get(); + + Assertions.assertEquals(1, results.size()); + Assertions.assertTrue(results.get(0).contains(TARANTOOL_TAG)); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} +// --8<-- [end:tarantool-single-instance-tjsdk] diff --git a/documentation/doc-src/java/src/testcontainers/utils/TarantoolSingleNodeConfigUtils.java b/documentation/doc-src/java/src/testcontainers/utils/TarantoolSingleNodeConfigUtils.java new file mode 100644 index 0000000..1aa274b --- /dev/null +++ b/documentation/doc-src/java/src/testcontainers/utils/TarantoolSingleNodeConfigUtils.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2025 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY + * All Rights Reserved. + */ + +package testcontainers.utils; + +// --8<-- [start:create-single-instance] + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; + +import org.testcontainers.containers.tarantool.config.ConfigurationUtils; + +import io.tarantool.autogen.Tarantool3Configuration; +import io.tarantool.autogen.credentials.Credentials; +import io.tarantool.autogen.credentials.users.Users; +import io.tarantool.autogen.credentials.users.usersProperty.UsersProperty; +import io.tarantool.autogen.groups.Groups; +import io.tarantool.autogen.groups.groupsProperty.GroupsProperty; +import io.tarantool.autogen.groups.groupsProperty.replicasets.Replicasets; +import io.tarantool.autogen.groups.groupsProperty.replicasets.replicasetsProperty.ReplicasetsProperty; +import io.tarantool.autogen.groups.groupsProperty.replicasets.replicasetsProperty.instances.Instances; +import io.tarantool.autogen.groups.groupsProperty.replicasets.replicasetsProperty.instances.instancesProperty.InstancesProperty; +import io.tarantool.autogen.groups.groupsProperty.replicasets.replicasetsProperty.instances.instancesProperty.iproto.Iproto; +import io.tarantool.autogen.groups.groupsProperty.replicasets.replicasetsProperty.instances.instancesProperty.iproto.listen.Listen; + +public class TarantoolSingleNodeConfigUtils { + + public static final String NODE = "test-node"; + + public static final CharSequence PWD = "secret"; + + public static final String LOGIN = "test-user"; + + /* + // Создает конфигурацию вида: + // Creates configuration like: + --- + credentials: + users: + test-user: + password: "secret" + roles: + - "super" + groups: + test-group: + replicasets: + test-rs: + instances: + test-node: + iproto: + listen: + - uri: "0.0.0.0:3301" + */ + public static Path createConfig(Path tempDir) throws IOException { + final Path pathToConfigFile = Files.createFile(tempDir.resolve("config.yaml")); + + final Credentials credentials = + Credentials.builder() + .withUsers( + Users.builder() + .withAdditionalProperty( + LOGIN, + UsersProperty.builder() + .withRoles(Collections.singletonList("super")) + .withPassword(PWD.toString()) + .build()) + .build()) + .build(); + + final Iproto iproto = + Iproto.builder() + .withListen(Collections.singletonList(Listen.builder().withUri("0.0.0.0:3301").build())) + .build(); + + final InstancesProperty instance = InstancesProperty.builder().withIproto(iproto).build(); + + final ReplicasetsProperty replicaset = + ReplicasetsProperty.builder() + .withInstances(Instances.builder().withAdditionalProperty(NODE, instance).build()) + .build(); + + final GroupsProperty group = + GroupsProperty.builder() + .withReplicasets( + Replicasets.builder().withAdditionalProperty("test-rs", replicaset).build()) + .build(); + + final Tarantool3Configuration configuration = + Tarantool3Configuration.builder() + .withGroups(Groups.builder().withAdditionalProperty("test-group", group).build()) + .withCredentials(credentials) + .build(); + + ConfigurationUtils.writeToFile(configuration, pathToConfigFile); + return pathToConfigFile; + } +} + +// --8<-- [end:create-single-instance] diff --git a/documentation/docs/documentation/client/arch/balancer.en.md b/documentation/doc-src/pages/client/arch/balancer.en.md similarity index 87% rename from documentation/docs/documentation/client/arch/balancer.en.md rename to documentation/doc-src/pages/client/arch/balancer.en.md index 3e17516..381a82c 100644 --- a/documentation/docs/documentation/client/arch/balancer.en.md +++ b/documentation/doc-src/pages/client/arch/balancer.en.md @@ -12,16 +12,16 @@ between Tarantool nodes. The balancer abstraction in `Tarantool Java EE` is represented by the `TarantoolBalancer` interface. Let's look at how balancing works in the Java client: -
-
How the balancer works
- +
+
How the balancer works
+![](../../../assets/drawio/client/balancer.drawio)
1. The programmer executes a request through the API of high-level clients (`TarantoolClient`, `TarantoolCrudClient` or `TarantoolBoxClient`) 2. The high-level client requests a connection to execute the request from `TarantoolBalancer` 3. The balancer, using its logic, requests an available node from the connection pool (`IProtoClientPool`) - Node availability is determined using the [heartbeat](./heartbeat.md) mechanism + Node availability is determined using the [heartbeat](heartbeat.md) mechanism 4. The connection pool returns an available connection to the balancer 5. The balancer provides the high-level client with a connection 6. The high-level client executes the request through the provided connection @@ -40,9 +40,9 @@ By default, the following types of balancers are available: #### TarantoolRoundRobinBalancer -
+
How the balancer works
- +![](../../../assets/drawio/client/round-robin.drawio)
This implementation of the `TarantoolBalancer` interface performs connection selection according to the following @@ -55,9 +55,9 @@ algorithm: #### TarantoolDistributingRoundRobinBalancer -
+
How the balancer works
- +![](../../../assets/drawio/client/distributing-round-robin.drawio)
This implementation of the `TarantoolBalancer` interface performs connection selection according to the following diff --git a/documentation/docs/documentation/client/arch/balancer.md b/documentation/doc-src/pages/client/arch/balancer.md similarity index 92% rename from documentation/docs/documentation/client/arch/balancer.md rename to documentation/doc-src/pages/client/arch/balancer.md index d266bf7..f82076f 100644 --- a/documentation/docs/documentation/client/arch/balancer.md +++ b/documentation/doc-src/pages/client/arch/balancer.md @@ -12,16 +12,16 @@ title: Балансировка Абстракция балансировщика в `Tarantool Java EE` представлена интерфейсом `TarantoolBalancer`. Рассмотрим принцип работы балансировки в Java-клиенте: -
-
Работа балансировщика
- +
+
Работа балансировщика
+![](../../../assets/drawio/client/balancer.drawio)
1. Программист выполняется запрос через API высокоуровневых клиентов (`TarantoolClient`, `TarantoolCrudClient` или `TarantoolBoxClient`) 2. Высокоуровневый клиент запрашивает соединение для выполнения запроса у `TarantoolBalancer` 3. Балансировщик, используя свою логику, запрашивает у пула соединений (`IProtoClientPool`) - доступный узел. Доступность узлов определяется с помощью механизма [heartbeat](./heartbeat.md) + доступный узел. Доступность узлов определяется с помощью механизма [heartbeat](heartbeat.md) 4. Пул соединений возвращает доступное соединение балансировщику 5. Балансировщик предоставляет высокоуровневому клиенту соединение 6. Высокоуровневый клиент выполняет запрос через предоставленное соединение @@ -40,9 +40,9 @@ title: Балансировка #### TarantoolRoundRobinBalancer -
+
Работа балансировщика
- +![](../../../assets/drawio/client/round-robin.drawio)
Данная реализация интерфейса `TarantoolBalancer` выполняет выбор соединений по следующему @@ -55,9 +55,9 @@ title: Балансировка #### TarantoolDistributingRoundRobinBalancer -
+
Работа балансировщика
- +![](../../../assets/drawio/client/distributing-round-robin.drawio)
Данная реализация интерфейса `TarantoolBalancer` выполняет выбор соединений по следующему diff --git a/documentation/docs/documentation/client/arch/call.en.md b/documentation/doc-src/pages/client/arch/call.en.md similarity index 97% rename from documentation/docs/documentation/client/arch/call.en.md rename to documentation/doc-src/pages/client/arch/call.en.md index 2927b91..f49194d 100644 --- a/documentation/docs/documentation/client/arch/call.en.md +++ b/documentation/doc-src/pages/client/arch/call.en.md @@ -124,5 +124,5 @@ data = [true] // array with one boolean element Stored procedures can accept 0 or more input and output arguments. Conversion of Java types to Tarantool types is performed using Jackson serializers/deserializers -([more details](./tuple_pojo_mapping.md)). To specify custom type conversions, +([more details](tuple_pojo_mapping.md)). To specify custom type conversions, refer to the [Jackson documentation](https://github.com/FasterXML/jackson-databind/wiki). diff --git a/documentation/docs/documentation/client/arch/call.md b/documentation/doc-src/pages/client/arch/call.md similarity index 96% rename from documentation/docs/documentation/client/arch/call.md rename to documentation/doc-src/pages/client/arch/call.md index 13f1d0e..154a5c0 100644 --- a/documentation/docs/documentation/client/arch/call.md +++ b/documentation/doc-src/pages/client/arch/call.md @@ -127,5 +127,5 @@ data = [true] // массив из одного жлемента типа boolea Хранимые процедуры могут принимать 0 или более входных и выходных аргументов. Преобразование Java-типов в типы Tarantool производится с помощью Jackson сериализаторов/десериализаторов -([подробнее](./tuple_pojo_mapping.md)). Для того чтобы задать пользовательские преобразования типов, +([подробнее](tuple_pojo_mapping.md)). Для того чтобы задать пользовательские преобразования типов, обратитесь к [документации Jackson](https://github.com/FasterXML/jackson-databind/wiki). diff --git a/documentation/docs/documentation/client/arch/connection-pool.en.md b/documentation/doc-src/pages/client/arch/connection-pool.en.md similarity index 72% rename from documentation/docs/documentation/client/arch/connection-pool.en.md rename to documentation/doc-src/pages/client/arch/connection-pool.en.md index 8348db9..9f5d59a 100644 --- a/documentation/docs/documentation/client/arch/connection-pool.en.md +++ b/documentation/doc-src/pages/client/arch/connection-pool.en.md @@ -6,23 +6,23 @@ title: Connection Pool In the `Tarantool Java SDK`, the connection pool represents a set of connections to Tarantool nodes, grouped into logical groups. These groups are created using instances of the `InstanceConnectionGroup` class, -which contains the necessary metadata. More details about [InstanceConnectionGroup](./instance-connection-group.md). +which contains the necessary metadata. More details about [InstanceConnectionGroup](instance-connection-group.md). When creating `TarantoolCrudClient` or `TarantoolBoxClient`, one instance of `IprotoClientPool` is created. This pool, based on the `InstanceConnectionGroup` passed to it, creates within itself instances of `PoolEntry`, which manage the lifecycle of their connection (connection/disconnection process, -[heartbeat](./heartbeat.md)). Each `PoolEntry` is associated only with one logical group. All `PoolEntry` in one logical group +[heartbeat](heartbeat.md)). Each `PoolEntry` is associated only with one logical group. All `PoolEntry` in one logical group contain their own connections to the same node. -
-
Location of IProtoClientPool in the Java client architecture
- +
+
Location of IProtoClientPool in the Java client architecture
+![](../../../assets/drawio/client/connection-pool.drawio)
`IProtoClientPool` should be considered as a container designed to store a set of connections. When executing requests, `IProtoClientPool` acts as an object that provides active connections to the balancer (no more than one). More detailed information about connection selection during -requests can be found in the [balancers](./balancer.md) section. +requests can be found in the [balancers](balancer.md) section. ???+ warning "Important" diff --git a/documentation/docs/documentation/client/arch/connection-pool.md b/documentation/doc-src/pages/client/arch/connection-pool.md similarity index 81% rename from documentation/docs/documentation/client/arch/connection-pool.md rename to documentation/doc-src/pages/client/arch/connection-pool.md index 8509859..40535ec 100644 --- a/documentation/docs/documentation/client/arch/connection-pool.md +++ b/documentation/doc-src/pages/client/arch/connection-pool.md @@ -7,24 +7,24 @@ title: Пул соединений В `Tarantool Java SDK` пул соединений представляет собой набор подключений к узлам Tarantool, объединенных в логические группы. Эти группы создаются с помощью экземпляров класса `InstanceConnectionGroup`, который содержит необходимые метаданные. Более подробно о -[InstanceConnectionGroup](./instance-connection-group.md). +[InstanceConnectionGroup](instance-connection-group.md). При создании `TarantoolCrudClient` или `TarantoolBoxClient` создается один экземпляр `IprotoClientPool`. Этот пул, на основе переданных ему `InstanceConnectionGroup`, создает внутри себя экземпляры `PoolEntry`, которые управляют жизненным циклом своего соединения (процесс -подключения/отключения, [heartbeat](./heartbeat.md)). Каждый `EntryPool` связан только с одной +подключения/отключения, [heartbeat](heartbeat.md)). Каждый `EntryPool` связан только с одной логической группой. Все `EntryPool` в одной логической группе содержат свои собственные соединения к одному и тому же узлу. -
-
Место IProtoClientPool в архитектуре Java-клиента
- +
+
Место IProtoClientPool в архитектуре Java-клиента
+![](../../../assets/drawio/client/connection-pool.drawio)
`IProtoClientPool` следует рассматривать как контейнер, предназначенный для хранения набора соединений. При выполнении запросов `IProtoClientPool` действует как объект, предоставляющий балансировщику активные соединения (не более). Более подробную информацию о выборе соединения при -запросах можно найти в разделе о [балансировщиках](./balancer.md). +запросах можно найти в разделе о [балансировщиках](balancer.md). ???+ warning "Важно" diff --git a/documentation/docs/documentation/client/arch/connection-to-multiple-nodes.en.md b/documentation/doc-src/pages/client/arch/connection-to-multiple-nodes.en.md similarity index 93% rename from documentation/docs/documentation/client/arch/connection-to-multiple-nodes.en.md rename to documentation/doc-src/pages/client/arch/connection-to-multiple-nodes.en.md index 4c68c44..d63ca73 100644 --- a/documentation/docs/documentation/client/arch/connection-to-multiple-nodes.en.md +++ b/documentation/doc-src/pages/client/arch/connection-to-multiple-nodes.en.md @@ -37,9 +37,9 @@ To connect to Tarantool regardless of mode (cluster or single node), the followi Let's consider an example with the following cluster topology: -
-
Example vshard cluster topology
- +
+
Example vshard cluster topology
+![](../../../assets/images/client/few-nodes-crud.svg)
To configure `TarantoolCrudClient`, you need to use the @@ -120,9 +120,9 @@ the example, this is the space named `person`. In general, `TarantoolBoxClient` instances are intended for working with a single Tarantool node, but there are scenarios where `TarantoolBoxSpace` can be used when working with multiple nodes: -
-
Selecting data from multiple replicas of one shard
- +
+
Selecting data from multiple replicas of one shard
+![](../../../assets/images/client/few-replicas-box.svg)
In the example above, one of the replicas `replica-1` fails. The Java client needs to continue @@ -136,7 +136,7 @@ final TarantoolBoxClientBuilder boxBuilder = TarantoolFactory.box(); ``` Next, you need to configure connection groups to replica nodes, similar to how it -is demonstrated in the section "[Connecting to Multiple Router Nodes via TarantoolCrudClient API](./connection-to-multiple-nodes.md): +is demonstrated in the section "[Connecting to Multiple Router Nodes via TarantoolCrudClient API](connection-to-multiple-nodes.md): ```java final InstanceConnectionGroup firstReplicaConnectionGroup = InstanceConnectionGroup.builder() diff --git a/documentation/docs/documentation/client/arch/connection-to-multiple-nodes.md b/documentation/doc-src/pages/client/arch/connection-to-multiple-nodes.md similarity index 95% rename from documentation/docs/documentation/client/arch/connection-to-multiple-nodes.md rename to documentation/doc-src/pages/client/arch/connection-to-multiple-nodes.md index 9ee5289..81a0045 100644 --- a/documentation/docs/documentation/client/arch/connection-to-multiple-nodes.md +++ b/documentation/doc-src/pages/client/arch/connection-to-multiple-nodes.md @@ -39,9 +39,9 @@ title: Подключение к нескольким узлам Рассмотрим пример со следующей топологией кластера Tarantool: -
-
Пример топологии vshard-кластера
- +
+
Пример топологии vshard-кластера
+![](../../../assets/images/client/few-nodes-crud.svg)
Для того чтобы настроить `TarantoolCrudClient`, необходимо воспользоваться API @@ -122,9 +122,9 @@ final TarantoolCrudSpace personSpace = crudClient.space("person"); В общем случае экземпляры `TarantoolBoxClient` предназначены для работы с одиночным узлом Tarantool, но есть сценарии, в которых `TarantoolBoxSpace` можно использовать при работе с несколькими узлами: -
-
Выборка данных с нескольких реплик одного шарда
- +
+
Выборка данных с нескольких реплик одного шарда
+![](../../../assets/images/client/few-replicas-box.svg)
В приведенном примере одна из реплик `replica-1` отказывает. Необходимо, чтобы Java-клиент продолжал @@ -139,7 +139,7 @@ final TarantoolBoxClientBuilder boxBuilder = TarantoolFactory.box(); Далее необходимо настроить группы подключений к узлам-репликам, аналогично тому, как это демонстрируется в секции "[Подключение к нескольким узлам-маршрутизаторам Tarantool через -TarantoolCrudClient API](./connection-to-multiple-nodes.md): +TarantoolCrudClient API](connection-to-multiple-nodes.md): ```java final InstanceConnectionGroup firstReplicaConnectionGroup = InstanceConnectionGroup.builder() diff --git a/documentation/docs/documentation/client/arch/exception-handling.en.md b/documentation/doc-src/pages/client/arch/exception-handling.en.md similarity index 99% rename from documentation/docs/documentation/client/arch/exception-handling.en.md rename to documentation/doc-src/pages/client/arch/exception-handling.en.md index 3692cab..552aa68 100644 --- a/documentation/docs/documentation/client/arch/exception-handling.en.md +++ b/documentation/doc-src/pages/client/arch/exception-handling.en.md @@ -333,7 +333,7 @@ final Tuple> exceptionallyTuple = space.insert(tupleWithSameId).join(); Tarantool allows returning Go-like tuples in the return value of stored procedures. In this case, the user must take care of proper conversion of lua and Java types, based on the rules of -[conversion](./tuple_pojo_mapping.md). +[conversion](tuple_pojo_mapping.md). Consider the following procedure: diff --git a/documentation/docs/documentation/client/arch/exception-handling.md b/documentation/doc-src/pages/client/arch/exception-handling.md similarity index 99% rename from documentation/docs/documentation/client/arch/exception-handling.md rename to documentation/doc-src/pages/client/arch/exception-handling.md index 3015983..5f8fb27 100644 --- a/documentation/docs/documentation/client/arch/exception-handling.md +++ b/documentation/doc-src/pages/client/arch/exception-handling.md @@ -334,7 +334,7 @@ final Tuple> exceptionallyTuple = space.insert(tupleWithSameId).join(); Tarantool допускает возврат Go-like кортежей в возвращаемом значении хранимых процедур. В этом случае пользователь должен позаботиться о правильности преобразования lua и Java типов, основываясь -на правилах [преобразования](./tuple_pojo_mapping.md). +на правилах [преобразования](tuple_pojo_mapping.md). Рассмотрим следующую процедуру: diff --git a/documentation/docs/documentation/client/arch/heartbeat.en.md b/documentation/doc-src/pages/client/arch/heartbeat.en.md similarity index 86% rename from documentation/docs/documentation/client/arch/heartbeat.en.md rename to documentation/doc-src/pages/client/arch/heartbeat.en.md index 10e0c13..bdecd98 100644 --- a/documentation/docs/documentation/client/arch/heartbeat.en.md +++ b/documentation/doc-src/pages/client/arch/heartbeat.en.md @@ -6,7 +6,7 @@ title: Heartbeat Architecture `heartbeat` is a background task that sends periodic ping requests to the Tarantool node and analyzes the results of successful and unsuccessful ping requests. The `heartbeat` task is set up for -each `PoolEntry` in [IProtoClientPool](./connection-pool.md). The main purpose of `heartbeat` - +each `PoolEntry` in [IProtoClientPool](connection-pool.md). The main purpose of `heartbeat` - to monitor the availability of the connection to the `Tarantool` node ### How It Works @@ -18,22 +18,22 @@ that the following `heartbeat` settings were specified: - `deathThreshold == 4` - `windowSize == 3` -
-
How heartbeat works
- +
+
How heartbeat works
+![](../../../assets/drawio/client/heartbeat.drawio)
Availability analysis of the node is performed using ping requests. If the number of failed ping requests at the moment of consideration exceeds the value `invalidationThreshold` in the window, then the connection is excluded -from the [connection pool](./connection-pool.md) for selection by the [balancer](./balancer.md) (4,5,6). For +from the [connection pool](connection-pool.md) for selection by the [balancer](balancer.md) (4,5,6). For the excluded connection, the `heartbeat` process continues. Each exceeding of `invalidationThreshold` increases the `currentDeathThreshold` counter by 1. If `currentDeathThreshold` reaches the value `deathThreshold`, the connection is considered `dead` (status `KILL`) and the reconnection process of the connection is started (7). -
-
Transition from INVALIDATE to ACTIVATE
- +
+
Transition from INVALIDATE to ACTIVATE
+![](../../../assets/drawio/client/heartbeat-1.drawio)
The transition from the `INVALIDATE` state to the `ACTIVATE` state occurs if in subsequent iterations diff --git a/documentation/docs/documentation/client/arch/heartbeat.md b/documentation/doc-src/pages/client/arch/heartbeat.md similarity index 88% rename from documentation/docs/documentation/client/arch/heartbeat.md rename to documentation/doc-src/pages/client/arch/heartbeat.md index fe11849..5960ebd 100644 --- a/documentation/docs/documentation/client/arch/heartbeat.md +++ b/documentation/doc-src/pages/client/arch/heartbeat.md @@ -6,7 +6,7 @@ title: Архитектура heartbeat `heartbeat` - это фоновая задача, оправляющая постоянные ping-запросы к узлу Tarantool и анализирующая результаты успешных и неуспешных ping-запросов. Задача `heartbeat` устанавливается для -каждого `PoolEntry` в [IProtoClientPool](./connection-pool.md). Главная задача `heartbeat` - +каждого `PoolEntry` в [IProtoClientPool](connection-pool.md). Главная задача `heartbeat` - отслеживать доступность соединения к узлу `Tarantool` ### Принцип работы @@ -18,22 +18,22 @@ title: Архитектура heartbeat - `deathThreshold == 4` - `windowSize == 3` -
-
Принцип работы heartbeat
- +
+
Принцип работы heartbeat
+![](../../../assets/drawio/client/heartbeat.drawio)
Анализ доступности узла проводится с помощью ping-запросов. Если количество неудачных ping-запросов в момент рассмотрения превышает значение `invalidationThreshold` в окне, то соединение исключается -из [пула соединений](./connection-pool.md) для выбора [балансировщиком](./balancer.md) (4,5,6). Для +из [пула соединений](connection-pool.md) для выбора [балансировщиком](balancer.md) (4,5,6). Для исключенного соединения процесс `heartbeat`продолжается. Каждое превышение `invalidationThreshold` увеличивает значение счетчика `currentDeathThreshold` на 1. Если `currentDeathThreshold` достигает значения `deathThreshold` соединение считается `мертвым` (статус `KILL`) и запускается процесс переподключения соединения (7). -
-
Переход из INVALIDATE к ACTIVATE
- +
+
Переход из INVALIDATE к ACTIVATE
+![](../../../assets/drawio/client/heartbeat-1.drawio)
Переход из состояния `INVALIDATE` в состояние `ACTIVATE` происходит если при последующих итерациях diff --git a/documentation/docs/documentation/client/arch/high-level-arch.en.md b/documentation/doc-src/pages/client/arch/high-level-arch.en.md similarity index 71% rename from documentation/docs/documentation/client/arch/high-level-arch.en.md rename to documentation/doc-src/pages/client/arch/high-level-arch.en.md index 9246776..24f10d9 100644 --- a/documentation/docs/documentation/client/arch/high-level-arch.en.md +++ b/documentation/doc-src/pages/client/arch/high-level-arch.en.md @@ -4,30 +4,30 @@ title: Interaction with Tarantool Java SDK ## High-Level Architecture of Interaction with Tarantool Java SDK -
-
High-Level Architecture of Tarantool Java SDK
- +
+
High-Level Architecture of Tarantool Java SDK
+![](../../../assets/drawio/client/high-level-arch.drawio)
To interact with `Tarantool`, the `Tarantool Java SDK` uses the `IProto` protocol, which is implemented in classes supporting the `IProtoClient` interface. Connection management and their -state are handled through `PoolEntry` objects, which wrap `IProtoClient`. The mechanism [heartbeat](./heartbeat.md) is used +state are handled through `PoolEntry` objects, which wrap `IProtoClient`. The mechanism [heartbeat](heartbeat.md) is used to check connection availability. To work with multiple connections simultaneously, `PoolEntry` objects are grouped into -logical groups within [IProtoClientPool](./connection-pool.md). These groups represent +logical groups within [IProtoClientPool](connection-pool.md). These groups represent sets of connections to a single `Tarantool` node and are configured using metadata passed -through instances of the [InstanceConnectionGroup](./instance-connection-group.md) class. +through instances of the [InstanceConnectionGroup](instance-connection-group.md) class. The connection pool performs the following functions: * Creates logically separated sets of `PoolEntry` when creating a client, using metadata from - objects of the [InstanceConnectionGroup](./instance-connection-group.md) class -* Provides [available](./heartbeat.md) connections upon request from the [balancer](./balancer.md) + objects of the [InstanceConnectionGroup](instance-connection-group.md) class +* Provides [available](heartbeat.md) connections upon request from the [balancer](balancer.md) * Closes connections when the client shuts down The selection of a connection for executing a request is performed using an object of a class implementing -the [TarantoolBalancer](./balancer.md) interface. +the [TarantoolBalancer](balancer.md) interface. For working with logically separated groups of connections, high-level clients are used ( `TarantoolClient`, `TarantoolCrudClient` and `TarantoolBoxClient`), which provide a convenient @@ -40,7 +40,7 @@ looks as follows: `TarantoolCrudClient` or `TarantoolBoxClient`) 2. The high-level client requests a connection to execute the request from `TarantoolBalancer` 3. The balancer, using its logic, requests an available node from the connection pool (`IProtoClientPool`) - Available nodes are determined using the [heartbeat](./heartbeat.md) mechanism + Available nodes are determined using the [heartbeat](heartbeat.md) mechanism 4. The connection pool returns an available connection to the balancer 5. The balancer provides the high-level client with a connection 6. The high-level client executes the request through the provided connection diff --git a/documentation/docs/documentation/client/arch/high-level-arch.md b/documentation/doc-src/pages/client/arch/high-level-arch.md similarity index 82% rename from documentation/docs/documentation/client/arch/high-level-arch.md rename to documentation/doc-src/pages/client/arch/high-level-arch.md index d3cff85..0b83567 100644 --- a/documentation/docs/documentation/client/arch/high-level-arch.md +++ b/documentation/doc-src/pages/client/arch/high-level-arch.md @@ -4,30 +4,31 @@ title: Взаимодействие с Tarantool Java SDK ## Высокоуровневая архитектура взаимодействия с Tarantool Java SDK -
-
Высокоуровневая архитектура Tarantool Java SDK
- + +
+
Высокоуровневая архитектура Tarantool Java SDK
+![](../../../assets/drawio/client/high-level-arch.drawio)
Для взаимодействия с `Tarantool`, `Tarantool Java SDK` использует протокол `IProto`, который реализован в классах, поддерживающих интерфейс `IProtoClient`. Управление соединениями и их состоянием осуществляется через объекты `PoolEntry`, которые оборачивают `IProtoClient`. Для -проверки доступности соединений используется механизм [heartbeat](./heartbeat.md). +проверки доступности соединений используется механизм [heartbeat](heartbeat.md). Чтобы работать с несколькими соединениями одновременно, объекты `PoolEntry` объединяются в -логические группы внутри [IProtoClientPool](./connection-pool.md). Эти группы представляют собой +логические группы внутри [IProtoClientPool](connection-pool.md). Эти группы представляют собой наборы соединений к одному узлу `Tarantool` и настраиваются с помощью метаданных, переданных -через экземпляры класса [InstanceConnectionGroup](./instance-connection-group.md). +через экземпляры класса [InstanceConnectionGroup](instance-connection-group.md). Пул соединений выполняет следующие функции: * Создает логически разделенные наборы `PoolEntry` при создании клиента, используя метаданные из - объектов класса [InstanceConnectionGroup](./instance-connection-group.md) -* Предоставляет [доступные](./heartbeat.md) соединения по запросу [балансировщика](./balancer.md) + объектов класса [InstanceConnectionGroup](instance-connection-group.md) +* Предоставляет [доступные](heartbeat.md) соединения по запросу [балансировщика](balancer.md) * Закрывает соединения при завершении работы клиента Выбор соединения для выполнения запроса осуществляется с помощью объекта класса, реализующего -интерфейс [TarantoolBalancer](./balancer.md). +интерфейс [TarantoolBalancer](balancer.md). Для работы с логически разделенными группами соединений используются высокоуровневые клиенты ( `TarantoolClient`, `TarantoolCrudClient` и `TarantoolBoxClient`), которые предоставляют удобный @@ -40,7 +41,7 @@ API. `TarantoolCrudClient` или `TarantoolBoxClient`) 2. Высокоуровневый клиент запрашивает соединение для выполнения запроса у `TarantoolBalancer` 3. Балансировщик, используя свою логику, запрашивает у пула соединений (`IProtoClientPool`) - доступный узел. Доступность узлов определяется с помощью механизма [heartbeat](./heartbeat.md) + доступный узел. Доступность узлов определяется с помощью механизма [heartbeat](heartbeat.md) 4. Пул соединений возвращает доступное соединение балансировщику 5. Балансировщик предоставляет высокоуровневому клиенту соединение 6. Высокоуровневый клиент выполняет запрос через предоставленное соединение diff --git a/documentation/docs/documentation/client/arch/index.en.md b/documentation/doc-src/pages/client/arch/index.en.md similarity index 100% rename from documentation/docs/documentation/client/arch/index.en.md rename to documentation/doc-src/pages/client/arch/index.en.md diff --git a/documentation/docs/documentation/client/arch/index.md b/documentation/doc-src/pages/client/arch/index.md similarity index 100% rename from documentation/docs/documentation/client/arch/index.md rename to documentation/doc-src/pages/client/arch/index.md diff --git a/documentation/docs/documentation/client/arch/instance-connection-group.en.md b/documentation/doc-src/pages/client/arch/instance-connection-group.en.md similarity index 93% rename from documentation/docs/documentation/client/arch/instance-connection-group.en.md rename to documentation/doc-src/pages/client/arch/instance-connection-group.en.md index 64632d4..70ad424 100644 --- a/documentation/docs/documentation/client/arch/instance-connection-group.en.md +++ b/documentation/doc-src/pages/client/arch/instance-connection-group.en.md @@ -8,9 +8,9 @@ title: Connection Group ### Connection Groups Concept -
-
Location of InstanceConnectionGroup in the Java client architecture
- +
+
Location of InstanceConnectionGroup in the Java client architecture
+![](../../../assets/drawio/client/instance-connection-group.drawio)
High-level clients `TarantoolCrudClient`/ `TarantoolBoxClient` interact with @@ -23,7 +23,7 @@ metadata from one object of the `InstanceConnectionGroup` class. Using multiple connections within one group allows you to increase the performance of the Java client, especially in situations where data operations are performed in parallel. The selection -of a connection for executing a request is determined by the balancing rules ([more details](./balancer.md)). +of a connection for executing a request is determined by the balancing rules ([more details](balancer.md)). ### Parameter Description diff --git a/documentation/docs/documentation/client/arch/instance-connection-group.md b/documentation/doc-src/pages/client/arch/instance-connection-group.md similarity index 94% rename from documentation/docs/documentation/client/arch/instance-connection-group.md rename to documentation/doc-src/pages/client/arch/instance-connection-group.md index b3979fe..836a2b7 100644 --- a/documentation/docs/documentation/client/arch/instance-connection-group.md +++ b/documentation/doc-src/pages/client/arch/instance-connection-group.md @@ -9,9 +9,9 @@ Tarantool. ### Концепция групп соединений -
-
Место InstanceConnectionGroup в архитектуре Java-клиента
- +
+
Место InstanceConnectionGroup в архитектуре Java-клиента
+![](../../../assets/drawio/client/instance-connection-group.drawio)
Высокоуровневые клиенты `TarantoolCrudClient`/ `TarantoolBoxClient` осуществляют взаимодействие с @@ -24,7 +24,7 @@ Tarantool. Использование нескольких соединений в рамках одной группы позволяет повысить производительность работы Java-клиента, особенно в ситуациях, когда операции над данными выполняются параллельно. Выбор -соединения для выполнения запроса определяется правилами балансировки ([подробнее](./balancer.md)). +соединения для выполнения запроса определяется правилами балансировки ([подробнее](balancer.md)). ### Описание параметров diff --git a/documentation/docs/documentation/client/arch/tuple_pojo_mapping.en.md b/documentation/doc-src/pages/client/arch/tuple_pojo_mapping.en.md similarity index 99% rename from documentation/docs/documentation/client/arch/tuple_pojo_mapping.en.md rename to documentation/doc-src/pages/client/arch/tuple_pojo_mapping.en.md index ca24f06..2d40c15 100644 --- a/documentation/docs/documentation/client/arch/tuple_pojo_mapping.en.md +++ b/documentation/doc-src/pages/client/arch/tuple_pojo_mapping.en.md @@ -2,7 +2,7 @@ title: Data Mapping --- -## Tarantool <-> Java POJO Field Mapping +## Tarantool ⟷ Java POJO Field Mapping Working with Plain Old Java Objects (POJO) in Tarantool is done using the Jackson library. diff --git a/documentation/docs/documentation/client/arch/tuple_pojo_mapping.md b/documentation/doc-src/pages/client/arch/tuple_pojo_mapping.md similarity index 99% rename from documentation/docs/documentation/client/arch/tuple_pojo_mapping.md rename to documentation/doc-src/pages/client/arch/tuple_pojo_mapping.md index c306ba9..a6815b3 100644 --- a/documentation/docs/documentation/client/arch/tuple_pojo_mapping.md +++ b/documentation/doc-src/pages/client/arch/tuple_pojo_mapping.md @@ -2,7 +2,7 @@ title: Маппинг данных --- -## Маппинг полей Tarantool <-> Java POJO +## Маппинг полей Tarantool ⟷ Java POJO Работа с Plain Old Java Objects (POJO) в Tarantool происходит с помощью библиотеки Jackson. diff --git a/documentation/doc-src/pages/client/examples/connection/index.en.md b/documentation/doc-src/pages/client/examples/connection/index.en.md new file mode 100644 index 0000000..b8cc404 --- /dev/null +++ b/documentation/doc-src/pages/client/examples/connection/index.en.md @@ -0,0 +1,7 @@ +--- +title: Connection to instances +hide: + - toc +--- + +This section provides examples of connecting to Tarantool using the `tarantool-java-sdk`. diff --git a/documentation/doc-src/pages/client/examples/connection/index.md b/documentation/doc-src/pages/client/examples/connection/index.md new file mode 100644 index 0000000..dabe45d --- /dev/null +++ b/documentation/doc-src/pages/client/examples/connection/index.md @@ -0,0 +1,7 @@ +--- +title: Подключение к узлам +hide: + - toc +--- + +В данном разделе приводятся примеры подключения к Tarantool с помощью `tarantool-java-sdk`. diff --git a/documentation/doc-src/pages/client/examples/connection/single-node.en.md b/documentation/doc-src/pages/client/examples/connection/single-node.en.md new file mode 100644 index 0000000..f483abf --- /dev/null +++ b/documentation/doc-src/pages/client/examples/connection/single-node.en.md @@ -0,0 +1,34 @@ +--- +title: Connection to single instance Tarantool +--- + +To connect to a single instance, run the following code: + +=== "tarantool-java-sdk" + + ```java title="Connection to single instance Tarantool" + --8<-- "client/TarantoolSingleInstanceConnectionTJSDKExample.java:tarantool-single-instance-tjsdk" + ``` + + ```java title="Parent abstract class to create docker container" + --8<-- "client/TarantoolSingleInstanceConnectionAbstractExample.java:tarantool-single-instance-abstract" + ``` + + ```java title="Class to create container" + --8<-- "testcontainers/utils/TarantoolSingleNodeConfigUtils.java:create-single-instance" + ``` + +=== "cartridge-driver" + + ```java title="Connection to single instance Tarantool" + --8<-- "client/TarantoolSingleInstanceConnectionCartridgeDriverExample.java:tarantool-single-instance-cartridge-driver" + ``` + + ```java title="Parent abstract class to create docker container" + --8<-- "client/TarantoolSingleInstanceConnectionAbstractExample.java:tarantool-single-instance-abstract" + ``` + + ```java title="Class to create container" + --8<-- "testcontainers/utils/TarantoolSingleNodeConfigUtils.java:create-single-instance" + ``` + \ No newline at end of file diff --git a/documentation/doc-src/pages/client/examples/connection/single-node.md b/documentation/doc-src/pages/client/examples/connection/single-node.md new file mode 100644 index 0000000..e2bf395 --- /dev/null +++ b/documentation/doc-src/pages/client/examples/connection/single-node.md @@ -0,0 +1,33 @@ +--- +title: Подключение к одиночному узлу +--- + +Для того чтобы подключиться к одиночному узлу необходимо выполнить следующий код: + +=== "tarantool-java-sdk" + + ```java title="Подключение к одному узлу Tarantool" + --8<-- "client/TarantoolSingleInstanceConnectionTJSDKExample.java:tarantool-single-instance-tjsdk" + ``` + + ```java title="Родительский класс с созданием контейнера" + --8<-- "client/TarantoolSingleInstanceConnectionAbstractExample.java:tarantool-single-instance-abstract" + ``` + + ```java title="Класс, который создает контейнер" + --8<-- "testcontainers/utils/TarantoolSingleNodeConfigUtils.java:create-single-instance" + ``` + +=== "cartridge-driver" + + ```java title="Подключение к одному узлу Tarantool" + --8<-- "client/TarantoolSingleInstanceConnectionCartridgeDriverExample.java:tarantool-single-instance-cartridge-driver" + ``` + + ```java title="Родительский класс с созданием контейнера" + --8<-- "client/TarantoolSingleInstanceConnectionAbstractExample.java:tarantool-single-instance-abstract" + ``` + + ```java title="Класс, который создает контейнер" + --8<-- "testcontainers/utils/TarantoolSingleNodeConfigUtils.java:create-single-instance" + ``` diff --git a/documentation/doc-src/pages/client/examples/index.en.md b/documentation/doc-src/pages/client/examples/index.en.md new file mode 100644 index 0000000..2500ea7 --- /dev/null +++ b/documentation/doc-src/pages/client/examples/index.en.md @@ -0,0 +1,12 @@ +--- +title: Usage examples +hide: + - toc +--- + +This section provides examples of using the `tarantool-java-sdk`. + +???+ note + + Where possible, the code is compared with + [cartridge-java](https://github.com/tarantool/cartridge-java) diff --git a/documentation/doc-src/pages/client/examples/index.md b/documentation/doc-src/pages/client/examples/index.md new file mode 100644 index 0000000..72d969f --- /dev/null +++ b/documentation/doc-src/pages/client/examples/index.md @@ -0,0 +1,12 @@ +--- +title: Примеры использования +hide: + - toc +--- + +В разделе приводятся примеры использования `tarantool-java-sdk`. + +???+ note "Заметка" + + Где это возможно, производится сравнение кода с + [cartridge-java](https://github.com/tarantool/cartridge-java) diff --git a/documentation/docs/documentation/client/index.en.md b/documentation/doc-src/pages/client/index.en.md similarity index 100% rename from documentation/docs/documentation/client/index.en.md rename to documentation/doc-src/pages/client/index.en.md diff --git a/documentation/docs/documentation/client/index.md b/documentation/doc-src/pages/client/index.md similarity index 100% rename from documentation/docs/documentation/client/index.md rename to documentation/doc-src/pages/client/index.md diff --git a/documentation/docs/documentation/index.en.md b/documentation/doc-src/pages/index.en.md similarity index 100% rename from documentation/docs/documentation/index.en.md rename to documentation/doc-src/pages/index.en.md diff --git a/documentation/docs/documentation/index.md b/documentation/doc-src/pages/index.md similarity index 79% rename from documentation/docs/documentation/index.md rename to documentation/doc-src/pages/index.md index 93487f8..665ab4b 100644 --- a/documentation/docs/documentation/index.md +++ b/documentation/doc-src/pages/index.md @@ -4,4 +4,4 @@ hide: - toc --- -Документация разделена на секции - каждая из которых применима к одному из модулей библиотеки. \ No newline at end of file +Документация разделена на секции - каждая из которых применима к одному из модулей библиотеки. diff --git a/documentation/docs/documentation/spring-data/configuration.en.md b/documentation/doc-src/pages/spring-data/configuration.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/configuration.en.md rename to documentation/doc-src/pages/spring-data/configuration.en.md diff --git a/documentation/docs/documentation/spring-data/configuration.md b/documentation/doc-src/pages/spring-data/configuration.md similarity index 100% rename from documentation/docs/documentation/spring-data/configuration.md rename to documentation/doc-src/pages/spring-data/configuration.md diff --git a/documentation/docs/documentation/spring-data/derived-methods.en.md b/documentation/doc-src/pages/spring-data/derived-methods.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/derived-methods.en.md rename to documentation/doc-src/pages/spring-data/derived-methods.en.md diff --git a/documentation/docs/documentation/spring-data/derived-methods.md b/documentation/doc-src/pages/spring-data/derived-methods.md similarity index 100% rename from documentation/docs/documentation/spring-data/derived-methods.md rename to documentation/doc-src/pages/spring-data/derived-methods.md diff --git a/documentation/docs/documentation/spring-data/index.en.md b/documentation/doc-src/pages/spring-data/index.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/index.en.md rename to documentation/doc-src/pages/spring-data/index.en.md diff --git a/documentation/docs/documentation/spring-data/index.md b/documentation/doc-src/pages/spring-data/index.md similarity index 100% rename from documentation/docs/documentation/spring-data/index.md rename to documentation/doc-src/pages/spring-data/index.md diff --git a/documentation/docs/documentation/spring-data/page-slice-pageable.en.md b/documentation/doc-src/pages/spring-data/page-slice-pageable.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/page-slice-pageable.en.md rename to documentation/doc-src/pages/spring-data/page-slice-pageable.en.md diff --git a/documentation/docs/documentation/spring-data/page-slice-pageable.md b/documentation/doc-src/pages/spring-data/page-slice-pageable.md similarity index 100% rename from documentation/docs/documentation/spring-data/page-slice-pageable.md rename to documentation/doc-src/pages/spring-data/page-slice-pageable.md diff --git a/documentation/docs/documentation/spring-data/query-lua.en.md b/documentation/doc-src/pages/spring-data/query-lua.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/query-lua.en.md rename to documentation/doc-src/pages/spring-data/query-lua.en.md diff --git a/documentation/docs/documentation/spring-data/query-lua.md b/documentation/doc-src/pages/spring-data/query-lua.md similarity index 100% rename from documentation/docs/documentation/spring-data/query-lua.md rename to documentation/doc-src/pages/spring-data/query-lua.md diff --git a/documentation/docs/documentation/spring-data/repository.en.md b/documentation/doc-src/pages/spring-data/repository.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/repository.en.md rename to documentation/doc-src/pages/spring-data/repository.en.md diff --git a/documentation/docs/documentation/spring-data/repository.md b/documentation/doc-src/pages/spring-data/repository.md similarity index 100% rename from documentation/docs/documentation/spring-data/repository.md rename to documentation/doc-src/pages/spring-data/repository.md diff --git a/documentation/docs/documentation/spring-data/scroll-api.en.md b/documentation/doc-src/pages/spring-data/scroll-api.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/scroll-api.en.md rename to documentation/doc-src/pages/spring-data/scroll-api.en.md diff --git a/documentation/docs/documentation/spring-data/scroll-api.md b/documentation/doc-src/pages/spring-data/scroll-api.md similarity index 100% rename from documentation/docs/documentation/spring-data/scroll-api.md rename to documentation/doc-src/pages/spring-data/scroll-api.md diff --git a/documentation/docs/documentation/spring-data/sort.en.md b/documentation/doc-src/pages/spring-data/sort.en.md similarity index 100% rename from documentation/docs/documentation/spring-data/sort.en.md rename to documentation/doc-src/pages/spring-data/sort.en.md diff --git a/documentation/docs/documentation/spring-data/sort.md b/documentation/doc-src/pages/spring-data/sort.md similarity index 100% rename from documentation/docs/documentation/spring-data/sort.md rename to documentation/doc-src/pages/spring-data/sort.md diff --git a/documentation/docs/documentation/testcontainers/index.en.md b/documentation/doc-src/pages/testcontainers/index.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/index.en.md rename to documentation/doc-src/pages/testcontainers/index.en.md diff --git a/documentation/docs/documentation/testcontainers/index.md b/documentation/doc-src/pages/testcontainers/index.md similarity index 100% rename from documentation/docs/documentation/testcontainers/index.md rename to documentation/doc-src/pages/testcontainers/index.md diff --git a/documentation/docs/documentation/testcontainers/single/index.en.md b/documentation/doc-src/pages/testcontainers/single/index.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/single/index.en.md rename to documentation/doc-src/pages/testcontainers/single/index.en.md diff --git a/documentation/docs/documentation/testcontainers/single/index.md b/documentation/doc-src/pages/testcontainers/single/index.md similarity index 100% rename from documentation/docs/documentation/testcontainers/single/index.md rename to documentation/doc-src/pages/testcontainers/single/index.md diff --git a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-arch.en.md b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-arch.en.md similarity index 99% rename from documentation/docs/documentation/testcontainers/single/single-node-testcontainers-arch.en.md rename to documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-arch.en.md index 19c000c..f039534 100644 --- a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-arch.en.md +++ b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-arch.en.md @@ -180,7 +180,7 @@ Container restart is performed using the `void restart(long delay, TimeUnit unit @Test public void testCloseWithSafeMount() { - final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.4.1"); + final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.6.0"); final Path pathToConfigFile = Paths.get("path/to/config.yaml"); try (TarantoolContainer container = new Tarantool3Container(image, @@ -213,7 +213,7 @@ Container restart is performed using the `void restart(long delay, TimeUnit unit @Test public void testCloseWithRemoveMount() { - final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.4.1"); + final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.6.0"); final Path pathToConfigFile = Paths.get("path/to/config.yaml"); try (TarantoolContainer container = new Tarantool3Container(image, diff --git a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-arch.md b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-arch.md similarity index 99% rename from documentation/docs/documentation/testcontainers/single/single-node-testcontainers-arch.md rename to documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-arch.md index b687204..fef3f52 100644 --- a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-arch.md +++ b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-arch.md @@ -195,7 +195,7 @@ stop @Test public void testCloseWithSafeMount() { - final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.4.1"); + final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.6.0"); final Path pathToConfigFile = Paths.get("path/to/config.yaml"); try (TarantoolContainer container = new Tarantool3Container(image, @@ -228,7 +228,7 @@ stop @Test public void testCloseWithRemoveMount() { - final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.4.1"); + final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.6.0"); final Path pathToConfigFile = Paths.get("path/to/config.yaml"); try (TarantoolContainer container = new Tarantool3Container(image, diff --git a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl-example.en.md b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl-example.en.md similarity index 97% rename from documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl-example.en.md rename to documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl-example.en.md index 32af107..5dd26e9 100644 --- a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl-example.en.md +++ b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl-example.en.md @@ -143,7 +143,7 @@ public class TestClass { } ``` -Let's create a container for `Tarantool 3.4.1` and start it: +Let's create a container for `Tarantool 3.6.0` and start it: ```java import java.io.IOException; @@ -188,7 +188,7 @@ public class TestClass { public void test() throws IOException, InterruptedException { final Path pathToConfigFile = createSimpleTestConfigFile(tempDir); - final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.4.1"); + final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.6.0"); // NODE must match the instance name in the configuration file try (TarantoolContainer container = new Tarantool3Container(image, NODE) @@ -250,10 +250,10 @@ public class TestClass { As a result of the execution, you will get similar logs: ``` -15:15:31.769 [main] INFO tc.tarantool/tarantool:3.4.1 - Creating container for image: tarantool/tarantool:3.4.1 -15:15:32.185 [main] INFO tc.tarantool/tarantool:3.4.1 - Container tarantool/tarantool:3.4.1 is starting: eb542dfac096dead65b1f00e39f1926d4dfc8267dd0e8b3a7f4ecae62d02d306 +15:15:31.769 [main] INFO tc.tarantool/tarantool:3.6.0 - Creating container for image: tarantool/tarantool:3.6.0 +15:15:32.185 [main] INFO tc.tarantool/tarantool:3.6.0 - Container tarantool/tarantool:3.6.0 is starting: eb542dfac096dead65b1f00e39f1926d4dfc8267dd0e8b3a7f4ecae62d02d306 15:15:32.382 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: started -15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive main.cc:497 I> Tarantool 3.4.1-0-g0b3c0eb8c0b Linux-aarch64-RelWithDebInfo +15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive main.cc:497 I> Tarantool 3.6.0-0-g9a006b00642 Linux-aarch64-RelWithDebInfo 15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive main.cc:499 I> log level 5 (INFO) 15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive gc.c:131 I> wal/engine cleanup is paused 15:15:32.396 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.365 [1] main/104/interactive tuple.c:411 I> mapping 268435456 bytes for memtx tuple arena... @@ -295,5 +295,5 @@ As a result of the execution, you will get similar logs: 15:15:32.420 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.389 [1] main/104/interactive box.cc:444 I> box switched to rw 15:15:32.420 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.389 [1] main/107/gc gc.c:319 I> wal/engine cleanup is resumed 15:15:32.421 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.391 [1] main main.cc:1072 I> entering the event loop -15:15:32.451 [main] INFO tc.tarantool/tarantool:3.4.1 - Container tarantool/tarantool:3.4.1 started in PT0.682201S +15:15:32.451 [main] INFO tc.tarantool/tarantool:3.6.0 - Container tarantool/tarantool:3.6.0 started in PT0.682201S ``` diff --git a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl-example.md b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl-example.md similarity index 96% rename from documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl-example.md rename to documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl-example.md index 20034a8..5407ef1 100644 --- a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl-example.md +++ b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl-example.md @@ -145,7 +145,7 @@ public class TestClass { } ``` -Создадим контейнер для `Tarantool 3.4.1` и запустим его: +Создадим контейнер для `Tarantool 3.6.0` и запустим его: ```java import java.io.IOException; @@ -190,7 +190,7 @@ public class TestClass { public void test() throws IOException, InterruptedException { final Path pathToConfigFile = createSimpleTestConfigFile(tempDir); - final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.4.1"); + final DockerImageName image = DockerImageName.parse("tarantool/tarantool:3.6.0"); // NODE должен соответствовать instance name в конфигурационном файле try (TarantoolContainer container = new Tarantool3Container(image, NODE) @@ -252,10 +252,10 @@ public class TestClass { В результате работы вы получите аналогичные логи: ``` -15:15:31.769 [main] INFO tc.tarantool/tarantool:3.4.1 - Creating container for image: tarantool/tarantool:3.4.1 -15:15:32.185 [main] INFO tc.tarantool/tarantool:3.4.1 - Container tarantool/tarantool:3.4.1 is starting: eb542dfac096dead65b1f00e39f1926d4dfc8267dd0e8b3a7f4ecae62d02d306 +15:15:31.769 [main] INFO tc.tarantool/tarantool:3.6.0 - Creating container for image: tarantool/tarantool:3.6.0 +15:15:32.185 [main] INFO tc.tarantool/tarantool:3.6.0 - Container tarantool/tarantool:3.6.0 is starting: eb542dfac096dead65b1f00e39f1926d4dfc8267dd0e8b3a7f4ecae62d02d306 15:15:32.382 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: started -15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive main.cc:497 I> Tarantool 3.4.1-0-g0b3c0eb8c0b Linux-aarch64-RelWithDebInfo +15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive main.cc:497 I> Tarantool 3.6.0-0-g9a006b00642 Linux-aarch64-RelWithDebInfo 15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive main.cc:499 I> log level 5 (INFO) 15:15:32.395 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.364 [1] main/104/interactive gc.c:131 I> wal/engine cleanup is paused 15:15:32.396 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.365 [1] main/104/interactive tuple.c:411 I> mapping 268435456 bytes for memtx tuple arena... @@ -287,5 +287,5 @@ public class TestClass { 15:15:32.420 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.389 [1] main/104/interactive box.cc:444 I> box switched to rw 15:15:32.420 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.389 [1] main/108/checkpoint_daemon gc.c:650 I> scheduled next checkpoint for Wed Aug 27 13:35:30 2025 15:15:32.421 [docker-java-stream-1077198046] INFO o.t.c.tarantool.Tarantool3Container - [test-node] STDERR: 2025-08-27 12:15:32.391 [1] main main.cc:1072 I> entering the event loop -15:15:32.451 [main] INFO tc.tarantool/tarantool:3.4.1 - Container tarantool/tarantool:3.4.1 started in PT0.682201S +15:15:32.451 [main] INFO tc.tarantool/tarantool:3.6.0 - Container tarantool/tarantool:3.6.0 started in PT0.682201S ``` diff --git a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl.en.md b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl.en.md similarity index 97% rename from documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl.en.md rename to documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl.en.md index 280c21e..1a32127 100644 --- a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl.en.md +++ b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl.en.md @@ -50,7 +50,7 @@ Tarantool3Container -[#008200,dashed]-^ TarantoolContainer @enduml ``` -The `Tarantool3Container` class allows you to create a `Tarantool 3.x` container object that satisfies the [contract](./single-node-testcontainers-arch.md) of `TarantoolContainer`. +The `Tarantool3Container` class allows you to create a `Tarantool 3.x` container object that satisfies the [contract](single-node-testcontainers-arch.md) of `TarantoolContainer`. ### Implementation Description diff --git a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl.md b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl.md similarity index 98% rename from documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl.md rename to documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl.md index da33db5..dab3ccf 100644 --- a/documentation/docs/documentation/testcontainers/single/single-node-testcontainers-standard-impl.md +++ b/documentation/doc-src/pages/testcontainers/single/single-node-testcontainers-standard-impl.md @@ -51,7 +51,7 @@ Tarantool3Container -[#008200,dashed]-^ TarantoolContainer ``` Класс `Tarantool3Container` позволяет создать объект контейнера `Tarantool 3.x`, удовлетворяющий -[контракту](./single-node-testcontainers-arch.md) `TarantoolContainer`. +[контракту](single-node-testcontainers-arch.md) `TarantoolContainer`. ### Описание реализации diff --git a/documentation/docs/documentation/testcontainers/tdb/index.en.md b/documentation/doc-src/pages/testcontainers/tdb/index.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tdb/index.en.md rename to documentation/doc-src/pages/testcontainers/tdb/index.en.md diff --git a/documentation/docs/documentation/testcontainers/tdb/index.md b/documentation/doc-src/pages/testcontainers/tdb/index.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tdb/index.md rename to documentation/doc-src/pages/testcontainers/tdb/index.md diff --git a/documentation/docs/documentation/testcontainers/tdb/tdb-cluster-testcontainers-arch.en.md b/documentation/doc-src/pages/testcontainers/tdb/tdb-cluster-testcontainers-arch.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tdb/tdb-cluster-testcontainers-arch.en.md rename to documentation/doc-src/pages/testcontainers/tdb/tdb-cluster-testcontainers-arch.en.md diff --git a/documentation/docs/documentation/testcontainers/tdb/tdb-cluster-testcontainers-arch.md b/documentation/doc-src/pages/testcontainers/tdb/tdb-cluster-testcontainers-arch.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tdb/tdb-cluster-testcontainers-arch.md rename to documentation/doc-src/pages/testcontainers/tdb/tdb-cluster-testcontainers-arch.md diff --git a/documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.en.md b/documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.en.md rename to documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.en.md diff --git a/documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.md b/documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.md rename to documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.md diff --git a/documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.en.md b/documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.en.md similarity index 98% rename from documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.en.md rename to documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.en.md index 8738b59..13512fb 100644 --- a/documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.en.md +++ b/documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.en.md @@ -62,7 +62,7 @@ TDBCluster -[#008200,plain]-^ Startable @enduml ``` -The `TDB2ClusterImpl` class allows you to create an object managing the lifecycle of a TDB 2.x cluster, satisfying the [contract](./tdb-cluster-testcontainers-arch.md) of `TDBCluster`. +The `TDB2ClusterImpl` class allows you to create an object managing the lifecycle of a TDB 2.x cluster, satisfying the [contract](tdb-cluster-testcontainers-arch.md) of `TDBCluster`. ## Implementation Description diff --git a/documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md b/documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md similarity index 98% rename from documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md rename to documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md index 3275ca1..5688ac2 100644 --- a/documentation/docs/documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md +++ b/documentation/doc-src/pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md @@ -63,7 +63,7 @@ TDBCluster -[#008200,plain]-^ Startable ``` Класс `TDB2ClusterImpl` позволяет создать объект, управляющий жизненным циклом кластера TDB 2.x, -удовлетворяющий [контракту](./tdb-cluster-testcontainers-arch.md) `TDBCluster`. +удовлетворяющий [контракту](tdb-cluster-testcontainers-arch.md) `TDBCluster`. ## Описание реализации diff --git a/documentation/docs/documentation/testcontainers/tqe/index.en.md b/documentation/doc-src/pages/testcontainers/tqe/index.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tqe/index.en.md rename to documentation/doc-src/pages/testcontainers/tqe/index.en.md diff --git a/documentation/docs/documentation/testcontainers/tqe/index.md b/documentation/doc-src/pages/testcontainers/tqe/index.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tqe/index.md rename to documentation/doc-src/pages/testcontainers/tqe/index.md diff --git a/documentation/docs/documentation/testcontainers/tqe/tqe-cluster-arch.en.md b/documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-arch.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tqe/tqe-cluster-arch.en.md rename to documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-arch.en.md diff --git a/documentation/docs/documentation/testcontainers/tqe/tqe-cluster-arch.md b/documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-arch.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tqe/tqe-cluster-arch.md rename to documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-arch.md diff --git a/documentation/docs/documentation/testcontainers/tqe/tqe-cluster-example.en.md b/documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-example.en.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tqe/tqe-cluster-example.en.md rename to documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-example.en.md diff --git a/documentation/docs/documentation/testcontainers/tqe/tqe-cluster-example.md b/documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-example.md similarity index 100% rename from documentation/docs/documentation/testcontainers/tqe/tqe-cluster-example.md rename to documentation/doc-src/pages/testcontainers/tqe/tqe-cluster-example.md diff --git a/documentation/mkdocs.yml b/documentation/mkdocs.yml index 45e14f9..38fdf2f 100644 --- a/documentation/mkdocs.yml +++ b/documentation/mkdocs.yml @@ -3,6 +3,7 @@ copyright: Copyright ©️ 2025 VK Tech repo_name: tarantool/tarantool-java-sdk repo_url: https://github.com/tarantool/tarantool-java-sdk site_url: https://tarantool.github.io/tarantool-java-sdk/ +docs_dir: doc-src strict: true extra: @@ -41,10 +42,14 @@ plugins: Одиночный узел: Single Node Кластер TarantoolDB: TarantoolDB Cluster Кластер TQE: TQE Cluster + Примеры использования: Usage examples + Подключение к узлам: Connecting to nodes - drawio: darkmode: true - plantuml: puml_url: https://www.plantuml.com/plantuml/ + # в секундах(in seconds) + request_timeout: 300 theme: features: @@ -95,51 +100,56 @@ nav: - Главная: - index.md - Документация: - - documentation/index.md + - pages/index.md - Spring Data: - - documentation/spring-data/index.md - - documentation/spring-data/configuration.md - - documentation/spring-data/repository.md - - documentation/spring-data/derived-methods.md - - documentation/spring-data/sort.md - - documentation/spring-data/query-lua.md - - documentation/spring-data/page-slice-pageable.md - - documentation/spring-data/scroll-api.md + - pages/spring-data/index.md + - pages/spring-data/configuration.md + - pages/spring-data/repository.md + - pages/spring-data/derived-methods.md + - pages/spring-data/sort.md + - pages/spring-data/query-lua.md + - pages/spring-data/page-slice-pageable.md + - pages/spring-data/scroll-api.md - Высокоуровневый клиент: - - documentation/client/index.md + - pages/client/index.md - Архитектура: - - documentation/client/arch/index.md - - documentation/client/arch/high-level-arch.md - - documentation/client/arch/heartbeat.md - - documentation/client/arch/balancer.md - - documentation/client/arch/connection-pool.md - - documentation/client/arch/instance-connection-group.md - - documentation/client/arch/exception-handling.md - - documentation/client/arch/connection-to-multiple-nodes.md - - documentation/client/arch/call.md - - documentation/client/arch/tuple_pojo_mapping.md + - pages/client/arch/index.md + - pages/client/arch/high-level-arch.md + - pages/client/arch/heartbeat.md + - pages/client/arch/balancer.md + - pages/client/arch/connection-pool.md + - pages/client/arch/instance-connection-group.md + - pages/client/arch/exception-handling.md + - pages/client/arch/connection-to-multiple-nodes.md + - pages/client/arch/call.md + - pages/client/arch/tuple_pojo_mapping.md + - Примеры использования: + - pages/client/examples/index.md + - Подключение к узлам: + - pages/client/examples/connection/index.md + - pages/client/examples/connection/single-node.md - Tarantool Testcontainers: - - documentation/testcontainers/index.md + - pages/testcontainers/index.md - Одиночный узел: - - documentation/testcontainers/single/index.md - - documentation/testcontainers/single/single-node-testcontainers-arch.md - - documentation/testcontainers/single/single-node-testcontainers-standard-impl.md - - documentation/testcontainers/single/single-node-testcontainers-standard-impl-example.md + - pages/testcontainers/single/index.md + - pages/testcontainers/single/single-node-testcontainers-arch.md + - pages/testcontainers/single/single-node-testcontainers-standard-impl.md + - pages/testcontainers/single/single-node-testcontainers-standard-impl-example.md - Кластер TarantoolDB: - - documentation/testcontainers/tdb/index.md - - documentation/testcontainers/tdb/tdb-cluster-testcontainers-arch.md - - documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md - - documentation/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.md + - pages/testcontainers/tdb/index.md + - pages/testcontainers/tdb/tdb-cluster-testcontainers-arch.md + - pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl.md + - pages/testcontainers/tdb/tdb2-cluster-testcontainers-standard-impl-example.md - Кластер TQE: - - documentation/testcontainers/tqe/index.md - - documentation/testcontainers/tqe/tqe-cluster-arch.md - - documentation/testcontainers/tqe/tqe-cluster-example.md + - pages/testcontainers/tqe/index.md + - pages/testcontainers/tqe/tqe-cluster-arch.md + - pages/testcontainers/tqe/tqe-cluster-example.md markdown_extensions: + - md_in_html - tables - admonition - pymdownx.details - - pymdownx.superfences - pymdownx.tabbed: alternate_style: true - footnotes @@ -153,11 +163,19 @@ markdown_extensions: anchor_linenums: true line_spans: __spanz pygments_lang_class: true + default_lang: java - pymdownx.inlinehilite - - pymdownx.snippets + - pymdownx.snippets: + check_paths: true + base_path: doc-src/java/src - def_list - pymdownx.tasklist: custom_checkbox: true + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format exclude_docs: | venv diff --git a/documentation/pom.xml b/documentation/pom.xml new file mode 100644 index 0000000..9b94b9c --- /dev/null +++ b/documentation/pom.xml @@ -0,0 +1,111 @@ + + + 4.0.0 + + io.tarantool + tarantool-java-sdk + 2.0.0-SNAPSHOT + + + site + + + 0.13.0 + 5.14.0 + 17 + 17 + ${project.parent.basedir}/LICENSE_HEADER.txt + + + + + + io.tarantool + tarantool-client + 2.0.0-SNAPSHOT + import + pom + + + io.tarantool + testcontainers + 2.0.0-SNAPSHOT + import + pom + + + org.junit + junit-bom + ${junit.version} + import + pom + + + io.tarantool + cartridge-driver + ${cartridge-java.version} + test + + + + + + + io.tarantool + tarantool-client + test + + + io.tarantool + testcontainers + test + + + org.junit.jupiter + junit-jupiter + test + + + ch.qos.logback + logback-classic + test + + + io.tarantool + cartridge-driver + + + io.netty + netty-transport + + + io.netty + netty-handler + + + io.netty + netty-codec + + + io.netty + netty-codec-http + + + org.msgpack + msgpack-core + + + + + + + doc-src/java/src + + + doc-src/java/resources + + + + diff --git a/documentation/readme-images/navigation.png b/documentation/readme-images/navigation.png new file mode 100644 index 0000000..5b9d1c5 Binary files /dev/null and b/documentation/readme-images/navigation.png differ diff --git a/documentation/readme-images/sections.png b/documentation/readme-images/sections.png new file mode 100644 index 0000000..2ca5b66 Binary files /dev/null and b/documentation/readme-images/sections.png differ diff --git a/documentation/requirements.txt b/documentation/requirements.txt index e361f0a..9c72964 100644 --- a/documentation/requirements.txt +++ b/documentation/requirements.txt @@ -1,5 +1,5 @@ mkdocs-material==9.7.0 mike==v2.1.3 -mkdocs-drawio==v1.12.2 +mkdocs-drawio==v1.13.0 mkdocs_puml==v2.3.0 mkdocs-static-i18n[material]==v1.3.0 diff --git a/pom.xml b/pom.xml index 44d92b5..29d1540 100644 --- a/pom.xml +++ b/pom.xml @@ -642,5 +642,6 @@ testcontainers jacoco-coverage-aggregate-report testcontainers-autogen + documentation