- Summary:
Add report design-time cache support per chart request.
- Bugzilla Bug (s) Resolved:
N/A
- Description:
Now DtE supports the design-time cache feature, which is mainly used in design
time. In design time, although user needs to use the data of data set, sometimes
user does not care whether the data is latest or not and then it will be
unnecessary to retrieve the latest data from data set because it will be very
expensive. Therefore, user has option to choose whether using a cache to store
the data into local environment and then these data can be used in later without
additional cost to get data again. If user has such a requirement, user can set
this cache preference option in data set editor page to specify three possible
values.
1: Don’t cache, which means data will be retrieved every time
when data will be used
2: Cache Entire data set, which means all data will be retrieved from
data set and cached
3: Cache the rows with a specified count, which means the rows of
specified count will be cached.
There are several points which need to be noticed,
For User,
1: Cache data will be only valid when eclipse is running, when eclipse restarts,
all cache data will be invalid and will be retrieved again.
For developer,
1: This feature is currently supported in DtE, which does not mean this
feature will be used automatically in Designer GUI or Chart. These team needs
to change their code to support this feature in their side
2: As for how to change your code to use this feature, please see this
method org.eclipse.birt.data.engine.api.DataEngine. prepare( IQueryDefinition querySpec,
Map appContext ). What you need to do is to add an option of using cache to a
map and pass it as the parameter of appContext. An example is below,
Map appContextMap
= new HashMap();
appContextMap.put(DataEngine.DATASET_CACHE_OPTION,
“true”);
dataEngine.prepare(querySpec,
appContextMap);
- Tests Description:
Junit test
- Files Added:
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/DataSetCacheManager.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor2/DataSourceQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor2/OdaCacheResultSet.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor2/CandidateQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor2/DataSource2.java
/org.eclipse.birt.data/test/org/eclipse/birt/data/engine/api/OdaCacheTest.java
- Files Edited:
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/DataEngine.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/IBaseDataSetDesign.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/querydefn/BaseDataSetDesign.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/DataEngineImpl.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/DataSetRuntime.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/PreparedQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/PreparedExtendedDSQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/PreparedScriptDSQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/PreparedSubquery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/odi/IDataSourceFactory.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/odi/IDataSource.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/odi/IDataSourceQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/odi/IPreparedDSQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/DataSourceFactory.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/DataSource.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/DataSourceQuery.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/CachedResultSet.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/cache/SmartCache.java
/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/cache/OdiAdapter.java
//----Engine part
/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/adapter/ModelDteApiAdapter.java
//----UI part
/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/CachePreferencePage.java
- Files Deleted:
- Notes to Build Team:
N/A
- Notes to Developers:
N/A
- Notes to QA:
N/A
- Notes to Documentation:
N/A