Sorry, we didn't find any relevant articles for you.

Send us your queries using the form below and we will get back to you with a solution.

How do I run multiple GenRocket Partitions?

Description

This article describes how to run multiple GenRocket Partitioned instances and provides additional commands for the Partition Engine Queue and Queue History.

 

G-Partition Engine Port Configuration

The G-Partition Engine instances are launched via the G-REST engine:

 

Launching the GenRocket Realtime REST Engine

The partition engine runs from within the GenRocket Realtime REST Engine. The first step is to open a command-line terminal and launch the GenRocket Realtime REST Engine.   

genrocket -T <portNumber> -d

Example: 

genrocket -T 8181 -d

Launching the Realtime REST Engine over HTTPS

Use the following command to launch the Realtime REST Engine over HTTPS:

genrocket -Ts <portNumber>

 

Partition Request URL

Use the following URL to request that the GenRocket Realtime REST Engine launch a set of partitions:

http://:<IpOfLocalSystemOrServer>:<portNumber>/grRest/partition

Example: 

http://192.0.2.1:8181/grRest/partition

 

Launching Partitions Using Curl Command

If partitions need to be launched from a command-line script, then using a curl command on Linux and Unix machines is a good solution. The following example shows the partition engine being launched using a curl command (you'll want to copy and paste the curl example into a local editor to get a full view of the one-line command).

curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{
    "numberOfRecords": 100000000,
    "numberOfServers": 1,
    "instancesPerServer": 10,
    "serverNumber": 1,
    "scenarioPath": "/Users/guest/Scenarios/Partition/",
    "scenario": "UserScenario.grs",
    "attributes": [
        "id",
        "ssn",
        "creditCard"
    ]
}' http://<IpOfLocalSystemOrServer>:8181/grRest/partition

 

The request to execute the Scenario using the Partition Engine will go to the Queue. The user will receive a response similar to what is shown below:

{ 
  "success": true, 
  "queueId": 4, 
  "message": "We have added your request to generate the data using Partition Engine into the queue" 
}

 

The request will go into the queue. Then, every 10 seconds, your request from the queue will get picked up to be processed by the Partition Engine, and entry from the queue will be removed.
 

Launching Partitions Using Postman

Use the web developers helper program of choice, The Advanced REST Client (ARC), Postman, or any other REST client to send a request to the GenRocket Realtime REST Engine to launch a set of partitions.
 

Example: Using Postman and a Mac computer.
 

 

Monitoring the Partition Engine Queue

The Partition Engine Queue can be monitored with the following API request:

curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{}'

 

Example: 

http://<IpOfLocalSystemOrServer>:8181/grRest/listQueue

 

Clearing the Partition Engine Queue

The Partition Engine Queue can be cleared (e.g., cancel a request) with the following API request:

curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{}'

 

Example: 

http://<IpOfLocalSystemOrServer>:8181/grRest/clearQueue

 

Clearing the Partition Engine Queue by Queue ID

The Partition Engine Queue can be cleared by the queue id: 

curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{queueId: 1}'

 

Example: 

http://<IpOfLocalSystemOrServer>:8181/grRest/clearQueueById

 

Checking the Partition Engine Queue History

Once the request gets processed by Partition Engine, it goes into the Queue History. The history gets cleared automatically every 3 hours. The Queue History can be checked using the following API call:
curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{}'
 
Example: 
http://<IpOfLocalSystemOrServer>:8181/grRest/listQueueHistory
 
Optionally, the queue ID can be passed to check if the request has been processed and moved into history.
 
curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{queueId: 1}'

 

Example: 

http://<IpOfLocalSystemOrServer>:8181/grRest/listQueueHistory

 

Clearing the Partition Engine Queue History

The history gets cleared every 3 hours. The following API can be used to clear the queue history:
curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{}'
 

Example: 

http://<IpOfLocalSystemOrServer>:8181/grRest/clearQueueHistory