Class GeodeUtils

java.lang.Object
org.apache.calcite.adapter.geode.util.GeodeUtils

public class GeodeUtils extends Object
Utilities for the Geode adapter.
  • Field Details

    • LOGGER

      protected static final org.slf4j.Logger LOGGER
  • Method Details

    • createClientCache

      public static org.apache.geode.cache.client.ClientCache createClientCache(String locatorHost, int locatorPort, String autoSerializerPackagePath, boolean readSerialized)
      Creates a Geode client instance connected to locator and configured to support PDX instances.

      If an old instance exists, it will be destroyed and re-created.

      Parameters:
      locatorHost - Locator's host address
      locatorPort - Locator's port
      autoSerializerPackagePath - package name of the Domain classes loaded in the regions
      Returns:
      Returns a Geode ClientCache instance connected to Geode cluster
    • closeClientCache

      public static void closeClientCache()
    • createRegion

      public static org.apache.geode.cache.Region createRegion(org.apache.geode.cache.GemFireCache cache, String regionName)
      Obtains a proxy pointing to an existing Region on the server.
      Parameters:
      cache - GemFireCache instance to interact with the Geode server
      regionName - Name of the region to create proxy for.
      Returns:
      Returns a Region proxy to a remote (on the Server) regions.
    • convertToRowValues

      public static Object convertToRowValues(List<RelDataTypeField> relDataTypeFields, Object geodeResultObject)
      Converts a Geode object into a Row tuple.
      Parameters:
      relDataTypeFields - Table relation types
      geodeResultObject - Object value returned by Geode query
      Returns:
      List of objects values corresponding to the relDataTypeFields
    • autodetectRelTypeFromRegion

      public static RelDataType autodetectRelTypeFromRegion(org.apache.geode.cache.Region<?,?> region)
      Extract the first entity of each Regions and use it to build a table types.
      Parameters:
      region - existing region
      Returns:
      derived data type.