use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method mapIndexesHandle.
protected void mapIndexesHandle(Node n, MapConfig mapConfig) {
for (Node indexNode : childElements(n)) {
if (matches("index", cleanNodeName(indexNode))) {
IndexConfig indexConfig = IndexUtils.getIndexConfigFromXml(indexNode, domLevel3, strict);
mapConfig.addIndexConfig(indexConfig);
}
}
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method queryCacheIndexesHandle.
protected void queryCacheIndexesHandle(Node n, QueryCacheConfig queryCacheConfig) {
for (Node indexNode : childElements(n)) {
if (matches("index", cleanNodeName(indexNode))) {
IndexConfig indexConfig = IndexUtils.getIndexConfigFromXml(indexNode, domLevel3, strict);
queryCacheConfig.addIndexConfig(indexConfig);
}
}
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class QueryIndexMigrationTest method newConfigWithIndex.
private Config newConfigWithIndex(String mapName, String attribute) {
Config config = getTestConfig();
config.setProperty(ClusterProperty.WAIT_SECONDS_BEFORE_JOIN.getName(), "0");
config.getMapConfig(mapName).addIndexConfig(new IndexConfig(IndexType.HASH, attribute));
return config;
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class QueryBasicTest method testQueryPortableObjectWithIndexAndAlwaysCacheValues.
@Test
public void testQueryPortableObjectWithIndexAndAlwaysCacheValues() {
String name = randomMapName();
Config config = getConfig();
config.addMapConfig(new MapConfig(name).setCacheDeserializedValues(CacheDeserializedValues.ALWAYS).addIndexConfig(new IndexConfig(IndexType.SORTED, "timestamp")));
testQueryUsingPortableObject(config, name);
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class QueryBasicTest method testOptionalOrderedIndexQuerying.
@Test
public void testOptionalOrderedIndexQuerying() {
String name = randomMapName();
Config config = smallInstanceConfig();
config.getMapConfig(name).addIndexConfig(new IndexConfig(IndexType.SORTED, "attribute"));
HazelcastInstance instance = createHazelcastInstance(config);
IMap<Integer, ObjectWithOptional<Integer>> map = instance.getMap(name);
for (int i = 0; i < 10; ++i) {
map.put(i, new ObjectWithOptional<>(i % 2 == 0 ? i : null));
}
Set<Integer> result = map.keySet(Predicates.equal("attribute", null));
assertEqualSets(result, 1, 3, 5, 7, 9);
assertEquals(1, map.getLocalMapStats().getIndexedQueryCount());
result = map.keySet(Predicates.notEqual("attribute", null));
assertEqualSets(result, 0, 2, 4, 6, 8);
assertEquals(1, map.getLocalMapStats().getIndexedQueryCount());
result = map.keySet(Predicates.greaterThan("attribute", 4));
assertEqualSets(result, 6, 8);
assertEquals(2, map.getLocalMapStats().getIndexedQueryCount());
}
Aggregations