本文整理汇总了Java中mondrian.olap.CacheControl.CellRegion方法的典型用法代码示例。如果您正苦于以下问题:Java CacheControl.CellRegion方法的具体用法?Java CacheControl.CellRegion怎么用?Java CacheControl.CellRegion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mondrian.olap.CacheControl
的用法示例。
在下文中一共展示了CacheControl.CellRegion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: clearCache
import mondrian.olap.CacheControl; //导入方法依赖的package包/类
private void clearCache(RolapCube cube) {
// Clear the cache for the Sales cube, so the query runs as if
// for the first time. (TODO: Cleaner way to do this.)
final Cube salesCube =
getConnection().getSchema().lookupCube("Sales", true);
RolapHierarchy hierarchy =
(RolapHierarchy) salesCube.lookupHierarchy(
new Id.NameSegment("Store", Id.Quoting.UNQUOTED),
false);
SmartMemberReader memberReader =
(SmartMemberReader) hierarchy.getMemberReader();
MemberCacheHelper cacheHelper = memberReader.cacheHelper;
cacheHelper.mapLevelToMembers.cache.clear();
cacheHelper.mapMemberToChildren.cache.clear();
// Flush the cache, to ensure that the query gets executed.
cube.clearCachedAggregations(true);
CacheControl cacheControl = getConnection().getCacheControl(null);
final CacheControl.CellRegion measuresRegion =
cacheControl.createMeasuresRegion(cube);
cacheControl.flush(measuresRegion);
waitForFlush(cacheControl, measuresRegion, cube.getName());
}
示例2: waitForFlush
import mondrian.olap.CacheControl; //导入方法依赖的package包/类
private void waitForFlush(
final CacheControl cacheControl,
final CacheControl.CellRegion measuresRegion,
final String cubeName)
{
int i = 100;
while (true) {
try {
Thread.sleep(i);
} catch (InterruptedException e) {
fail(e.getMessage());
}
String cacheState = getCacheState(cacheControl, measuresRegion);
if (regionIsEmpty(cacheState, cubeName)) {
break;
}
i *= 2;
if (i > 6400) {
fail(
"Cache didn't flush in sufficient time\nCache Was: \n"
+ cacheState);
break;
}
}
}
示例3: getCacheState
import mondrian.olap.CacheControl; //导入方法依赖的package包/类
private String getCacheState(
final CacheControl cacheControl,
final CacheControl.CellRegion measuresRegion)
{
StringWriter out = new StringWriter();
cacheControl.printCacheState(new PrintWriter(out), measuresRegion);
return out.toString();
}
示例4: clearCache
import mondrian.olap.CacheControl; //导入方法依赖的package包/类
/**
* Clears aggregation cache
*
* @param cube
*/
public void clearCache(String cube) {
final TestContext testContext = getTestContext();
final CacheControl cacheControl =
testContext.getConnection().getCacheControl(null);
// Flush the entire cache.
final Connection connection = testContext.getConnection();
final Cube salesCube = connection.getSchema().lookupCube(cube, true);
final CacheControl.CellRegion measuresRegion =
cacheControl.createMeasuresRegion(salesCube);
cacheControl.flush(measuresRegion);
}