use of com.hazelcast.config.MapIndexConfig in project hazelcast by hazelcast.
the class RecordStoreTest method testRecordStoreReset.
private IMap<Object, Object> testRecordStoreReset() {
String mapName = randomName();
Config config = new Config();
MapConfig mapConfig = config.getMapConfig(mapName);
MapIndexConfig indexConfig = new MapIndexConfig("name", false);
mapConfig.addMapIndexConfig(indexConfig);
HazelcastInstance hazelcastInstance = createHazelcastInstance(config);
IMap<Object, Object> map = hazelcastInstance.getMap(mapName);
int key = 1;
map.put(key, new SampleObjects.Employee("tom", 24, true, 10));
DefaultRecordStore defaultRecordStore = getRecordStore(map, key);
defaultRecordStore.reset();
assertNull(map.get(key));
return map;
}
use of com.hazelcast.config.MapIndexConfig in project hazelcast by hazelcast.
the class QueryIndexMigrationTest method newConfigWithIndex.
private Config newConfigWithIndex(String mapName, String attribute) {
Config config = new Config();
config.setProperty(GroupProperty.WAIT_SECONDS_BEFORE_JOIN.getName(), "0");
config.getMapConfig(mapName).addMapIndexConfig(new MapIndexConfig(attribute, false));
return config;
}
use of com.hazelcast.config.MapIndexConfig in project hazelcast by hazelcast.
the class QueryBasicTest method testQueryPortableObjectWithIndex.
@Test
public void testQueryPortableObjectWithIndex() {
String name = randomMapName();
Config config = getConfig();
config.addMapConfig(new MapConfig(name).addMapIndexConfig(new MapIndexConfig("timestamp", true)));
testQueryUsingPortableObject(config, name);
}
use of com.hazelcast.config.MapIndexConfig 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).addMapIndexConfig(new MapIndexConfig("timestamp", true)));
testQueryUsingPortableObject(config, name);
}
use of com.hazelcast.config.MapIndexConfig in project hazelcast by hazelcast.
the class EntryProcessorTest method testIndexAware_Issue_1719.
@Test
public void testIndexAware_Issue_1719() {
Config cfg = getConfig();
cfg.getMapConfig(MAP_NAME).addMapIndexConfig(new MapIndexConfig("attr1", false));
HazelcastInstance instance = createHazelcastInstance(cfg);
IMap<String, TestData> map = instance.getMap(MAP_NAME);
map.put("a", new TestData("foo", "bar"));
map.put("b", new TestData("abc", "123"));
TestPredicate predicate = new TestPredicate("foo");
Map<String, Object> entries = map.executeOnEntries(new TestLoggingEntryProcessor(), predicate);
assertEquals("The predicate should only relate to one entry!", 1, entries.size());
assertEquals("The predicate's apply method should only be invoked once!", 1, predicate.getApplied());
assertTrue("The predicate should only be used via index service!", predicate.isFilteredAndAppliedOnlyOnce());
}
Aggregations