### Full Cluster Setup and Initialization Source: https://github.com/apache/ignite-3/blob/main/CLAUDE.md Performs a complete setup of the cluster: builds distributions, starts all nodes, and initializes the cluster. ```bash just setup_cluster ``` -------------------------------- ### Setup Apache Ignite Cluster Source: https://github.com/apache/ignite-3/blob/main/CLAUDE.md Builds distributions and creates node directories for the cluster. Run this before starting nodes. ```bash just setup ``` -------------------------------- ### Run Example via Gradle Source: https://github.com/apache/ignite-3/blob/main/examples/java/README.md Execute an example using the Gradle wrapper, specifying the main class to run. This is a convenient way to run examples from the command line. ```shell ./gradlew :ignite-examples:run -PmainClass= ``` -------------------------------- ### Install Dependencies Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Navigate to the docs directory and install project dependencies using npm. ```bash cd docs npm install ``` -------------------------------- ### Start Ignite Node (Windows) Source: https://github.com/apache/ignite-3/blob/main/docs/docs/getting-started/quick-start.md Navigate to the Ignite database directory and run this script to start a local node on Windows using Bash. Ensure Java is installed in the Bash environment. ```bash bash bin\ignite3db ``` -------------------------------- ### Start Ignite CLI (Windows) Source: https://github.com/apache/ignite-3/blob/main/docs/docs/getting-started/quick-start.md Navigate to the Ignite CLI directory and run this script to start the command-line interface on Windows using Bash. Ensure Java is installed in the Bash environment. ```bash bash bin\ignite3 ``` -------------------------------- ### Install Documentation Requirements Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/python/dbapi/README.md Install the packages needed to build the project's documentation. ```bash $ pip install -r requirements/docs.txt ``` -------------------------------- ### Get All Resources in Namespace Source: https://github.com/apache/ignite-3/blob/main/docs/docs/configure-and-operate/installation/kubernetes.md Command to list all Kubernetes resources within a specified namespace for installation verification. ```shell kubectl get all -n ``` -------------------------------- ### Example CI Workflow Source: https://github.com/apache/ignite-3/blob/main/docs/README.md This bash script outlines a typical CI workflow for the documentation build. It includes steps for dependency installation, type checking, link validation, image validation, production build, and build output validation. ```bash npm ci # Install dependencies npm run typecheck # Type check npm run check:links # Validate links npm run check:images # Validate images npm run build:prod # Production build npm run check:build # Validate build output ``` -------------------------------- ### Install Apache Ignite C# Client Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/dotnet/ado-net-api.md Install the Apache Ignite C# client using the .NET CLI. Ensure .NET 8.0 or newer is installed. ```bash dotnet add package Apache. Ignite --version {version} ``` -------------------------------- ### Start Local Development Server (Fast) Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Start the development server with a faster startup time, suitable for active development. ```bash npm run start:fast ``` -------------------------------- ### Run Example via Java Command Source: https://github.com/apache/ignite-3/blob/main/examples/java/README.md Build the project and then run an example using the `java` command. Ensure the classpath includes necessary build outputs and runtime JARs. ```shell java -cp "examples/java/build/classes/java/main:examples/java/build/resources/main:" ``` -------------------------------- ### COPY FROM Partitioned Parquet Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/reference/data-types-and-functions/operational-commands.mdx Example demonstrating how to import data from a partitioned Parquet database. ```APIDOC ## COPY FROM Partitioned Parquet ### Description Imports data from partitioned Parquet database. ### Method COPY FROM ### Endpoint N/A (SQL Command) ### Request Example ```sql COPY FROM '/tmp/partitioned_table_dir' INTO city (id, name, population) FORMAT PARQUET WITH 'pattern' = '.*' ``` Where the Parquet table looks like this: ``` partitioned_table_dir/ ├─ CountryCode=USA/ │ ├─ 000000_0.parquet ├─ CountryCode=FR/ │ ├─ 000000_0.parquet ``` ``` -------------------------------- ### Example Query Plan Output Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/advanced/performance-tuning.md This is an example of the output format for the EXPLAIN PLAN FOR statement, showing the query's execution steps. ```text ╔═══════════════════════════════╗ ║ PLAN ║ ╠═══════════════════════════════╣ ║ Exchange ║ ║ distribution: single ║ ║ est. row count: 333000 ║ ║ TableScan ║ ║ table: [PUBLIC, PERSON] ║ ║ filters: =(AGE, 26) ║ ║ fields: [$f0] ║ ║ projects: [NAME] ║ ║ est. row count: 333000 ║ ╚═══════════════════════════════╝ ``` -------------------------------- ### Service Layer for Query by Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/integrate/spring-data.md Provides examples of using Query by Example in a Spring service. It demonstrates how to create probe entities and ExampleMatchers for flexible querying. ```java import org.springframework.data.domain.Example; import org.springframework.data.domain.ExampleMatcher; @Service public class PersonService { private final PersonRepository repository; public PersonService(PersonRepository repository) { this.repository = repository; } public List findByExample(String name, String email) { Person probe = new Person(); probe.setName(name); probe.setEmail(email); // Match non-null properties Example example = Example.of(probe); return (List) repository.findAll(example); } public List findByNameStartsWith(String prefix) { Person probe = new Person(); probe.setName(prefix); ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("name", ExampleMatcher.GenericPropertyMatchers.startsWith()) .withIgnorePaths("id", "email"); Example example = Example.of(probe, matcher); return (List) repository.findAll(example); } } ``` -------------------------------- ### Clean Install Dependencies Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Perform a clean installation of dependencies, recommended for CI/CD or troubleshooting. ```bash npm ci ``` -------------------------------- ### Build DB zip, unzip, and start node Source: https://github.com/apache/ignite-3/blob/main/DEVNOTES.md Build the database node distribution zip, navigate to its directory, unzip it, and start the Ignite database node. Replace `` with the desired version. ```shell ./gradlew clean packaging-db:distZip cd packaging/db/build/distributions unzip ignite3-db- cd ignite3-db- ./bin/ignite3db start ``` -------------------------------- ### Install Apache Ignite .NET Client Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/ignite-clients/dotnet.md Install the .NET client package using the NuGet package manager. .NET 8.0 or newer is required. ```bash dotnet add package Apache.Ignite --version 3.0.0 ``` -------------------------------- ### Install pyignite_dbapi Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/sql-only-apis/python.md Install the Apache Ignite 3 Python driver using pip. ```bash pip install pyignite_dbapi ``` -------------------------------- ### Verify .NET SDK Installation Source: https://github.com/apache/ignite-3/blob/main/RELEASE.md Check the installed version of the .NET SDK. Requires version 8.0.407+. ```bash dotnet --version ``` -------------------------------- ### Start Ignite Server Node Source: https://github.com/apache/ignite-3/blob/main/assembly/README.md Start an Ignite server node using the provided startup script. Ensure IGNITE_HOME is set. ```shell $IGNITE_HOME/bin/ignite3-db ``` -------------------------------- ### Install EPEL and SCL on CentOS/RHEL 7 Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/ignite-clients/cpp.md Install necessary repositories for building the C++ client on older CentOS and RHEL systems. ```bash yum install epel-release centos-release-scl ``` -------------------------------- ### Start Ignite Database Node Source: https://github.com/apache/ignite-3/blob/main/DEVNOTES.md Navigate to the database distribution directory and start the Ignite database node. ```shell cd ../ignite3-db- ./bin/ignite3db start ``` -------------------------------- ### Install pyignite_dbapi from Repository Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/python/dbapi/README.md Use this command to install the pyignite_dbapi module for general use in your project. ```bash $ pip install pyignite_dbapi ``` -------------------------------- ### Example EXPLAIN MAPPING FOR Output Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/advanced/performance-tuning.md This is an example of the output generated by the EXPLAIN MAPPING FOR statement, illustrating the query plan and node distribution. ```text ╔═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗ ║ PLAN ║ ╠═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╣ ║ Fragment#0 root ║ ║ executionNodes: [defaultNode] ║ ║ remoteFragments: [1] ║ ║ exchangeSourceNodes: {1=[defaultNode]} ║ ║ tree: ║ ║ Receiver(sourceFragment=1, exchange=1, distribution=single) ║ ║ ║ ║ Fragment#1 ║ ║ targetNodes: [defaultNode] ║ ║ executionNodes: [defaultNode] ║ ║ tables: [PERSON] ║ ║ partitions: {defaultNode=[0:12, 1:12, 2:12, 3:12, 4:12, 5:12, 6:12, 7:12, 8:12, 9:12, 10:12, 11:12, 12:12, 13:12, 14:12, 15:12, 16:12, 17:12, 18:12, 19:12, 20:12, 21:12, 22:12, 23:12, 24:12]} ║ ║ tree: ║ ║ Sender(targetFragment=0, exchange=1, distribution=single) ║ ║ TableScan(name=PUBLIC.PERSON, source=2, partitions=25, distribution=random) ║ ╚═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝ ``` -------------------------------- ### Usage Examples Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/sql-only-apis/python.md Provides practical examples of how to use the Python DB-API driver for common tasks. ```APIDOC ## Usage Examples ### Basic Connection ```python import pyignite_dbapi conn = pyignite_dbapi.connect(address=['127.0.0.1:10800']) try: cursor = conn.cursor() cursor.execute('SELECT id, name FROM users') for row in cursor: print(f"{row[0]}: {row[1]}") cursor.close() finally: conn.close() ``` ### Connection with Context Manager ```python import pyignite_dbapi with pyignite_dbapi.connect(address=['127.0.0.1:10800']) as conn: with conn.cursor() as cursor: cursor.execute('SELECT id, name FROM users') for row in cursor: print(f"{row[0]}: {row[1]}") ``` ### Connection with Authentication ```python conn = pyignite_dbapi.connect( address=['127.0.0.1:10800'], identity='admin', secret='password' ) ``` ``` -------------------------------- ### Query Mapping Output Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/advanced/explain-statement.mdx This is an example output of the EXPLAIN MAPPING command, illustrating the breakdown of a query into execution fragments, their distribution, and the relational tree structure. ```text Fragment#0 root distribution: single executionNodes: [node_1] tree: Project fieldNames: [USERNAME, PRODUCTNAME, REVIEWTEXT, RATING] projection: [USERNAME, PRODUCTNAME, REVIEWTEXT, RATING] est: (rows=1) HashJoin predicate: =(USERID$0, USERID) fieldNames: [PRODUCTID, USERID, REVIEWTEXT, RATING, PRODUCTID$0, PRODUCTNAME, USERID$0, USERNAME] type: inner est: (rows=1) HashJoin predicate: =(PRODUCTID, PRODUCTID$0) fieldNames: [PRODUCTID, USERID, REVIEWTEXT, RATING, PRODUCTID$0, PRODUCTNAME] type: inner est: (rows=1) Receiver fieldNames: [PRODUCTID, USERID, REVIEWTEXT, RATING] sourceFragmentId: 1 est: (rows=1) Receiver fieldNames: [PRODUCTID, PRODUCTNAME] sourceFragmentId: 2 est: (rows=1) Receiver fieldNames: [USERID, USERNAME] sourceFragmentId: 3 est: (rows=1) Fragment#1 distribution: random executionNodes: [node_1, node_2, node_3] partitions: [REVIEWS=[node_1={0, 2, 5, 6, 7, 8, 9, 10, 12, 13, 20}, node_2={1, 3, 11, 19, 21, 22, 23, 24}, node_3={4, 14, 15, 16, 17, 18}]] tree: Sender distribution: single targetFragmentId: 0 est: (rows=50000) TableScan table: PUBLIC.REVIEWS fieldNames: [PRODUCTID, USERID, REVIEWTEXT, RATING] est: (rows=50000) Fragment#2 distribution: table PUBLIC.PRODUCTS in zone "Default" executionNodes: [node_1, node_2, node_3] partitions: [PRODUCTS=[node_1={0, 2, 5, 6, 7, 8, 9, 10, 12, 13, 20}, node_2={1, 3, 11, 19, 21, 22, 23, 24}, node_3={4, 14, 15, 16, 17, 18}]] tree: Sender distribution: single targetFragmentId: 0 est: (rows=1665) TableScan table: PUBLIC.PRODUCTS predicate: =(PRODUCTNAME, ||(_UTF-8'Product_', CAST(?0):VARCHAR CHARACTER SET "UTF-8")) fieldNames: [PRODUCTID, PRODUCTNAME] est: (rows=1665) Fragment#3 distribution: table PUBLIC.USERS in zone "Default" executionNodes: [node_1, node_2, node_3] partitions: [USERS=[node_1={0, 2, 5, 6, 7, 8, 9, 10, 12, 13, 20}, node_2={1, 3, 11, 19, 21, 22, 23, 24}, node_3={4, 14, 15, 16, 17, 18}]] tree: Sender distribution: single targetFragmentId: 0 est: (rows=10000) TableScan table: PUBLIC.USERS fieldNames: [USERID, USERNAME] est: (rows=10000) ``` -------------------------------- ### Install Additional Requirements Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/python/dbapi/README.md Install specific requirements for tasks or testing by referencing the requirements files. ```bash $ pip install -r requirements/.txt ``` -------------------------------- ### Storage Configuration Example Source: https://github.com/apache/ignite-3/blob/main/modules/storage-api/README.md Example of storage profile configuration in HOCON format. Use this to define different storage engines and their settings for tables. ```hocon ignite: storage.profiles: test_profile1 engine: test test_profile2 engine: test ``` -------------------------------- ### Install pyodbc Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/connect-to-ignite/odbc.md Install the pyodbc library using pip. This is required for using pyodbc with Apache Ignite. ```shell pip3 install pyodbc ``` -------------------------------- ### Start Apache Ignite as a Service Source: https://github.com/apache/ignite-3/blob/main/docs/docs/configure-and-operate/installation/deb-rpm.md Command to start the Apache Ignite service. This is the recommended method for most environments. ```bash sudo systemctl start ignite3db ``` -------------------------------- ### COPY FROM CSV Examples Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/reference/data-types-and-functions/operational-commands.mdx Examples demonstrating how to import data from CSV files into Apache Ignite tables with various configurations. ```APIDOC ## COPY FROM CSV with Header ### Description Imports data from columns `name` and `age` of a CSV file with header into Table1 columns `name` and `age`. ### Method COPY FROM ### Endpoint N/A (SQL Command) ### Request Example ```sql /* Import data from CSV with column headers */ COPY FROM '/path/to/dir/data.csv' INTO Table1 (name, age) FORMAT CSV ``` ``` ```APIDOC ## COPY FROM CSV without Header ### Description Imports data from the first two columns of a CSV file without header into Table1 columns `name` and `age`. ### Method COPY FROM ### Endpoint N/A (SQL Command) ### Request Example ```sql /* Import data from CSV without column headers */ COPY FROM '/path/to/dir/data.csv' INTO Table1 (name, age) FORMAT CSV ``` ``` ```APIDOC ## COPY FROM CSV with Custom Quote Character ### Description Imports data from columns `name` and `age` of a CSV file that uses the `~` symbol as quotation character. ### Method COPY FROM ### Endpoint N/A (SQL Command) ### Request Example ```sql /* Import data from CSV with custom quotation character */ COPY FROM '/path/to/dir/data.csv' INTO Table1 (name, age) FORMAT CSV WITH 'quoteChar'='~' ``` ``` ```APIDOC ## COPY FROM CSV with Custom Null Value ### Description Imports data from columns `name`, `age` and `empty` of a CSV file and maps all empty values to `no data`. ### Method COPY FROM ### Endpoint N/A (SQL Command) ### Request Example ```sql /* Import data from CSV with custom quotation character */ COPY FROM '/path/to/dir/data.csv' INTO Table1 (name, age, empty) FORMAT CSV WITH 'null'='no data' ``` ``` ```APIDOC ## COPY FROM CSV with Batch Size ### Description Imports data from CSV file in batches of 2048 entries. ### Method COPY FROM ### Endpoint N/A (SQL Command) ### Request Example ```sql /* Import data from CSV without column headers */ COPY FROM '/path/to/dir/data.csv' INTO Table1 (name, age) FORMAT CSV WITH 'batchSize'='2048' ``` ``` -------------------------------- ### Start Local Development Server Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Start the Docusaurus development server for live preview and hot reloading. Accessible at http://localhost:3000/docs/ignite3/. ```bash npm start ``` -------------------------------- ### Start Ignite CLI (Linux) Source: https://github.com/apache/ignite-3/blob/main/docs/docs/getting-started/quick-start.md Navigate to the Ignite CLI directory and run this script to start the command-line interface on Linux. ```shell bin/ignite3 ``` -------------------------------- ### Start Ignite Node Source: https://github.com/apache/ignite-3/blob/main/README.md Navigate to the Ignite database directory and start an Ignite node. Configuration can be adjusted in etc/ignite-config.conf. ```shell cd ignite3-db-3.0.0-beta1 ./bin/ignite3db start ``` -------------------------------- ### Start Ignite Node Natively Source: https://github.com/apache/ignite-3/blob/main/examples/java/README.md Use the startup script from the Ignite database directory to start a node. This command initiates the Ignite database service. ```shell $IGNITE_HOME/bin/ignite3db start ``` -------------------------------- ### Log Exporter Configuration Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/configure-and-operate/configuration/metrics.md An example of the updated exporters configuration in HOCON format, showing the settings for the 'logPush' exporter. ```hocon exporters=[ { enabledMetrics=[] exporterName=logPush name=logPush oneLinePerMetricSource=true periodMillis=30000 } ] ``` -------------------------------- ### Set Up Node Directories Source: https://github.com/apache/ignite-3/blob/main/DEVNOTES.md Create a cluster directory, unzip the distribution, and copy node directories for multiple instances. ```shell mkdir ignite-3-cluster cd ignite-3-cluster unzip ../packaging/build/distributions/ignite3-.zip ``` ```shell mv ignite3-db- node1 cp -r node1 node2 cp -r node1 node3 ``` -------------------------------- ### Get Cluster Nodes Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/dotnet/network-api.md Retrieves all cluster nodes and iterates through them to print their names, IDs, and addresses. Requires starting the client first. ```csharp var client = await IgniteClient.StartAsync(configuration); // Get all cluster nodes var nodes = await client.GetClusterNodesAsync(); foreach (var node in nodes) { Console.WriteLine($"Node: {node.Name}"); Console.WriteLine($" ID: {node.Id}"); Console.WriteLine($" Address: {node.Address}"); } ``` -------------------------------- ### Complete Connection String Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/dotnet/ado-net-api.md An example of a comprehensive connection string for Apache Ignite, including various parameters for endpoint, timeouts, heartbeat, reconnection, SSL, and authentication. ```text Endpoints=localhost:10800,localhost:10801;SocketTimeout=00:00:10;OperationTimeout=00:03:30; HeartbeatInterval=00:00:05.5;ReconnectInterval=00:01:00;SslEnabled=True;Username=user;Password=pass ``` -------------------------------- ### Build and Serve Production Separately Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Build the production site first, then serve it. The search functionality requires the build step. ```bash npm run build npm run serve ``` -------------------------------- ### Perform Asynchronous Get Operation Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/cpp/tables-api.md Use the `_async` suffix for asynchronous operations. This example shows how to asynchronously retrieve a record by key and handle the result in a callback. ```cpp view.get_async(nullptr, key, [](ignite_result> result) { if (!result.has_error()) { auto tuple = std::move(result).value(); if (tuple.has_value()) { // Use tuple } } }); ``` -------------------------------- ### Build and Serve Production Site Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Build the site for production and serve it locally. This is recommended as it also generates search indexes. ```bash npm run serve:build ``` -------------------------------- ### Build Interactive CLI Flow Source: https://github.com/apache/ignite-3/blob/main/modules/cli/README.md Example of using the Flow DSL to ask the user to connect to the last connected node on CLI start. Requires `Flows.acceptQuestion` and `Flows.fromCall`. ```java String clusterUrl = stateConfigProvider.get().getProperty(ConfigConstants.LAST_CONNECTED_URL); QuestionUiComponent question = QuestionUiComponent.fromQuestion( "Do you want to connect to the last connected node %s? %s ",UiElements.url(lastConnectedUrl),UiElements.yesNo() ); Flows.acceptQuestion(question, ()->new ConnectCallInput(clusterUrl)) .then(Flows.fromCall(connectCall)) .print() .start(Flowable.empty()); ``` -------------------------------- ### Get KeyValueView for Tuple Objects Source: https://github.com/apache/ignite-3/blob/main/docs/docs/getting-started/key-value-api.md Use KeyValueView to treat tables as key-value stores for simple lookups. This example uses schema-less Tuple objects for both keys and values. ```java KeyValueView keyValueView = table.keyValueView(); keyValueView.put(null, Tuple.create().set("id", 4), Tuple.create().set("name", "Jill")); ``` -------------------------------- ### Build CLI zip, unzip, and run Source: https://github.com/apache/ignite-3/blob/main/DEVNOTES.md Build the CLI distribution zip, navigate to its directory, unzip it, and run the Ignite CLI. Replace `` with the desired version. ```shell ./gradlew clean packaging-cli:distZip cd packaging/cli/build/distributions unzip ignite3-cli- cd ignite3-cli- ./bin/ignite3 ``` -------------------------------- ### Get RecordView for Tuple Objects Source: https://github.com/apache/ignite-3/blob/main/docs/docs/getting-started/key-value-api.md Use RecordView to interact with tables as collections of records, suitable for operations on entire rows. This example uses schema-less Tuple objects. ```java RecordView recordView = table.recordView(); recordView.upsert(null, Tuple.create().set("id", 2).set("name", "Jane")); ``` -------------------------------- ### Begin Transaction with Default Options Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/cpp/transactions-api.md Starts a new transaction with default configuration. Obtain the transactions factory from the client and call begin(). ```cpp using namespace ignite; auto transactions = client.get_transactions(); auto tx = transactions.begin(); ``` -------------------------------- ### CMake Minimum Version and Project Setup Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/cpp/tests/package-test/cmake_package/CMakeLists.txt Sets the minimum required CMake version and defines the project name. Ensure your CMake installation meets the version requirement. ```cmake cmake_minimum_required(VERSION 3.18) project(ignite_package_test) ``` -------------------------------- ### Run Apache Ignite Cluster with Docker Compose Source: https://github.com/apache/ignite-3/blob/main/docs/docs/configure-and-operate/installation/docker.md Starts a 3-node Apache Ignite cluster using a docker-compose file. Ensure Docker Compose version 2.23.1 or later is installed. ```shell docker compose -f docker-compose.yml up -d ``` -------------------------------- ### Start and Initialize Embedded Node Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/java/server-api.md Use IgniteServer.start to initialize an embedded node, followed by initCluster for cluster setup. Obtain the Ignite API via api(). Requires unique node name, config path, and work directory. ```java IgniteServer server = IgniteServer.start( "myNode", Path.of("/config/ignite-config.conf"), Path.of("/work/dir") ); server.initCluster( InitParameters.builder() .metaStorageNodes(server) .cmgNodes(server) .build() ); Ignite ignite = server.api(); String nodeName = ignite.name(); System.out.println("Node started: " + nodeName); // Use node for operations ``` -------------------------------- ### Create and Configure .NET Compute Job Project Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/work-with-data/compute.md Use the `dotnet new classlib` command to create a new class library project for your compute jobs. Add the `Apache.Ignite` NuGet package to your project. ```bash dotnet new classlib -n MyComputeJobs cd MyComputeJobs dotnet add package Apache.Ignite ``` ```bash dotnet add package Apache.Ignite ``` -------------------------------- ### Serve Documentation Locally Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/dotnet/DEVNOTES.md Builds and serves the project documentation locally using DocFX, allowing for previewing changes before deployment. ```bash dotnet docfx docs/docfx.json --serve ``` -------------------------------- ### Manage Cluster via REST API Source: https://context7.com/apache/ignite-3/llms.txt Interact with the cluster using OpenAPI-compatible REST API endpoints on port 10300 for monitoring and management. Examples include getting cluster state, creating snapshots, and using the generated Java client. ```bash # Get cluster state curl 'http://localhost:10300/management/v1/cluster/state' # Create snapshot curl -H "Content-Type: application/json" \ -d '{"snapshotType": "FULL","tableNames": "table1,table2","startTimeEpochMilli": 0}' \ http://localhost:10300/management/v1/snapshot/create # Using generated Java client ApiClient client = Configuration.getDefaultApiClient(); client.setBasePath("http://localhost:10300"); ClusterConfigurationApi clusterConfigurationApi = new ClusterConfigurationApi(client); String configuration = clusterConfigurationApi.getClusterConfiguration(); ``` -------------------------------- ### Build Installed Ignite Package Test (Client and ODBC) Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/cpp/tests/package-test/README.md Builds tests that search for an installed Ignite instance. The installation is simulated within the build directory, and CMake searches for 'ignite-config.cmake' in the specified installation path. ```bash cmake -DENABLE_CLIENT=ON -DENABLE_ODBC=ON -S ../tests/package-test/cmake_package_install/ -B build_package_install && cmake --build build_package_install ``` -------------------------------- ### Generate HTML Documentation Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/python/dbapi/README.md Navigate to the docs directory and run 'make html' to generate the project's HTML documentation. The output will be in docs/_build/html. ```bash $ cd docs $ make html ``` -------------------------------- ### Install Python DB API Driver Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/connect-to-ignite/python.md Install the Python DB API driver using pip. Ensure Python 3.9+ and CMake 3.18+ are installed. ```bash pip install pyignite3_dbapi ``` -------------------------------- ### Build Docker Image for ARM64 (Minimal Steps) Source: https://github.com/apache/ignite-3/blob/main/RELEASE.md Minimal Docker build commands for multi-platform images, including setting up the build environment. ```bash docker buildx build --load -t linux/arm64 --builder=container . docker run --privileged --rm tonistiigi/binfmt --install all ``` -------------------------------- ### Start Ignite Nodes Source: https://github.com/apache/ignite-3/blob/main/DEVNOTES.md Commands to start the configured Ignite nodes. ```shell ./node1/bin/ignite3db start ./node2/bin/ignite3db start ./node3/bin/ignite3db start ``` -------------------------------- ### Basic C/C++ Connection and Query Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/sql-only-apis/odbc.md Demonstrates allocating environment and connection handles, connecting, executing a direct query, and fetching results using the ODBC API. ```c #include #include SQLHENV env; SQLHDBC dbc; SQLHSTMT stmt; // Allocate environment SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env); SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void*)SQL_OV_ODBC3, 0); // Allocate connection SQLAllocHandle(SQL_HANDLE_DBC, env, &dbc); // Connect SQLCHAR connStr[] = "DRIVER={Apache Ignite 3};ADDRESS=localhost:10800"; SQLDriverConnect(dbc, NULL, connStr, SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT); // Allocate statement SQLAllocHandle(SQL_HANDLE_STMT, dbc, &stmt); // Execute query SQLExecDirect(stmt, (SQLCHAR*)"SELECT id, name FROM users", SQL_NTS); // Fetch results SQLINTEGER id; SQLCHAR name[256]; SQLLEN idLen, nameLen; SQLBindCol(stmt, 1, SQL_C_LONG, &id, 0, &idLen); SQLBindCol(stmt, 2, SQL_C_CHAR, name, sizeof(name), &nameLen); while (SQLFetch(stmt) == SQL_SUCCESS) { printf("%d: %s\n", id, name); } // Cleanup SQLFreeHandle(SQL_HANDLE_STMT, stmt); SQLDisconnect(dbc); SQLFreeHandle(SQL_HANDLE_DBC, dbc); SQLFreeHandle(SQL_HANDLE_ENV, env); ``` -------------------------------- ### Build All Packages Source: https://github.com/apache/ignite-3/blob/main/DEVNOTES.md Execute this command to build all packages, including running unit tests and all checks. ```shell ./gradlew clean docker distZip allDistZip buildRpm buildDeb -Pplatforms.enable ``` -------------------------------- ### Complete Connection String Configuration Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/sql-only-apis/jdbc.md A comprehensive connection string example including multiple nodes, schema, authentication, SSL configuration, and various timeouts. ```none jdbc:ignite:thin://node1:10800,node2:10800/mySchema?username=admin&password=secret&sslEnabled=true&trustStorePath=/opt/certs/truststore.jks&trustStorePassword=changeit&keyStorePath=/opt/certs/keystore.jks&keyStorePassword=changeit&connectionTimeout=5000&queryTimeout=60 ``` -------------------------------- ### Verify Docker Buildx Installation Source: https://github.com/apache/ignite-3/blob/main/RELEASE.md Check if Docker Buildx is installed. This is a component of Docker. ```bash docker buildx version ``` -------------------------------- ### Start C++ Client with Default Configuration Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/cpp/client-api.md Initiates a connection to an Apache Ignite cluster using default settings. The connection attempt blocks until successful or a timeout occurs. ```cpp using namespace ignite; ignite_client_configuration cfg{{"localhost:10800"}}; ignite_client client = ignite_client::start(cfg, std::chrono::seconds(30)); ``` -------------------------------- ### Verify Docker Installation Source: https://github.com/apache/ignite-3/blob/main/RELEASE.md Check if Docker is installed and its version. Requires Docker 19.03+. ```bash docker version ``` -------------------------------- ### Build Documentation Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/dotnet/DEVNOTES.md Restores necessary .NET tools and then builds the project documentation using DocFX. The resulting documentation is located in the docs/_site directory. ```bash dotnet tool restore dotnet docfx docs/docfx.json ``` -------------------------------- ### COPY TO CSV Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/reference/data-types-and-functions/operational-commands.mdx Example demonstrating how to export data from a table to a CSV file. ```APIDOC ## COPY TO CSV ### Description Exports data from Table1 to a CSV file. ### Method COPY TO ### Endpoint N/A (SQL Command) ### Request Example ```sql /* Export data to CSV */ COPY FROM (SELECT name, age FROM Table1) INTO '/path/to/dir/data.csv' FORMAT CSV ``` ``` -------------------------------- ### .NET Client - Dependency Injection Setup Source: https://context7.com/apache/ignite-3/llms.txt Configure the .NET client for dependency injection, setting up a client group with a specified size and configuration. ```csharp builder.Services.AddSingleton(_ => new IgniteClientGroup( new IgniteClientGroupConfiguration { Size = 3, ClientConfiguration = new("localhost"), })); ``` -------------------------------- ### ODBC Connection String Samples Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/connect-to-ignite/odbc-connection-string.md Examples of connection strings for various configurations, including specific schemas, default settings, authentication, and custom page sizes. ```text DRIVER={Apache Ignite 3};ADDRESS=localhost:10800;SCHEMA=yourSchemaName ``` ```text DRIVER={Apache Ignite 3};ADDRESS=localhost:10800 ``` ```text DRIVER={Apache Ignite 3};ADDRESS=localhost:10800;IDENTITY=yourid;SECRET=yoursecret ``` ```text DRIVER={Apache Ignite 3};ADDRESS=localhost:10800;SCHEMA=yourSchemaName;PAGE_SIZE=4096 ``` -------------------------------- ### Create Zone and Table with RocksDB Profile Source: https://github.com/apache/ignite-3/blob/main/docs/docs/understand/architecture/storage-engines/rocksdb.md SQL example demonstrating how to create a zone and a table utilizing a specific RocksDB storage profile. This is useful for segregating workloads with different storage requirements. ```sql -- Create a zone for write-heavy tables CREATE ZONE logging_zone WITH PARTITIONS=10, REPLICAS=2, STORAGE PROFILES ['write_heavy_profile']; -- Create a table for event logging CREATE TABLE events ( event_id BIGINT PRIMARY KEY, event_type VARCHAR, payload VARCHAR, created_at TIMESTAMP ) ZONE logging_zone STORAGE PROFILE 'write_heavy_profile'; ``` -------------------------------- ### Install Test Requirements Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/python/dbapi/README.md Install the necessary requirements for running tests, including base and test-specific packages. ```bash $ pip install -r requirements/install.txt -r requirements/tests.txt ``` -------------------------------- ### Install Specific Version of pyignite_dbapi Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/python/dbapi/README.md Install a particular version of the pyignite_dbapi package by specifying the version number. ```bash pip install pyignite_dbapi==3.1.0 ``` -------------------------------- ### SQL Commands for Table Management Source: https://github.com/apache/ignite-3/blob/main/README.md Example SQL commands to create a table, insert data, and select data from the Person table. ```sql CREATE TABLE IF NOT EXISTS Person (id int primary key, city varchar, name varchar, age int, company varchar); INSERT INTO Person (id, city, name, age, company) VALUES (1, 'London', 'John Doe', 42, 'Apache'); INSERT INTO Person (id, city, name, age, company) VALUES (2, 'New York', 'Jane Doe', 36, 'Apache'); SELECT * FROM Person; ``` -------------------------------- ### COPY TO Iceberg Examples Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/reference/data-types-and-functions/operational-commands.mdx Examples demonstrating how to export data to Iceberg format, both locally and on AWS S3. ```APIDOC ## COPY TO Local Iceberg ### Description A simple example of exporting data to Iceberg. For working with local file system you can use HadoopCatalog that does not need to connect to a Hive MetaStore. ### Method COPY TO ### Endpoint N/A (SQL Command) ### Request Example ```sql COPY FROM Table1 (id,name,height) INTO '/tmp/person.i/' FORMAT ICEBERG WITH 'table-identifier'='person', 'catalog-impl'='org.apache.iceberg.hadoop.HadoopCatalog' ``` ``` ```APIDOC ## COPY TO AWS S3 Iceberg ### Description Exports data into Iceberg on AWS S3. ### Method COPY TO ### Endpoint N/A (SQL Command) ### Request Example ```sql COPY FROM person (id,name,height) INTO 's3://iceberg-warehouse/glue-catalog' FORMAT ICEBERG WITH 'table-identifier'='iceberg_db_1.person', 'io-impl'='org.apache.iceberg.aws.s3.S3FileIO', 'catalog-impl'='org.apache.iceberg.aws.glue.GlueCatalog', 's3.client-region'='eu-central-1', 's3.access-key-id'='YOUR_KEY', 's3.secret-access-key'='YOUR_SECRET' ``` :::warning Glue catalog requires the table identifier pattern `db_name.table_name - [a-z0-9_]` (all letters must be in low case with underscores and no spaces). It can be disabled by setting the `glue.skip-name-validation` property to `true` to skip validation. When database name and table name validation are skipped, there is no guarantee that downstream systems would all support the names. ::: ``` -------------------------------- ### Basic Transaction Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/api-reference/native-clients/dotnet/transactions-api.md Demonstrates how to begin a transaction, perform multiple operations, and then commit or roll back. Ensure the transaction is disposed in the finally block. ```csharp var transactions = client.Transactions; var tx = await transactions.BeginAsync(); try { var table = await client.Tables.GetTableAsync("accounts"); var view = table.GetRecordView(); // Multiple operations in transaction var account1 = new Account { Id = 1 }; var account1Data = await view.GetAsync(tx, account1); var account2 = new Account { Id = 2 }; var account2Data = await view.GetAsync(tx, account2); // Update balances account1Data.Value.Balance -= 100; account2Data.Value.Balance += 100; await view.UpsertAsync(tx, account1Data.Value); await view.UpsertAsync(tx, account2Data.Value); // Commit transaction await tx.CommitAsync(); } catch { await tx.RollbackAsync(); throw; } finally { await tx.DisposeAsync(); } ``` -------------------------------- ### Build .NET Binaries Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/dotnet/DEVNOTES.md Builds the .NET project. This command should be run from the directory containing the .NET project files. ```bash dotnet build ``` -------------------------------- ### Start Apache Ignite Node Source: https://github.com/apache/ignite-3/blob/main/docs/docs/configure-and-operate/installation/zip.md Command to start an Apache Ignite node. By default, it loads configuration from etc/ignite-config.conf. ```shell bin/ignite3db ``` -------------------------------- ### Install pyignite_dbapi from Sources (Editable Mode) Source: https://github.com/apache/ignite-3/blob/main/modules/platforms/python/dbapi/README.md Install the pyignite_dbapi package in editable mode from local sources. This is recommended for developers. ```bash $ cd $ pip install -e . ``` -------------------------------- ### COPY FROM AWS S3 Example Source: https://github.com/apache/ignite-3/blob/main/docs/docs/sql/reference/data-types-and-functions/operational-commands.mdx Example demonstrating how to import a CSV file from AWS S3 into an Apache Ignite table. ```APIDOC ## COPY FROM S3 ### Description Imports CSV file from AWS S3 into Table1. ### Method COPY FROM ### Endpoint N/A (SQL Command) ### Request Example ```sql /* Import CSV file from s3 */ COPY FROM 's3://mybucket/data.csv' INTO Table1 (name, age) FORMAT CSV WITH 'delimiter'= '|', 's3.access-key-id' = 'keyid', 's3.secret-access-key' = 'secretkey' ``` ``` -------------------------------- ### Build Production Site Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Generate the static production build of the documentation site into the 'build' directory. ```bash npm run build ``` -------------------------------- ### Configure CMake Alternatives Source: https://github.com/apache/ignite-3/blob/main/docs/docs/develop/ignite-clients/cpp.md Set up alternatives for CMake to ensure the correct version (cmake3) is used. This involves creating and configuring alternatives for cmake, ctest, cpack, and ccmake. ```bash sudo alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake 10 \ --slave /usr/local/bin/ctest ctest /usr/bin/ctest \ --slave /usr/local/bin/cpack cpack /usr/bin/cpack \ --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake \ --family cmake ``` ```bash sudo alternatives --install /usr/local/bin/cmake cmake /usr/bin/cmake3 20 \ --slave /usr/local/bin/ctest ctest /usr/bin/ctest3 \ --slave /usr/local/bin/cpack cpack /usr/bin/cpack3 \ --slave /usr/local/bin/ccmake ccmake /usr/bin/ccmake3 \ --family cmake ``` ```bash sudo alternatives --config cmake ``` -------------------------------- ### Start a Node in the Cluster Source: https://github.com/apache/ignite-3/blob/main/CLAUDE.md Starts a specific node in the Ignite cluster. Use node numbers 1, 2, or 3. ```bash just start 1 ``` -------------------------------- ### Implement Node Configuration Show Command (Interactive) Source: https://github.com/apache/ignite-3/blob/main/modules/cli/README.md Implementation of an interactive command to show node configuration. Integrates with `ConnectToClusterQuestion` to ensure connection before execution. ```java @Command(name = "show", description = "Shows node configuration") public class NodeConfigShowReplCommand extends BaseCommand implements Runnable { /** Node URL option. */ @Mixin private NodeUrlMixin nodeUrl; /** Configuration selector option. */ @Parameters(arity = "0..1", description = "Configuration path selector") private String selector; @Inject private NodeConfigShowCall call; @Inject private ConnectToClusterQuestion question; /** {@inheritDoc} */ @Override public void run() { question.askQuestionIfNotConnected(nodeUrl.getNodeUrl()) .map(this::nodeConfigShowCallInput) .then(Flows.fromCall(call)) .print() .start(); } private NodeConfigShowCallInput nodeConfigShowCallInput(String nodeUrl) { return NodeConfigShowCallInput.builder().selector(selector).nodeUrl(nodeUrl).build(); } } ``` -------------------------------- ### Get a Specific Configuration Value Source: https://github.com/apache/ignite-3/blob/main/docs/docs/tools/cli-commands.md Retrieves the value of a specific configuration key. You can optionally specify a profile to get the value from. ```bash cli config get ignite.jdbc-url ``` -------------------------------- ### Run CLI Tool with Mounted Configuration/Data Files Source: https://github.com/apache/ignite-3/blob/main/docs/docs/configure-and-operate/installation/docker.md Launches the CLI tool in a Docker container, mounting local configuration or data files into the container. This example uses '--network=host' for simplicity, but a dedicated network is generally recommended. ```shell docker run --rm -it --network=host -v /opt/etc/config.conf:/opt/ignite/etc/ignite-config.conf apache/ignite3:{version} cli ``` -------------------------------- ### Build Production Site (Full) Source: https://github.com/apache/ignite-3/blob/main/docs/README.md Perform a full production build, including TypeScript validation, for the documentation site. ```bash npm run build:prod ```