2 Replies Latest reply on Jan 10, 2012 1:01 PM by shawkins

    rewrite query/command before it reaches the teiid planner

    rakeshsagar

      Hi,

       

      This is with reference to the issue: https://issues.jboss.org/browse/TEIID-1326.

       

      I had created an implementation class for the interface MetadataRepository and injected the new object into the VDBRepository in the file

      teiid-deployer-jboss-beans.xml as

       

      <bean name="VDBRepository" class="org.teiid.deployers.VDBRepository">

              <property name="systemFunctionManager"><inject bean="SystemFunctionManager"/></property>

              <property name="metadataRepository"><inject bean="MetadataRepository"/></property>

      </bean>

         

      <bean name="MetadataRepository" class="com.ca.chours.metadata.repository.MetadataRepositoryImpl"/>

       

      With the above changes the methods in the MetadataRepositoryImpl are called only when JBoss starts up and are not called when we execute any view/procedure/an sql containing a table.

       

      According to the issue comments it is said that we need to inject the instance to the RuntimeEngineDeployer.

       

      I tried injecting the instance into RuntimeEngineDeployer in the file teiid-jboss-beans.xml file as

       

      <bean name="RuntimeEngineDeployer" class="org.teiid.jboss.deployers.RuntimeEngineDeployer">

              <property name="MetadataRepository"><inject bean="MetadataRepository"/></property>

       

      but when I start JBoss I get the following error

       

        Deployment "RuntimeEngineDeployer" is in error due to the following reason(s): java.lang.IllegalArgumentException: No such property MetadataRepository for bean org.teiid.jboss.deployers.RuntimeEngineDeployer available [transactions, detectingChangeEvents, queryTimeout, preparedPlanCacheConfig, maxThreads, authorizationValidator, cacheFactory, maxActivePlans, VDBRepository, lobChunkSizeInKB, requests, longRunningRequests, exceptionOnMaxSourceRows, containerLifeCycleListener, eventDistributor, runtimeVersion, adminSocketConfiguration, resultsetCacheConfig, queryThresholdInSecs, odbcSocketConfiguration, maxSourceRows, activeSessionsCount, VDBStatusChecker, maxRowsFetchSize, queryThresholdInMilli, maxODBCLobSizeAllowed, activeSessions, objectReplicatorName, cacheTypes, XATerminator, class, timeSliceInMilli, transactionManager, securityHelper, workerPoolStatistics, authenticationType, useDataRoles, workManager, profileService, userRequestSourceConcurrency, resultSetCacheEnabled, jdbcSocketConfiguration, jndiName, bufferService, sessionService]

       

       

      Please help me in solving this problem. Let me know if I am doing anything wrong here.

       

      Thanks

      Rakesh.

        • 1. Re: rewrite query/command before it reaches the teiid planner
          rareddy

          You do not need

           

          <bean name="RuntimeEngineDeployer" class="org.teiid.jboss.deployers.RuntimeEngineDeployer">

                  <property name="MetadataRepository"><inject bean="MetadataRepository"/></property>

           

          Ramesh..

          • 2. Re: rewrite query/command before it reaches the teiid planner
            shawkins

            Rakesh,

             

            "With the above changes the methods in the MetadataRepositoryImpl are called only when JBoss starts up and are not called when we execute any view/procedure/an sql containing a table."

             

            That is expected.  The initial metadata state is created by merging the vdb metadata with the repository metadata.  View/procedure definitions are cached for performace and alterations are tracked result cache purging.  In the current implementation the MetadataRepository is not polled for changes, rather ddl statements or the EventDistributor.setProcedure/View/InsteadOfTriggerDefinition methods are used to call the appropriate method on the MetadataRepository and update the runtime metadata system, which includes flushing relevant cache entries.

             

            I'm not fully familiar with your setup, but you may be looking for something to act a bulk level, such as refreshing an entire schema from the metadata repository.  We'd have to get a JIRA around that and see what makes sense.

             

            Steve