当前位置: 首页>>代码示例>>Java>>正文


Java CacheControl.CellRegion方法代码示例

本文整理汇总了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());
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:25,代码来源:BatchTestCase.java

示例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;
        }
    }
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:26,代码来源:BatchTestCase.java

示例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();
}
 
开发者ID:OSBI,项目名称:mondrian,代码行数:9,代码来源:BatchTestCase.java

示例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);
}
 
开发者ID:Twixer,项目名称:mondrian-3.1.5,代码行数:18,代码来源:CacheHitTest.java


注:本文中的mondrian.olap.CacheControl.CellRegion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。