use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class IndexCreateTest method testTooManyAttributes.
@Test
public void testTooManyAttributes() {
IndexConfig config = new IndexConfig();
for (int i = 0; i < IndexUtils.MAX_ATTRIBUTES + 1; i++) {
config.addAttribute("col" + i);
}
checkIndexFailed(IllegalArgumentException.class, "Index cannot have more than " + IndexUtils.MAX_ATTRIBUTES + " attributes", config);
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class IndexCreateTest method createConfig.
private static IndexConfig createConfig(String... attributes) {
IndexConfig config = new IndexConfig();
config.setType(type);
if (attributes != null) {
for (String attribute : attributes) {
config.addAttribute(attribute);
}
}
return config;
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class MapValuesTest method setup.
@Before
public void setup() {
Config config = regularInstanceConfig();
config.setProperty(QueryEngineImpl.DISABLE_MIGRATION_FALLBACK.getName(), "true");
config.getMapConfig("indexed").addIndexConfig(new IndexConfig(IndexType.SORTED, "this"));
instance = createHazelcastInstance(config);
map = instance.getMap(randomName());
serializationService = getSerializationService(instance);
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class MultiValueBitmapIndexTest method getConfig.
@Override
protected Config getConfig() {
Config config = HazelcastTestSupport.smallInstanceConfig();
config.setProperty(QueryEngineImpl.DISABLE_MIGRATION_FALLBACK.getName(), "true");
MapConfig mapConfig = config.getMapConfig("persons");
mapConfig.addIndexConfig(indexConfig);
// disable periodic metrics collection (may interfere with the test)
config.getMetricsConfig().setEnabled(false);
return config;
}
use of com.hazelcast.config.IndexConfig in project hazelcast by hazelcast.
the class CompositeIndexQueriesTest method before.
@Before
public void before() {
Config config = getConfig();
config.getMapConfig("map").setInMemoryFormat(inMemoryFormat);
config.setProperty(QueryEngineImpl.DISABLE_MIGRATION_FALLBACK.getName(), "true");
map = createHazelcastInstance(config).getMap("map");
IndexConfig indexConfig1 = IndexUtils.createTestIndexConfig(IndexType.HASH, "name", "age");
IndexConfig indexConfig2 = IndexUtils.createTestIndexConfig(IndexType.SORTED, "__key", "age");
IndexConfig indexConfig3 = IndexUtils.createTestIndexConfig(IndexType.SORTED, "height", "__key");
map.addIndex(indexConfig1);
map.addIndex(indexConfig2);
map.addIndex(indexConfig3);
indexes.add(indexConfig1.getName());
indexes.add(indexConfig2.getName());
indexes.add(indexConfig3.getName());
map.put(-2, new Person(null));
map.put(-1, new Person(null));
for (int i = 0; i < 100; ++i) {
map.put(i, new Person(i));
}
map.put(100, new Person(null));
map.put(101, new Person(null));
}
Aggregations