Package org.pentaho.di.base
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 Summary
Modifier and TypeMethodDescriptionvoid
void
getCachedJobMeta
(String key) getCachedTransMeta
(String key) 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.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.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.void
logCacheSummary
(org.pentaho.di.core.logging.LogChannelInterface logger) static void
setCacheInstance
(JobMeta jobMeta, IMetaFileCache cache) static void
setCacheInstance
(TransMeta transMeta, IMetaFileCache cache)
-
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 callingsetCacheInstance(org.pentaho.di.job.JobMeta, org.pentaho.di.base.IMetaFileCache)
after the Meta has been created. ThereAfter the cache can be referenced throughAbstractMeta.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 callingsetCacheInstance(org.pentaho.di.job.JobMeta, org.pentaho.di.base.IMetaFileCache)
after the Meta has been created. ThereAfter the cache can be referenced throughAbstractMeta.getMetaFileCache()
- Parameters:
parentTrans
- The parent job, or null if none.- Returns:
- the IMetaFileCache in play
-
setCacheInstance
-
setCacheInstance
-
getCachedJobMeta
-
getCachedTransMeta
-
cacheMeta
-
cacheMeta
-
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 theObjectLocationSpecificationMethod
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.
-