Interface IMetaFileCache

All Known Implementing Classes:
MetaFileCacheImpl

public interface IMetaFileCache
This cache lives for the runtime of the parent Job or Trans. It is used to cache the JobMeta or TransMeta of any kjb or ktr that it needs to load to the course of the main job/trans execution. The intent here is to minimize the overhead of loading and parsing the jobs/transformations into their associated metas. Loading a ktr/kjb will require a call to the server if attached. If that kjb/ktr is called multiple times during the run, then each execution will again make the call to get the meta. This cache eliminates the need to repetitively load the kjb/ktr.
  • Method Details

    • initialize

      static IMetaFileCache initialize(Job parentJob, org.pentaho.di.core.logging.LogChannelInterface logger)
      Each new job/transformation should call this method once to get the instance of the cache for the currently running job. This instance should then be passed to the new job's/transformation's meta by calling setCacheInstance(org.pentaho.di.job.JobMeta, org.pentaho.di.base.IMetaFileCache) after the Meta has been created. ThereAfter the cache can be referenced through AbstractMeta.getMetaFileCache()
      Parameters:
      parentJob - The parent job, or null if none.
      Returns:
      the IMetaFileCache in play
    • initialize

      static IMetaFileCache initialize(Trans parentTrans, org.pentaho.di.core.logging.LogChannelInterface logger)
      Each new transformation should call this method once to get the instance of the cache for the currently running parent transformation/job. This instance should then be passed to the new job's/transformation's meta by calling setCacheInstance(org.pentaho.di.job.JobMeta, org.pentaho.di.base.IMetaFileCache) after the Meta has been created. ThereAfter the cache can be referenced through AbstractMeta.getMetaFileCache()
      Parameters:
      parentTrans - The parent job, or null if none.
      Returns:
      the IMetaFileCache in play
    • setCacheInstance

      static void setCacheInstance(JobMeta jobMeta, IMetaFileCache cache)
    • setCacheInstance

      static void setCacheInstance(TransMeta transMeta, IMetaFileCache cache)
    • getCachedJobMeta

      JobMeta getCachedJobMeta(String key)
    • getCachedTransMeta

      TransMeta getCachedTransMeta(String key)
    • cacheMeta

      void cacheMeta(String key, JobMeta meta)
    • cacheMeta

      void cacheMeta(String key, TransMeta meta)
    • logCacheSummary

      void logCacheSummary(org.pentaho.di.core.logging.LogChannelInterface logger)
    • getKey

      default String getKey(org.pentaho.di.core.ObjectLocationSpecificationMethod specificationMethod, String realFilenameOrId)
      Keys to the cache should always be generated using a method provided by this interface. This ensures that keys will remain unique across different nameSpace catagories.
      Parameters:
      specificationMethod - Defines different sources for the Meta defined by the ObjectLocationSpecificationMethod enum.
      realFilenameOrId - Contains the full file path or jackrabbit Id for the node
      Returns:
      The key to use to load or save an item to the cache.