Querying [Version 8.6 and later], displaying, and invalidating data

You can use the query interfaces in the monitoring console and in the xscmd utility to retrieve small sets of keys [Version 8.6 and later]and values from a map and invalidate sets of data.

Before you begin

About this task

You can use the console or the xscmd utility to query data grid contents. You can query the data by running a regular expression on the data key. You can then use the same query to invalidate data. For examples of regular expressions, see Regular expression syntax.

Procedure

  • Query [Version 8.6 and later]display, or invalidate data with the console.
    1. Go to the query page in the console.
      In the web console, click Management > Query Data Grid Contents. Choose the map on which you want to filter.
    2. Search or filter the data in the map.
      You can use one of the following options to search or filter the data:
      • Type a regular expression in the field and click the Search button (Search). A list of keys that match the regular expression displays. The list of data could be a subset of all of the matching data.
      • To filter the results on a set of partitions, click the Filter button (Filter...). You can then type a regular expression and choose a range of partitions on which you want to filter the results.
    3. [Version 8.6 and later]Display values for the displayed keys.
      Select Show values. The values display in the table. If the value is too long to display, an ellipsis (...) truncates the value. Click the value to display the full field. Values are returned as text strings. Some values might not convert to human readable strings, and hexadecimal numbers are displayed.
      Important: The application might store object values for which the Java™ class is not known to the server. If the application is using eXtreme Data Format (XDF), these values display. If XDF is not being used, and the Java class is not known to the server, a message is returned that the class of the object was unavailable to the server.
    4. Invalidate data.
      When you invalidate the data, the data is permanently removed from the data grid.
      Selected keys
      You can select keys from the table to invalidate. You can either click entries individually or click the select all check box, which selects a maximum of 500 entries that are in the table. When you have the entries selected that you want to remove, click Invalidate > Selected keys.
      All keys matching query
      You can also invalidate all the data that matches your regular expression. Using this option deletes all data in the data grid that matches the regular expression, not just the maximum of 500 entries that is displayed in the console. To invalidate entries with the selected regular expression, click Invalidate > All keys matching query.
    5. [Version 8.6 and later]Delete the entire contents of a map.
      Click Clear Map. You must confirm that you want to delete all of the entries in the selected map.
  • Query [Version 8.6 and later]display, or invalidate data with the xscmd utility.
    Query data:
    xscmd.sh –c findbykey –g <data_grid> -m <map> 
    -fs <find_string> [-fp <partitionid>]
    You must include the data grid, map, and regular expression for the find string value. You can also filter on the partition ID. The result returns a subset of the entire query.
    Invalidate data:
    Include the -inv argument in the command to invalidate the data that is selected by the query.
    xscmd –c findbykey –g <data_grid> -m <map> 
    -fs <find_string> [-fp <partitionid>] -inv
    You must include the data grid, map, and regular expression for the find string value. You can also filter on the partition ID. When you run the invalidation, all matching values are invalidated, not just the small set that is returned by the query.
    [Version 8.6 and later]Display values for queried data:
    [Version 8.6 and later]Include the -rv argument in the command to display values for the data that is selected by the query.
    xscmd.sh –c findbykey –g <data_grid> -m <map> 
    -fs <find_string> -rv
    You must include the data grid, map, and regular expression for the find string value. You can also filter on the partition ID. The result returns a subset of the entire query and includes the values for each key.
    [Linux][Unix]Important: If your regular expression starts with the characters .*, the characters might not process correctly when you run the command. To resolve this issue, format your regular expression in one of the following ways:
    • Enclose your regular expression with apostrophe characters: -fs '.*'
    • Use a backslash to escape the asterisk character: -fs .\*
    Example:
    The following example looks for all entries in the Grid data grid and Map1 map.
    xscmd -c findbykey -g Grid -m Map1 -fs ".*"
    The command returns the following results:
    3 matching keys were found.
    
    Partition Key
    --------- ---
    2         keyghi
    4         keydef
    6         keyabc