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

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


Partition Request URL

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


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


Example:

 

http://localhost: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://localhost: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 the Advanced REST Client

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


Example: Using ARC 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://localhost: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://localhost: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://localhost: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://localhost: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://localhost: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://localhost:8181/grRest/clearQueueHistory