use of com.hazelcast.config.MapIndexConfig in project hazelcast by hazelcast.
the class QueryCacheConfigBuilderHelper method queryCacheIndexesHandle.
private void queryCacheIndexesHandle(Node n, QueryCacheConfig queryCacheConfig) {
for (Node indexNode : childElements(n)) {
if ("index".equals(cleanNodeName(indexNode))) {
final NamedNodeMap attrs = indexNode.getAttributes();
boolean ordered = getBooleanValue(getTextContent(attrs.getNamedItem("ordered")));
String attribute = getTextContent(indexNode);
queryCacheConfig.addIndexConfig(new MapIndexConfig(attribute, ordered));
}
}
}
use of com.hazelcast.config.MapIndexConfig in project hazelcast by hazelcast.
the class XmlClientConfigBuilderTest method testQueryCacheFullConfig.
@Test
public void testQueryCacheFullConfig() throws Exception {
QueryCacheConfig queryCacheConfig = clientConfig.getQueryCacheConfigs().get("map-name").get("query-cache-name");
EntryListenerConfig entryListenerConfig = queryCacheConfig.getEntryListenerConfigs().get(0);
assertEquals("query-cache-name", queryCacheConfig.getName());
assertTrue(entryListenerConfig.isIncludeValue());
assertFalse(entryListenerConfig.isLocal());
assertEquals("com.hazelcast.examples.EntryListener", entryListenerConfig.getClassName());
assertTrue(queryCacheConfig.isIncludeValue());
assertEquals(1, queryCacheConfig.getBatchSize());
assertEquals(16, queryCacheConfig.getBufferSize());
assertEquals(0, queryCacheConfig.getDelaySeconds());
assertEquals(EvictionPolicy.LRU, queryCacheConfig.getEvictionConfig().getEvictionPolicy());
assertEquals(EvictionConfig.MaxSizePolicy.ENTRY_COUNT, queryCacheConfig.getEvictionConfig().getMaximumSizePolicy());
assertEquals(10000, queryCacheConfig.getEvictionConfig().getSize());
assertEquals(InMemoryFormat.BINARY, queryCacheConfig.getInMemoryFormat());
assertFalse(queryCacheConfig.isCoalesce());
assertTrue(queryCacheConfig.isPopulate());
for (MapIndexConfig mapIndexConfig : queryCacheConfig.getIndexConfigs()) {
assertEquals("name", mapIndexConfig.getAttribute());
assertFalse(mapIndexConfig.isOrdered());
}
assertEquals("com.hazelcast.examples.ExamplePredicate", queryCacheConfig.getPredicateConfig().getClassName());
}
Aggregations