3 Replies Latest reply on May 16, 2013 8:58 PM by Ramesh Reddy Branched to a new discussion.

    Creating a Custom Metadata Repository to persist costing stats

    Van Halbert Master

      Unable to get the dynamic vdb to load metadata (and hence the VDB is set to FAILED) when the Metadata Repository implementation is specified.  If I comment it out, the vdb deploys ok.


      To just see if I could get the implementation to work, my implementation extended DefaultMetadataRepository.   I added the 4 "stat" related methods, but they all call super.   Packaged up the module, which does contain the META-INF/services/org.teiid.metadata.MetadataRepository that contains org.jboss.teiid.costing.example.DatabasePersistedCostingRepository.


      I have 1 dynamic vdb (Portfolio)  that defines the model as follows:



       <model name="Accounts">
                JDBC Import settings 
                importer.useFullSchemaName directs the importer to drop the source 
                schema from the Teiid object name, so that the Teiid fully qualified name
                will be in the form of <model name>.<table name>
              <property name="importer.useFullSchemaName" value="false"/>
                  This connector is defined to reference the H2 localDS" 
              <source name="h2-connector" translator-name="translator-h2" connection-jndi-name="java:/accounts-ds"/>


      I have another dynamic, which is the one that defines the module, that looks like this:



          <import-vdb name="Portfolio" version="1" import-data-policies="false"/> 
          <model name="Accounts_with_costing" type="PHYSICAL">
              <source name="accountsWithCosting" translator-name="h2" connection-jndi-name="java:/accounts-ds"/>
              <metadata type="org.jboss.teiid.costing.example"></metadata>


      However, this produces this WARNing:



      14:11:17,207 INFO  [org.teiid.RUNTIME] (teiid-async-threads - 3) TEIID50030 VDB CostingStats.1 model "Accounts_with_costing" metadata loaded. End Time: 5/16/13 2:11 PM
      14:11:17,210 WARN  [org.teiid.PLANNER.RESOLVER] (teiid-async-threads - 3) TEIID31070 Empty model;There are no tables, procedures or functions defined in this model Accounts_with_costing
      14:11:17,210 INFO  [org.teiid.RUNTIME] (teiid-async-threads - 3) TEIID40073 The metadata for the VDB CostingStats.1 is loaded, however it is not valid. Check models for errors. Correct the metadata and re-deploy.
      14:11:17,210 INFO  [org.teiid.RUNTIME] (teiid-async-threads - 3) TEIID40003 VDB CostingStats.1 is set to FAILED



      Not sure why, when extending the DefaultMetadataRepository, that the metadata wouldn't load when no methods are being overridden.  Is this the wrong MetadataRepository implementation to extend?  Or maybe should asked it this way, what is the MetadataRepository implementation to extend such that the loading of metadata logic can be reused?