4 Replies Latest reply on Apr 7, 2016 11:44 AM by rareddy

    Can the metadata of a model be dynamically updated?

    simon.evenepoel

      Hi

       

      A colleague of mine and I are trying to write a resource-adapter / translator pair for our Neo4j database. We noticed that the loadMetadata method of the MetadataRepository and consequently the process method of the MetadataProcessor method are only called once: at the time the VDB containing our model is deployed. However, we want our metadata to be dynamic so that (after the VDB has already been deployed)

       

      • when nodes are inserted in our Neo4j DB with new labels these become available in new tables (one per label)
      • when new properties are inserted in our Neo4j nodes these become available as new columns

       

      Is this possible in Teiid? If so, could you direct us where to look?

       

      Kind regards

       

      Simon

        • 1. Re: Can the metadata of a model be dynamically updated?
          rareddy

          Simon,

           

          Currently that is not possible, the metadata is resolved during the deploy time, after that only few basic changes to metadata are allowed. We have captured the issue here [TEIID-2578] add/remove schema elements - JBoss Issue Tracker

           

          There few issues involved in this, when a view layer is built on source layers,

          - changes in source layer metadata can change/invalidate the view layer thus leaving the vdb in invalid state

          - Any caching based on previous state will be invalid, as it might have changed

          - All the metadata needs to re-resolved again to make sure it validates.

          - currently persistent store for metadata does not exist, but this can be solved

           

          most above akin to stage of reloading the VDB, so we provided a "restart-vdb" of particular model in VDB, which can be invoked using the admin method that will fetch new metadata from source models. Or there are add,remove,update methods for models which you can use too. BTW, this only applies to Dynamic VDBs. So in away you can write scheduler script which can update the vdb to simulate the effect. However, if you are looking for issuing the direct DDL ALTER/CREATE/DROP statements against VDB those are not available currently.

           

          Obviously this is of great interest for us in developing such a solution, but we have not had a strong community drive on this feature. I am not sure if your usecase involves view layer, but that may be one option to start with source layer updates in a vdb without view layers.

           

          I am also excited about your Neo4J translator/connector, would love to see that as a contribution to community.

           

          Let us know how we can help.

           

          Thanks

           

          Ramesh..

           

          • 2. Re: Can the metadata of a model be dynamically updated?
            simon.evenepoel

            Thanks for the information!

            • 3. Re: Can the metadata of a model be dynamically updated?
              simon.evenepoel

              Btw, as soon as our translator / connector becomes useful and my management decides that it can be shared I'll keep you updated!

              • 4. Re: Can the metadata of a model be dynamically updated?
                rareddy

                Thanks Simon. When code is contributed back, we can keep it updated with any API changes and also potentially other community members benefit form it, and also provide extensions.