Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ Check [the complete schedule](https://www.gridgain.com/products/services/trainin

## Setting Up Environment

* Java Developer Kit, version 11, 17 or 21
* Apache Maven 3.0 or later
* Docker
* Your favorite IDE, such as IntelliJ IDEA, or Eclipse, or a simple text editor.
* GridGain license file. Instructions will be emailed when you register, but, in short, grab your key [here](https://www.gridgain.com/tryfree)
* Docker and Docker Compose installed on your system
* Basic familiarity with command-line operations
* Java 11, 17 or 21 (for connecting to the cluster)
* Maven
* (An IDE such as IntelliJ will make things a lot easier but is not strictly necessary)

## Clone The Project

Expand Down Expand Up @@ -42,15 +44,15 @@ Start a two-node Ignite cluster:
4. Start your nodes using Docker Compose:

```bash
docker compose -f docker-compose.yml up
docker compose up -d
```

5. Switch back to your browser and select `Attach Apache Ignite`
5. Switch back to your browser and select `Attach GridGain`
6. In the "Connector" dropdown, select `Ignite Essentials`
7. The `URL of the REST API` is `http://node1:10300`
8. Click `Continue`
9. Click `Attach`
10. Initialise the cluster by clicking the `Initialise` button at the top-right of the screen
10. Initialize the cluster by clicking the `Initialize` button at the top-right of the screen. Drop in your license file as suggested

## Creating Media Store Schema and Loading Data

Expand All @@ -62,7 +64,7 @@ Now you need to create a Media Store schema and load the cluster with sample dat
a. Start the Command Line Interface (CLI)

```bash
docker run -v ./config/media_store.sql:/opt/ignite/downloads/media_store.sql --rm --network ignite3_default -it apacheignite/ignite:3.1.0 cli
docker run -v ./config/media_store.sql:/opt/gridgain/downloads/media_store.sql --rm --network ignite3_default -it gridgain/gridgain9:9.1.8 cli
```

b. Connect to the cluster.
Expand All @@ -74,7 +76,7 @@ Now you need to create a Media Store schema and load the cluster with sample dat
c. Execute SQL command to load the sample data.

```bash
sql --file=/opt/ignite/downloads/media_store.sql
sql --file=/opt/gridgain/downloads/media_store.sql
```

Keep the connection open as you'll use it for following exercises.
Expand Down Expand Up @@ -181,7 +183,7 @@ merges partial results.
a. Start the CLI.

```bash
docker run -v ./target/ignite-essentials-developer-training-1.0-SNAPSHOT.jar:/opt/ignite/downloads/ignite-essentials-developer-training-1.0-SNAPSHOT.jar --rm --network ignite3_default -it apacheignite/ignite:3.1.0 cli
docker run -v ./target/ignite-essentials-developer-training-1.0-SNAPSHOT.jar:/opt/gridgain/downloads/ignite-essentials-developer-training-1.0-SNAPSHOT.jar --rm --network ignite3_default -it gridgain/gridgain9:9.1.8 cli
```

b. Connect to the cluster.
Expand All @@ -193,12 +195,24 @@ merges partial results.
c. Deploy the code to the cluster.

```bash
cluster unit deploy --version 1.0.0 --path=/opt/ignite/downloads/ignite-essentials-developer-training-1.0-SNAPSHOT.jar essentialsCompute
cluster unit deploy --version 1.0.0 --path=/opt/gridgain/downloads/ignite-essentials-developer-training-1.0-SNAPSHOT.jar essentialsCompute
```

It's also possible to use Control Center to deploy your code if you prefer. Study the "Deployment" tab to find out more.
3. Execute the `ComputeApp` program with the following command:

```shell
mvn exec:java
```

Or run directly from your preferred IDE.

4. Edit `ComputeApp` and change the number of customers to return from 5 to 10. There's no need to redeploy the compute job because only the caller needs to change.

## Tidying up

When you've finished with the exercises, you can shut down the cluster and clean up with the following command:

```shell
docker compose down
```
18 changes: 9 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ name: ignite3

x-ignite-def:
&ignite-def
image: apacheignite/ignite:3.1.0
image: gridgain/gridgain9:9.1.8-openjdk21
environment:
- JVM_MAX_MEM=3g
- JVM_MIN_MEM=3g
configs:
- source: node_config
target: /opt/ignite/etc/ignite-config.conf
target: /opt/gridgain/etc/gridgain-config.conf

services:
node1:
Expand All @@ -38,14 +38,14 @@ services:
ports:
- 10301:10300
- 10801:10800
# node3:
# << : *ignite-def
# command: --node-name node3
# ports:
# - 10302:10300
# - 10802:10800
node3:
<< : *ignite-def
command: --node-name node3
ports:
- 10302:10300
- 10802:10800
cccc:
image: gridgain/cloud-connector:2025-10-17
image: gridgain/cloud-connector:2026-02-26
volumes:
- ./src/main/resources/controlcenter.conf:/opt/gridgain-cloud-connector/application.properties

Expand Down
11 changes: 9 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<ignite.project>org.apache.ignite</ignite.project>
<ignite.version>3.1.0</ignite.version>
<ignite.project>org.gridgain</ignite.project>
<ignite.version>9.1.8</ignite.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<exec.cleanupDaemonThreads>false</exec.cleanupDaemonThreads>
</properties>

<repositories>
<repository>
<id>GridGain External Repository</id>
<url>https://www.gridgainsystems.com/nexus/content/repositories/external</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>${ignite.project}</groupId>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/training/ComputeApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.ignite.marshalling.Marshaller;
import org.apache.ignite.table.Tuple;
import org.apache.ignite.Ignite;
import org.apache.ignite.tx.Transaction;
import training.model.CustomerPrice;
import training.model.TopCustomer;

Expand Down Expand Up @@ -126,7 +127,7 @@ public CompletableFuture<CustomerPrice[]> executeAsync(JobExecutionContext jobEx

customerCount = parameters.intValue("count");

try (var results = jobExecutionContext.ignite().sql().execute(null, sql, parameters.intValue("partition"))) {
try (var results = jobExecutionContext.ignite().sql().execute((Transaction) null, sql, parameters.intValue("partition"))) {
while (results.hasNext()) {
var row = results.next();
customerPurchases.merge(row.intValue("customerId"), row.value("price"), BigDecimal::add);
Expand Down