繁体   English   中英

是否可以索引一个简单的 infinispan 缓存?

[英]Is it possible to index a simple infinispan cache?

我想索引我的缓存,以便对缓存中的搜索有更好的响应时间。

这里我是如何实现 infinispan 缓存的:

 private Cache createCache(String cacheName) {
    try {
        final Configuration configuration = new ConfigurationBuilder()
            .indexing()
            .addIndexedEntity(MyEntity.class)
            .simpleCache(true)
            .statistics().enable()

            .build();
        cacheManager.defineConfiguration(cacheName, configuration);
    }catch (RuntimeException ex){

    }
    return cacheManager.getCache(cacheName);
}

但我得到了他以下例外:

ISPN000436:已请求缓存“MyCache”,但不存在匹配的缓存配置

关于错误原因的任何想法?

简单缓存无法启用索引。 请参阅: https ://infinispan.org/docs/stable/titles/configuring/configuring.html#simple-caches_caches

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM