Class GeodeUtils
java.lang.Object
org.apache.calcite.adapter.geode.util.GeodeUtils
Utilities for the Geode adapter.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RelDataType
autodetectRelTypeFromRegion
(org.apache.geode.cache.Region<?, ?> region) Extract the first entity of each Regions and use it to build a table types.static void
static @Nullable Object
convertToRowValues
(List<RelDataTypeField> relDataTypeFields, Object geodeResultObject) Converts a Geode object into a Row tuple.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.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.
-
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 addresslocatorPort
- Locator's portautoSerializerPackagePath
- 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 serverregionName
- Name of the region to create proxy for.- Returns:
- Returns a Region proxy to a remote (on the Server) regions.
-
convertToRowValues
public static @Nullable Object convertToRowValues(List<RelDataTypeField> relDataTypeFields, Object geodeResultObject) Converts a Geode object into a Row tuple.- Parameters:
relDataTypeFields
- Table relation typesgeodeResultObject
- Object value returned by Geode query- Returns:
- List of objects values corresponding to the relDataTypeFields
-
autodetectRelTypeFromRegion
Extract the first entity of each Regions and use it to build a table types.- Parameters:
region
- existing region- Returns:
- derived data type.
-