h1. {*}Infinispan DSL Translator{*} |
The Infinispan DSL Translator, known by the type {*}infinispan-cache-dsl{*}, can read the java objects from a remote Infinispan Cache via the Hot Rod client using the Google Protobuf for serialization. The objects will be reversed into a relational model, which can then be joined with other integrated data sources. The benefit of this JDG design is it will enable Teiid to query the cache using DSL, which is similar to doing Lucene searching on a local cache. |
*Properties* |
... |
h2. {*}Usage{*} |
* Retrieve objects from a cache and transform into rows and columns. |
* Perform writes to the cache h2. {*}Metadata{*} h5. Definition Requirements |
* Each google registered class in the cache will have a corresponding table created. * The table for the root class, must have a primary key defined, which must map to an attribute in the class. |
... |
This is because this maps to to google protobuf definition and what is expected to be used in the DSL query. |
h5. Options for Defining |
|
Note that by just using a dynamic vdb, the metadata import logic will provide you with the physical table(s) that can be queried. An example is shown here for demonstration purposes. This also shows a container class, PhoneNumber, as an example of the foreign key that's defines the relationship. |
There are several options to defining the metadata representing your object in the cache. * Use dynamic VDB that only defines the data source to use. Example: |
{code:xml} |
<model name="People" type="Physical"> <property name="importer.useFullSchemaName" value="false"/> <source name="infinispan-cache-dsl-connector" translator-name="infinispan-cache-dsl" connection-jndi-name="java:/infinispanRemoteDSL" /> </model> {code} The metadata will be resolved by reverse engineering the defined object in the cache. This can be useful when using the Teiid Designer Teiid Connection Importer for building the physical source model(s). * Use dynamic VDB, but you define the metadata using DDL. Note, this also shows a container class, PhoneNumber, as an example of the foreign key that's defines the relationship. {code:xml} |
<vdb name="PeopleVDB" version="1"> <model name="People" visible="true"> |
... |
{code} |
* Use Teiid Designer to manually create the physical source model based on your object cache using the above *Usage* patterns. |
h2. {*}JCA Resource Adapter{*} |
... |
The Infinispan DSL Translator, known by the type infinispan-cache-dsl, can read the java objects from a remote Infinispan Cache via the Hot Rod client using the Google Protobuf for serialization. The benefit of this JDG design is it will enable Teiid to query the cache using DSL, which is similar to doing Lucene searching on a local cache.
Properties
The Infinispan DSL Translator currently has no import or execution properties. See the JCA resource adapter section below as to how to configure the cache to be queried.
The following are the connector capabilities:
Limitations:
To be done:
There are several options to defining the metadata representing your object in the cache.
<model name="People" type="Physical"> <property name="importer.useFullSchemaName" value="false"/> <source name="infinispan-cache-dsl-connector" translator-name="infinispan-cache-dsl" connection-jndi-name="java:/infinispanRemoteDSL" /> </model>
The metadata will be resolved by reverse engineering the defined object in the cache. This can be useful when using the Teiid Designer Teiid Connection Importer for building the physical source model(s).
Note, this also shows a container class, PhoneNumber, as an example of the foreign key that's defines the relationship.
<vdb name="PeopleVDB" version="1"> <model name="People" visible="true"> <property name="importer.useFullSchemaName" value="false"/> <source name="infinispan-cache-dsl-connector" translator-name="infinispan-cache-dsl" connection-jndi-name="java:/infinispanRemote" /> <metadata type="DDL"><![CDATA[ CREATE FOREIGN TABLE Person ( PersonObject object OPTIONS (NAMEINSOURCE 'this', UPDATABLE FALSE, SEARCHABLE 'Unsearchable', NATIVE_TYPE 'java.lang.Object'), id integer NOT NULL OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'int'), name string OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'java.lang.String'), email string OPTIONS (SEARCHABLE 'Searchable', NATIVE_TYPE 'java.lang.String'), CONSTRAINT PK_ID PRIMARY KEY(id) ) OPTIONS (NAMEINSOURCE 'PersonsCache', UPDATABLE TRUE); CREATE FOREIGN TABLE PhoneNumber ( number string OPTIONS (NAMEINSOURCE 'phone.number', SEARCHABLE 'Searchable', NATIVE_TYPE 'java.lang.String'), type string OPTIONS (NAMEINSOURCE 'phone.type', SEARCHABLE 'Searchable', NATIVE_TYPE 'java.lang.String'), id integer NOT NULL OPTIONS (SELECTABLE FALSE, UPDATABLE FALSE, SEARCHABLE 'Searchable', NATIVE_TYPE 'int'), CONSTRAINT FK_PERSON FOREIGN KEY(id) REFERENCES Person (id) OPTIONS (NAMEINSOURCE 'phones') ) OPTIONS (NAMEINSOURCE 'PersonsCache', UPDATABLE TRUE); ]]> </metadata> </model> </vdb>
See the Infinispan-DSL resource adapter for this translator. It can be configured to lookup the cache container via JNDI, server list, or hot rod properties..