Advanced Maintenance Activities


Interacting with Space Data

Info

This functionality is not currently available in the Command Line Interface, REST Manager API, or Administration API.

Querying a Space

The Web Management Console and GigaSpaces Management Center support SQL queries, enabling users to perform actions on the data objects in the Space. For example, to query a specific class:

SELECT * FROM my.company.com.MyPojo WHERE rownum < 1000

To query a Space:

  1. In the Spaces view, highlight the Space or the Space instance you want to query.
  2. Display the Queries pane in the lower area of the view.
  3. Type a query, or click a data type from the Types pane.
  4. Click Execute Query.

    The query is executed against the selected Space or Space instance. If there are too many results to display on a single web page, you can navigate using the paging controls at the bottom of the table. Paging is static (results are fetched once per execute request).

  5. If you have tried to run multiple queries, you can navigate between them using the Go Back/Go Forward buttons, or select a query from the dropdown lists next to these buttons.

  6. To export the results of a query:

    1. Click Export.
    2. Select an action (Open, Save, or Cancel).

    The results are exported in a zipped CSV file.

Refer to the GigaSpaces Management Center topics in the Administration section.

Deleting Data from a Space

You can clear data from a Space using SQL queries, or via the user interface.

To delete (clear) data from a Space:

  1. In the Spaces view, highlight the Space where you want to delete the data.
  2. Display the Types pane in the lower area of the view.
  3. 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.

Refer to the GigaSpaces Management Center topics in the Administration section.

Quiescing a Processing Unit

To quiesce a Processing Unit:

Command:

xap pu quiesce <name>

Description:

This command disables a running Processing Unit for maintenance.

Input Example:

<XAP-HOME>/bin/xap 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
  1. In the Processing Units view, highlight the Processing Unit you want to quiesce.
  2. Click the Actions icon, and select Quiesce from the menu.
  3. (Optional) If you want helpful information to appear in the log, type some descriptive text in the Description box (for example: “offline for maintenance”).
  4. 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 GigaSpaces Management Center topics in the Administration section.

Refer to the Admin API topics in the Developer Guide.

Unquiescing a Processing Unit

To unquiesce a Processing Unit:

Command:

xap pu unquiesce <pu name>

Description:

This command enables a quiesced Processing Unit.

Input Example:

<XAP-HOME>/bin/xap 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
  1. In the Processing Units view, highlight the Processing Unit you want to unquiesce.
  2. Click the Actions icon, and select Unquiesce from the menu.
  3. 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 GigaSpaces Management Center topics in the Administration section.

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:

xap space demote-instance <instance ID>

Description:

This command demotes a Space instance from a primary to a backup, with no downtime required.

Input Example:

<XAP-HOME>/bin/xap 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
  1. In any view, highlight the Space instance you want to demote.
  2. Click the Actions icon, and select Demote from the menu.
  3. (Optional) If you want helpful information to appear in the log, type some descriptive text in the Description box (for example: “rebalance after failover”).
  4. 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

Info

This functionality is not yet available in the Command Line Interface or REST Manager API administration tools.

To restart a Processing Unit:

  1. In the Processing Units view, highlight the Processing Unit instance you want to restart.
  2. Click the Actions icon, and select Restart from the menu.
  3. 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 GigaSpaces Management Center topics in the Administration section.

Refer to the Admin API topics in the Developer Guide.

Relocating a Processing Unit

To relocate a Processing Unit:

Command:

xap 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:

<XAP-HOME>/bin/xap 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
  1. In the Processing Units view, highlight the Processing Unit instance you want to relocate.
  2. Click the Actions icon, and select Relocate from the menu.
  3. Highlight the host where you want to move the instance, and click Select.
  4. 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 GigaSpaces Management Center topics in the Administration section.

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:

<XAP-HOME>/bin/xap 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
Info

This functionality is not available in the Web Management Console.

Refer to the GigaSpaces Management Center topics in the Administration section.

Refer to the Admin API topics in the Developer Guide.

Decrementing a Processing Unit Instance

To decrement a Processing Unit:

Command:

xap pu decrement <instance ID>

Description:

This command removes one instance from the specified Processing Unit (which must be stateless).

Input Example:

<XAP-HOME>/bin/xap 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
Info

This functionality is not available in the Web Management Console.

Refer to the GigaSpaces Management Center topics in the Administration section.

Refer to the Admin API topics in the Developer Guide.