Package org.pentaho.di.core
Class DBCache
- java.lang.Object
-
- org.pentaho.di.core.DBCache
-
public class DBCache extends Object
This class caches database queries so that the same query doesn't get called twice. Queries are often launched to the databases to get information on tables etc.- Since:
- 15-01-04
- Author:
- Matt
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear(String dbname)
Clear out all entries of database with a certain nameRowMetaInterface
get(DBCacheEntry entry)
Get the fields as a row generated by a database cache entrystatic String
getFilename()
static DBCache
getInstance()
Create the database cache instance by loading it from diskboolean
isActive()
void
put(DBCacheEntry entry, RowMetaInterface fields)
void
saveCache()
void
setActive()
void
setActive(boolean act)
void
setInactive()
int
size()
-
-
-
Method Detail
-
setActive
public void setActive()
-
setInactive
public void setInactive()
-
setActive
public void setActive(boolean act)
-
isActive
public boolean isActive()
-
put
public void put(DBCacheEntry entry, RowMetaInterface fields)
-
get
public RowMetaInterface get(DBCacheEntry entry)
Get the fields as a row generated by a database cache entry- Parameters:
entry
- the entry to look for- Returns:
- the fields as a row generated by a database cache entry
-
size
public int size()
-
clear
public void clear(String dbname)
Clear out all entries of database with a certain name- Parameters:
dbname
- The name of the database for which we want to clear the cache or null if we want to clear it all.
-
getFilename
public static String getFilename()
-
saveCache
public void saveCache() throws KettleFileException
- Throws:
KettleFileException
-
getInstance
public static DBCache getInstance()
Create the database cache instance by loading it from disk- Returns:
- the database cache instance.
-
-