WarmPool (Warm a SAM pool)

One way to reduce the amount of time it takes to retrieve results from the 1010data Insights Platform is to "warm" the SAM pool by logging in IDs ahead of time.

The WarmPool function logs in available SAM pool user IDs. Additionally, when warming the pool you can provide queries to run on the IDs when they are logged in. This can speed the retrieval of results for users.

The WarmPool function takes the following parameters:
  • URI for the 1010data connection (uri)
  • Group owner name (owner)
  • The group to be warmed (groupname)
  • Group owner password (password)
  • An optional array of Query objects, which will each be run in all the warmed sessions (queries). The default value is null.
WarmPool(uri, owner, groupname, password, queries=null)

WarmPool returns the number of users warmed.

You can run WarmPool without logging in or from a session that is logged in, in which case, you will not have to re-input your information (gateway, owner, group, and password) again.

The used IDs should be released at the end of their activity with the platform. When they are released, they are not warmed automatically.

The example below uses WarmPool to warm the SAM pool and Query to provide a query:


using System;
using System.Linq;
using TenTenSDK;

public class DocumentationExample
{
  public static void PrintTable(Session testSession, String path) {
    Query xmplQuery = new Query(path,"");
    using (Table resultTable = testSession.RunQuery(xmplQuery)) {
      Console.WriteLine(String.Join("\t",
      resultTable.Columns.Select(c => c.Info.ComponentType)));
    }
  }
  public static void Main() {
    Uri gateway = new Uri("https://www2.1010data.com/prod-latest/gw");
    String owner = "USERNAME";
    String pwd = "PASSWORD";
    String group = "GROUP";
    String path = "pub.demo.weather.stations";
    Session session=null;

    var qqs = new Query[2];

    qqs[0] = new Query("pub.demo.weather.stations",
                        "<sel value=\"elev&lt;100\"/>");
    qqs[1] = new Query("pub.demo.weather.conditions", "woop");
    try
    {
      int i =  Session.WarmPool(gateway, owner, group, pwd, qqs);
      Console.WriteLine("Back now");
        Console.WriteLine("Got {0}",i);
    }
    catch (TenTenSDK.Exceptions.TenTenException e)
    {
        Console.WriteLine("Exception caught: {0}", e);
    }
    Console.WriteLine("Done now, hit enter.");
    String q9 = Console.ReadLine();
  }
}
Note: USERNAME, GROUP, and PASSWORD are placeholders for valid Insights Platform group owner name. group name, and password.`