Advanced Maintenance Activities
Interacting with Space Data
This functionality is not currently available in the Command Line Interface, REST REpresentational State Transfer. Application Programming Interface An API, or application programming interface, is a set of rules that define how applications or devices can connect to and communicate with each other. A REST API is an API that conforms to the design principles of the REST, or representational state transfer architectural style. Manager API, or Administration API.
Deleting Data from a Space
You can clear data from a Space Where GigaSpaces data is stored. It is the logical cache that holds data objects in memory and might also hold them in layered in tiering. Data is hosted from multiple SoRs, consolidated as a unified data model. using SQL queries, or via the user interface.
To delete (clear) data from a Space:
-
In the Spaces view, highlight the Space where you want to delete the data.
-
Display the Types pane in the lower area of the view.
-
Click the Actions icon and select Clear from the menu.
After you delete the data, you can verify it was removed by looking at the value of the Instances Count column for that data type.
Quiescing a Processing Unit
Command:
Description:
This command disables a running Processing Unit for maintenance.
Input Example:
<GS_HOME>/bin/gs pu quiesce myPu --description="start friday maintenance"
<GS_HOME>/bin/gs.sh pu quiesce myPu --description="start friday maintenance"
Parameters and Options:
Item | Name | Description |
---|---|---|
Parameter | name | The name of the Processing Unit to disable. |
Option | description | Reason for disabling the Processing Unit (for auditing purposes). |
Path
POST /pus/{id}/quiesce
Description:
This option disables a running Processing Unit for maintenance.
Example Request:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/plain' 'http://localhost:8090/v2/pus/myPu/quiesce'
Options:
Option | Description | Required |
---|---|---|
pu name | Provide the name of the Processing Unit you want to quiesce. | Yes |
pdescription | Provide descriptive text about quiescing the Processing Unit, which will appear in the event log. | No |
-
In the Processing Units view, highlight the Processing Unit you want to quiesce.
-
Click the Actions icon, and select Quiesce from the menu.
-
(Optional) If you want helpful information to appear in the log, type some descriptive text in the Description box (for example: "offline for maintenance").
-
Click OK.
The Quiesce Progress window displays the result of the Quiesce process (for example, "Quiesce completed successfully"), and a token that the administrator can use to perform actions on the Processing Unit while it is in quiesced state. It is recommended to copy this token from the window before clicking OK.
Refer to the Admin API topics in the Developer Guide.
Unquiescing a Processing Unit
To unquiesce a Processing Unit:
Command:
gs.{sh/bat} pu unquiesce <pu name>
Description:
This command enables a quiesced Processing Unit.
Input Example:
<GS_HOME>/bin/gs pu unquiesce myPu
<GS_HOME>/bin/gs.sh pu unquiesce myPu
Parameters and Options:
Item | Name | Description |
---|---|---|
Parameter | name | The name of the quiesced Processing Unit to enable. |
Path
POST /pus/{id}/unquiesce
Description:
This option unquiesces a Processing Unit.
Example Request:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/plain' 'http://localhost:8090/v2/pus/myPu/unquiesce'
Options:
Option | Description | Required |
---|---|---|
pu name | Provide the name of the Processing Unit you want to unquiesce. | Yes |
-
In the Processing Units view, highlight the Processing Unit you want to unquiesce.
-
Click the Actions icon, and select Unquiesce from the menu.
-
Click Yes in the confirmation message.
When the Processing Unit is available again, the status in the Processing Unit view changes to Intact.
Refer to the Admin API topics in the Developer Guide.
Demoting a Primary Space Instance
To demote a Space instance from a primary to a backup:
Command:
gs.{sh/bat} space demote-instance <instance ID>
Description:
This command demotes a Space instance from a primary to a backup, with no downtime required.
Input Example:
<GS_HOME>/bin/gs space demote-instance mySpace~1_1 --max-suspend-time=15s
<GS_HOME>/bin/gs.sh space demote-instance mySpace~1_1 --max-suspend-time=15s
Parameters and Options:
Item | Name | Description |
---|---|---|
Parameter | instance ID | Provide the ID of the Space instance you want to demote. |
Option | max-suspend-time | Define the maximum amount of time that the Space instance can be suspended, in seconds, during the demote process. The default value is 15. |
Path
POST /spaces/{id}/instances/{instanceId}/demote
Description:
This command demotes a Space instance from a primary to a backup, with no downtime required.
Example Request:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/plain' 'http://localhost:8090/v2/spaces/mySpace/instances/mySpace~1_1/demote?maxSuspendTime=15s'
Options:
Option | Description | Required |
---|---|---|
id | The name of the Space. | Yes |
instanceId | The ID of the Space instance you want to demote. | Yes |
maxSuspendTime | Define the maximum amount of time that the Space instance can be suspended, in seconds, during the demote process. The default value is 15. | No |
-
In any view, highlight the Space instance you want to demote.
-
Click the Actions icon, and select Demote from the menu.
-
(Optional) If you want helpful information to appear in the log, type some descriptive text in the Description box (for example: "rebalance after failover").
-
Click OK.
The Demote Progress window displays the result of the process (for example, "Demote completed successfully").
You can view the status of the Space instances in the Space Browser tab. However, you must use one of the other administration tools to hot swap the instances.
You can use the Administration API to demote a primary Space instance to a backup.
You can call demote for a Space instance, with a parameter of maximum suspend time for that Space instance during the demote process, as follows:
Admin admin = ... // Get or init an Admin instance
Space mySpace = admin.getSpaces().waitFor("mySpace");
SpaceInstance primarySpaceInstance = mySpace.getPartition(0).getPrimary();
// call demote with maximum suspend time of 15 seconds
Future<?> future = primarySpaceInstance.demote(15, TimeUnit.SECONDS);
future.get(); // or future.get(timeout, unit);
In addition, the Administration API allows registering for SuspendTypeChangedEvent:
SpaceSuspendTypeChangedEventListener myListener = new SpaceSuspendTypeChangedEventListener() {
@Override
public void spaceSuspendTypeChanged(SpaceSuspendTypeChangedEvent event) {
System.out.println("Got event for space instance [" + event.getSpaceInstance().getId() + "], " +
"previous value is " + event.getPreviousSuspendType() + ", " +
"new value is " + event.getNewSuspendType());
}
};
mySpace.getSpaceSuspendTypeChanged().add(myListener);
...
mySpace.getSpaceSuspendTypeChanged().remove(myListener);
The SuspendType options are:
-
NONE - The Space is not suspended.
-
QUIESCED - The Space is quiesced.
-
DEMOTING - The Space is being demoted to backup.
-
DISCONNECTED - The Space is disconnected from Apache ZooKeeper.
Restarting a Processing Unit
This functionality is not yet available in the Command Line Interface or REST Manager API administration tools.
To restart a Processing Unit:
-
In the Processing Units view, highlight the Processing Unit instance you want to restart.
-
Click the Actions icon, and select Restart from the menu.
-
Click Yes in the confirmation message.
The Processing Unit instance is not visible in the Processing Unit view until it has finished restarting. This can take several seconds.
Refer to the Admin API topics in the Developer Guide.
Relocating a Processing Unit
To relocate a Processing Unit:
Command:
gs.{sh/bat} pu relocate <instance ID> [<container ID>]
Description:
This command moves a Processing Unit instance to another container. If container ID is not specified, the Processing Unit instance will be moved to any available container.
Input Example:
<GS_HOME>/bin/gs pu relocate myPu~1 container~1
<GS_HOME>/bin/gs.sh pu relocate myPu~1 container~1
Parameters and Options:
Item | Name | Description |
---|---|---|
Parameter | instance ID | ID of the Processing Unit instance to relocate. |
Parameter | [container ID] | The ID of the target container that will host the Processing Unit instance. |
Path
POST /pus/{id}/instances/{instanceId}/relocate
Description:
This option moves a Processing Unit instance to another container.
Example Request:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/plain' 'http://localhost:8090/v2/pus/alertSpace/instances/instance1/relocate?containerId=container2'
Options:
Option | Description | Required |
---|---|---|
pu name | Provide the name of the Processing Unit you want to relocate. | Yes |
pu instanceId | Provide the instanceId of the Processing Unit you want to relocate. | Yes |
targetContainerId | Id of Target container to relocate to | Yes |
-
In the Processing Units view, highlight the Processing Unit instance you want to relocate.
-
Click the Actions icon, and select Relocate from the menu.
-
Highlight the host where you want to move the instance, and click Select.
-
Click Yes in the confirmation message.
The Processing Unit state is Scheduled in the Processing Unit view until the instance is relocated and initiated. This can take several seconds.
Refer to the Admin API topics in the Developer Guide.
Incrementing a Processing Unit Instance
To increment a Processing Unit:
Command:
xap pu increment <name>
Description:
This command adds one instance to the specified Processing Unit (which must be stateless).
Input Example:
<GS_HOME>/bin/gs pu increment myPu
<GS_HOME>/bin/gs.sh pu increment myPu
Parameters and Options:
Item | Name | Description |
---|---|---|
Parameter | name | Provide the name of the stateless Processing unit to increment. |
Path
POST /pus/{id}/instances
Description:
This option adds one instance to the specified Processing Unit (which must be stateless).
Example Request:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/plain' 'http://localhost:8090/v2/pus/myPu/instances'
Options:
Option | Description | Required |
---|---|---|
pu name | Provide the name of the stateless Processing Unit to increment. | Yes |
This functionality is not available in the Web Management Console.
Refer to the Admin API topics in the Developer Guide.
Decrementing a Processing Unit Instance
To decrement a Processing Unit:
Command:
gs.{sh/bat} pu decrement <instance ID>
Description:
This command removes one instance from the specified Processing Unit (which must be stateless).
Input Example:
<GS_HOME>/bin/gs pu decrement myPu~3
<GS_HOME>/bin/gs.sh pu decrement myPu~3
Parameters and Options:
Item | Name | Description |
---|---|---|
Parameter | instance ID | Provide the ID of the Processing Unit instance to be removed. |
Path
DELETE /pus/{id}/instances/{instanceId}
Description:
This option removes one Processing Unit instance from the specified Processing Unit (must be stateless).
Example Request:
curl -X DELETE --header 'Accept: text/plain' 'http://localhost:8090/v2/pus/myPu/instances/myPu~1'
Options:
Option | Description | Required |
---|---|---|
instanceId | Provide the instance ID of the Processing Unit instance to be removed. | Yes |
This functionality is not available in the Web Management Console.
Refer to the Admin API topics in the Developer Guide.