Running an Application

There are multiple Grainite applications available in the samples repository. If you haven't already, please clone it before proceeding (run git clone https://gitlab.com/grainite/samples).

Below, we will run a Java application on Grainite. Before running it or any of the other Java apps in the samples repository, we'll need to compile them first using a build tool.

If you are using Java, please make sure you've completed the Java Setup steps in Environment Setup before proceeding.

If you are using Python you can skip to the helloPython sample app page to run a Python application at this point.

Change into the samples directory and compile the sample apps therein using the included Maven wrapper:

cd samples && ./mvnw compile package

In this example, we will use the wordcount app to ingest and process events:

cd wordcount

# Load the application on Grainite
# Note: GX is an alias set to samples/gx
gx load

# Submit traffic
./run.sh <server ip> default load resources/sample1.txt

# Get the word count for 'this'
./run.sh <server ip> default word this

# Get the word count for all words
./run.sh <server ip> default allwords

To learn more about this app and build it from scratch, visit the tutorial page for this app.

pageWordCount

Last updated