Infinispan-API之Tree

    这个API疑问这你的数据存储是分级的,就像一棵树。就像JBOSS CACHE一样,高效的存储cache。

1、对于实现tree cache的依赖是infinispan-tree.jar,但是必须注意的是你的

Configuration.setInvocationBatchingEnabled( true );
或者
< invocationBatching enabled = "true" />

2、实现例子是:

Configuration config = new Configuration();
config.setInvocationBatchingEnabled( true );
Cache cache = new DefaultCacheManager(config).getCache();
TreeCache treeCache = TreeCacheFactory.createTreeCache(cache);
3、利用tree Cache操作例子:
treeCache.put("/demo/test","username","张三");
treeCache.put("username","李四");
treeCache.removeNode("/demo/test");
treeCache.getRoot().removeChild("");

 

你可能感兴趣的:(tree)