Description
This article describes how to run multiple GenRocket Partitioned instances and provides additional commands for the Partition Engine Queue and Queue History.
In This Article
- G-Partition Engine Port Configuration
- Launching the GenRocket Realtime REST Engine
- Partition Request URL
- Launching Partitions Using Curl Command
- Launching Partitions Using the Advanced REST Client
- Monitoring the Partition Engine Queue
- Clearing the Partition Engine Queue
- Clearing the Partition Engine Queue by Queue ID
- Checking the Partition Engine Queue History
- Clearing the Partition Engine Queue History
G-Partition Engine Port Configuration
The G-Partition Engine instances are launched via the G-REST engine:
- Launch command via, http://<IpOfLocalSystemOrServer>:8181/grRest/partition
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
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" }
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
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
curl -H "Accept:application/json;" -H "Content-Type:application/json" -d '{}'
Example:
http://<IpOfLocalSystemOrServer>:8181/grRest/clearQueueHistory