use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class EntryProcessorBouncingNodesTest method getConfig.
@Override
protected Config getConfig() {
Config config = super.getConfig();
MapConfig mapConfig = config.getMapConfig(MAP_NAME);
mapConfig.setBackupCount(2);
if (withIndex) {
mapConfig.addIndexConfig(new IndexConfig(IndexType.SORTED, "__key"));
}
return config;
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class CompositeEqualPredicateTest method testUnordered.
@Test
public void testUnordered() {
IndexConfig indexConfig = IndexUtils.createTestIndexConfig(IndexType.HASH, "age", "height");
map.addIndex(indexConfig);
assertEquals(0, map.getLocalMapStats().getIndexedQueryCount());
for (int i = 0; i < 100; ++i) {
final Integer age = randomQueryAge();
final Long height = randomQueryHeight();
assertPredicate(new Predicate<Integer, Person>() {
@Override
public boolean apply(Map.Entry<Integer, Person> mapEntry) {
return ObjectTestUtils.equals(mapEntry.getValue().age, age) && ObjectTestUtils.equals(mapEntry.getValue().height, height);
}
}, predicate(indexConfig.getName(), value(age, height), "age", "height"));
}
assertEquals(100, map.getLocalMapStats().getIndexedQueryCount());
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class CompositeRangePredicateTest method before.
@Before
public void before() {
long seed = System.currentTimeMillis();
System.out.println("CompositeRangePredicateTest seed: " + seed);
random = new Random(seed);
Config config = getConfig();
config.getMapConfig("persons").setInMemoryFormat(inMemoryFormat);
map = createHazelcastInstance(config).getMap("persons");
IndexConfig indexConfig = IndexUtils.createTestIndexConfig(IndexType.SORTED, "age", "height", "__key");
indexName = indexConfig.getName();
map.addIndex(indexConfig);
for (int i = 0; i < 500; ++i) {
map.put(i, new Person(randomAge(), randomHeight()));
}
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class LikePredicateTest method createIndex.
@Nonnull
private Index createIndex(IndexType indexType) {
InternalSerializationService mockSerializationService = mock(InternalSerializationService.class);
Extractors mockExtractors = Extractors.newBuilder(mockSerializationService).build();
IndexConfig config = IndexUtils.createTestIndexConfig(indexType, "this");
return new IndexImpl(config, mockSerializationService, mockExtractors, IndexCopyBehavior.COPY_ON_READ, PerIndexStats.EMPTY, MemberPartitionStateImpl.DEFAULT_PARTITION_COUNT);
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class UnsupportedBitmapIndexPredicatesTest method before.
@Before
public void before() {
Config config = smallInstanceConfig();
config.setProperty(QueryEngineImpl.DISABLE_MIGRATION_FALLBACK.getName(), "true");
config.getMapConfig("map").addIndexConfig(new IndexConfig(IndexType.BITMAP, "this"));
map = createHazelcastInstance(config).getMap("map");
for (int i = 0; i < 10; ++i) {
map.put(i, i);
}
}
Aggregations