Lesson 4.1: Query service rankings

Complete this lesson to query current service rankings as well as those service rankings that are available for upgrade.

About this task

Procedure

  • Query the current service ranking for a service.
    Enter the following command to query the current service ranking being used for service, myShardListener, which is used by the ObjectGrid named Grid and map set named MapSet.
    1. Switch to the following directory:
      cd wxs_home/bin
      
    2. Enter the following command to query the current service ranking for the service, myShardListener.
      ./xscmd.sh -c osgiCurrent -g Grid -ms MapSet -sn myShardListener 
      The following output is displayed:
      OSGi Service Name: myShardListener
      ObjectGrid Name MapSet Name Server Name        Current Ranking
      --------------- ----------- -----------        ---------------
      Grid            MapSet      collocatedServer   1
      
      CWXSI0040I: The command osgiCurrent has completed successfully.
  • Query the current ranking for all services.
    Enter the following command to query the current service ranking for all services that are used by the ObjectGrid named Grid and map set named MapSet.
    1. Switch to the following directory:
      cd wxs_home/bin
      
    2. Enter the following command to query the current service ranking for all services.
      ./xscmd.sh -c osgiCurrent -g Grid -ms MapSet
      The following output is displayed:
      OSGi Service Name    Current Ranking ObjectGrid Name MapSet Name Server Name
      -----------------    --------------- --------------- ----------- -----------
      myProtoBufSerializer 1               Grid            MapSet      collocatedServer
      myShardListener      1               Grid            MapSet      collocatedServer
      
      CWXSI0040I: The command osgiCurrent has completed successfully.
  • Query all available rankings for a service.
    Enter the following command to query all of the available service rankings for the service named myShardListener.
    1. Switch to the following directory:
      cd wxs_home/bin
      
    2. Enter the following command to query all available rankings for a service.
      ./xscmd.sh -c osgiAll -sn myShardListener
      The following output is displayed:
      Server: collocatedServer
         OSGi Service Name Available Rankings
         ----------------- ------------------
         myShardListener   1
      
         Summary - All servers have the same service rankings.
      
      CWXSI0040I: The command osgiAll has completed successfully.
      The output is grouped by the server. In this example, only the following server exists: collocatedServer.
  • Query all available service rankings.
    Enter the following command to query all of the available service rankings for all services.
    1. Switch to the following directory:
      cd wxs_home/bin
      
    2. Enter the following command to query all available service rankings.
      ./xscmd.sh -c osgiAll 
      The following output is displayed:
      Server: collocatedServer
         OSGi Service Name    Available Rankings
         -----------------    ------------------
         myProtoBufSerializer 1
         myShardListener      1
      
      Summary - All servers have the same service rankings.
  • Install and start Version 2 of the plug-in bundle.
    In the server OSGi console, install a new bundle that contains a new version of the Order class and the MapSerializerPlugin plug-in. See Lesson 2.4: Install the Google Protocol Buffers and sample plug-in bundles for details about how to install the ProtoBufSamplePlugins-2.0.0.jar bundle.
    1. After the installation, start the new bundle.
      The services for your new bundle are available, but they are not used by the eXtreme Scale server yet. You must run a service update request to use a service with a specific version.
  • Now when you query all the available service rankings again, the service ranking 2 is added in the output.
    1. Switch to the following directory:
      cd wxs_home/bin
      
    2. Enter the following command to query all available service rankings.
      ./xscmd.sh -c osgiAll 
      The following output is displayed:
      Server: collocatedServer
         OSGi Service Name    Available Rankings
         -----------------    ------------------
         myProtoBufSerializer 1, 2
         myShardListener      1, 2
      
      Summary - All servers have the same service rankings.

Lesson checkpoint

In this tutorial, you queried currently specified and all available service rankings. You also displayed the service ranking for a new bundle that you installed and started.