This project contains code examples for Apache Ignite 3.
Examples are shipped as a separate Gradle module, so to start running you simply need to import the provided build.gradle file into your favourite IDE.
The following examples are included:
RecordViewExample - demonstrates the usage of the org.apache.ignite.table.RecordView APIKeyValueViewExample - demonstrates the usage of the org.apache.ignite.table.KeyValueView APISqlJdbcExample - demonstrates the usage of the Apache Ignite JDBC driver.SqlApiExample - demonstrates the usage of the Java API for SQL.VolatilePageMemoryStorageExample - demonstrates the usage of the PageMemory storage engine configured with an in-memory data region.PersistentPageMemoryStorageExample - demonstrates the usage of the PageMemory storage engine configured with a persistent data region.RocksDbStorageExample - demonstrates the usage of the RocksDB storage engine.Open the Ignite project in your IDE of choice.
Prepare an environment variable:
IGNITE_SOURCES=/path/to/ignite3-sources-dir
apacheignite/ignite3 image will be built and loaded into the Docker Engine:cd $IGNITE_SOURCES; ./gradlew clean docker
docker run --name ignite3-node -d --rm -p 10300:10300 -p 10800:10800 \ -v $IGNITE_SOURCES/examples/config/ignite-config.conf:/opt/ignite/etc/ignite-config.conf apacheignite/ignite3
NODE_IP_ADDRESS=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ignite3-node)
docker run -it apacheignite/ignite3 cli cluster init --url http://$NODE_IP_ADDRESS:10300 --name myCluster1 \ --cluster-management-group defaultNode --metastorage-group defaultNode
Run the example via IDE.
Stop the Ignite node:
docker stop ignite3-node
Open the Ignite project in your IDE of choice.
Download the Ignite ZIP package including the database and CLI parts. Alternatively, build these parts from the Ignite sources (see DEVNOTES.md). Unpack.
Prepare the environment variables. IGNITE_HOME is used in the Ignite startup. Therefore, you need to export it:
export IGNITE_HOME=/path/to/ignite3-db-dir IGNITE_CLI_HOME=/path/to/ignite3-cli-dir IGNITE_SOURCES=/path/to/ignite3-sources-dir
echo "CONFIG_FILE=$IGNITE_SOURCES/examples/config/ignite-config.conf" >> $IGNITE_HOME/etc/vars.env
$IGNITE_HOME/bin/ignite3db start
$IGNITE_CLI_HOME/bin/ignite3 cluster init --name myCluster1 --metastorage-group defaultNode --cluster-management-group defaultNode
Run the example from the IDE.
Stop the Ignite node using the startup script:
$IGNITE_HOME/bin/ignite3db stop