7 Replies Latest reply on Mar 10, 2014 1:09 PM by shawkins

    How to use deployVDBZip method in teiid embedded server

    capoorhimanshu

      Hi ,

       

      I was looking into some of the ways of deploying VDB in teiid embedded and came across some questions , looking forward for help

       

      They are :

       

      • I am not able to get how deployVDBZip works in teiid embedded server. If say i create a ABC.vdb from a teiid designer and passes this as URL in method , will it be able to load and deploy this VDB along with all the dependencies like models (mentioned in *xmi files) along with data sources.I can see some of the index files in this ABC.vdb what are they ?
      • Is there is any way to persist the VDBRepository of embedded server , so that next time i up the server i have all the existing VDBs deployed.

       

      Thanks

      Himanshu Kapoor

        • 1. Re: How to use deployVDBZip method in teiid embedded server
          rareddy

          Himanshu,

           

          1) Yes, using the deployVDBZip, you can load a Designer based VDB. Teiid engine loads the .INDEX files, not the XMI files. XMI files are there for as source representation of the XMI files. Yes, it loads all the models, not the data sources backing those models. You have to provide the data sources by using "addConnectionFactory" method, based on what data source names you configured your VDB with.

           

          2) Yes, you can persist the VDBRespository in your environment. The question is does Teiid provide any framework in "embedded" mode to do this? No, Teiid does not, nor have any intentions. This is a embedded server, and Teiid does not put any restrictions on where this can be embedded and it may or may not have a file system available etc. Any such code needs to be developed by the integrator. The typical example of people using the embedded, only deploy a specialized versions of the VDB(s) and should know how to utilize them. However, if you trying to develop a general purpose server, then these are some of the tasks you would need to develop. The other choice is to use a fully functional Teiid server using JBoss AS.

           

          HTH

           

          Ramesh..

          • 2. Re: How to use deployVDBZip method in teiid embedded server
            shawkins

            Himanshu/Ramesh,

             

            We currently do not ship embedded with the ability to read .INDEX files.  The index metadata JAR is not in the kit.  Now that we have added zip based deployment we could allow this and it would require only a couple of modifications.

             

            Steve

            • 4. Re: How to use deployVDBZip method in teiid embedded server
              capoorhimanshu

              Hi Steve/Ramesh

               

              Yes i debugged the deployVDBZip method and found that it created all the resources like resource for vdb.xml , *.xmi as well as for *.index but when these resource got passed to the loadmetadata method of meta data repository, they were not used . Instead of using then it again made a call to the loadmetadata method of the execution factory to load the meta data where as i was thinking that in this case meta data will be built from the *.xmi or from index files.


              what i was assuming is that out of the three methods provided for deploying vdb

               

              deployVDB(String name, ModelMetaData... models)

              This method will build the models from the model list and meta data will be loaded by making a connection to the underneath data source , fetching the meta data at the time of deployment and then loading it in metadata factory associated with metadata repository of the model . Works as expected

               

              deployVDB(InputStream is)

              This method will read the vdb.xml and load the model as well as meta data as mentioned in the above method . Works as expected

               

              deployVDBZip(URL url)

              in this method i was assuming that , there will be no connection made to underneath data source in order to fetch the meta data and then meta data will be built fromthe resources packed in vdb files . Do not works as expected .

               

              Please let me know my understanding is right or not .

               

              Thanks

              Himanshu Kapoor

              • 5. Re: How to use deployVDBZip method in teiid embedded server
                shawkins

                > deployVDBZip(URL url)

                > in this method i was assuming that , there will be no connection made to underneath data source in order to fetch the meta data and then meta data will be built fromthe resources packed in vdb files . Do not works as expected .


                There is no restriction on where the metadata can be - in the vdb.xml, fetched from sources, or in the zip as a ddl file.  Can you elaborate on what didn't work?

                • 6. Re: How to use deployVDBZip method in teiid embedded server
                  capoorhimanshu

                  Hi Steve ,

                   

                  I created a simple JDBC source model from teiid designer and created a vdb on top of it.

                  Now i tried to deploy this *.vdb file using  deployVDBZip(URL url) of the embedded server.

                   

                  First i added the same jndi connection factory in the embedded server  i.e. the one i used in teiid designer , after that i passed the vdb as a url in deployVDBZip method for e.g. say FILE file = "C\MyVDB.vdb";  embeddedServer.deployVDBZip(file.toURI().toURL()) ;

                  in this i assumed that meta data will be loaded from the zip file i.e. all the meta data stored in index or zip files  , where as it again went to the execution factory to load the meta data by fetching all the schema information from JDBC catalog.

                  My understanding here is ,  if it has to fetch the metadata from the the database then why complete mete data information has been stored in *.vdb file.  Please let me know whether my understanding is right or not.

                   

                  Thanks

                  Himanshu Kapoor

                  • 7. Re: How to use deployVDBZip method in teiid embedded server
                    shawkins

                    > Please let me know whether my understanding is right or not.

                     

                    No deployVDBZip is not for Designer based vdbs.  Ramesh added TEIID-2888 as an enhancement, but the intent was originally not to support desinger vdbs but rather just to allow for better management of DDL and vdb resources.  An embedded deployment zip would typically look something like:

                     

                    / - zip root

                    /META-INF/vdb.xml - main definition file

                    /schema1.ddl

                    /schema2.ddl

                    ...

                     

                    Where the vdb.xml references the schema files using the DDL-FILE metadata type - as shown in Custom Metadata Repository - Teiid 8.7 (draft) - Project Documentation Editor

                     

                    But there is no restriction on the vdb.xml when used in a zip.  It can still contain inline metadata or load from sources.  We probably need to expand on this in the embedded guide.

                     

                    Steve