Search in sources :

Example 6 with PartitioningStrategyConfig

use of com.hazelcast.config.PartitioningStrategyConfig in project hazelcast by hazelcast.

the class PartitioningStrategyFactoryTest method whenPartitioningStrategyDefined_getPartitioningStrategy_returnsSameInstance.

@Test
public void whenPartitioningStrategyDefined_getPartitioningStrategy_returnsSameInstance() {
    PartitioningStrategy configuredPartitioningStrategy = new StringPartitioningStrategy();
    PartitioningStrategyConfig cfg = new PartitioningStrategyConfig(configuredPartitioningStrategy);
    PartitioningStrategy partitioningStrategy = partitioningStrategyFactory.getPartitioningStrategy(mapName, cfg);
    assertSame(configuredPartitioningStrategy, partitioningStrategy);
}
Also used : PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) StringPartitioningStrategy(com.hazelcast.partition.strategy.StringPartitioningStrategy) PartitioningStrategy(com.hazelcast.core.PartitioningStrategy) StringPartitioningStrategy(com.hazelcast.partition.strategy.StringPartitioningStrategy) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 7 with PartitioningStrategyConfig

use of com.hazelcast.config.PartitioningStrategyConfig in project hazelcast by hazelcast.

the class PartitionControlledIdTest method startHazelcastInstances.

@BeforeClass
public static void startHazelcastInstances() throws Exception {
    Config config = new Config();
    PartitioningStrategy partitioningStrategy = StringAndPartitionAwarePartitioningStrategy.INSTANCE;
    config.getMapConfig("default").setPartitioningStrategyConfig(new PartitioningStrategyConfig(partitioningStrategy));
    TestHazelcastInstanceFactory instanceFactory = new TestHazelcastInstanceFactory(4);
    instances = instanceFactory.newInstances(config);
    warmUpPartitions(instances);
}
Also used : PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) PartitioningStrategyConfig(com.hazelcast.config.PartitioningStrategyConfig) Config(com.hazelcast.config.Config) StringAndPartitionAwarePartitioningStrategy(com.hazelcast.partition.strategy.StringAndPartitionAwarePartitioningStrategy) StringPartitioningStrategy(com.hazelcast.partition.strategy.StringPartitioningStrategy) PartitioningStrategy(com.hazelcast.core.PartitioningStrategy) TestHazelcastInstanceFactory(com.hazelcast.test.TestHazelcastInstanceFactory) BeforeClass(org.junit.BeforeClass)

Aggregations

PartitioningStrategyConfig (com.hazelcast.config.PartitioningStrategyConfig)7 PartitioningStrategy (com.hazelcast.core.PartitioningStrategy)5 StringPartitioningStrategy (com.hazelcast.partition.strategy.StringPartitioningStrategy)5 ParallelTest (com.hazelcast.test.annotation.ParallelTest)5 QuickTest (com.hazelcast.test.annotation.QuickTest)5 Test (org.junit.Test)5 Config (com.hazelcast.config.Config)2 MapConfig (com.hazelcast.config.MapConfig)1 StringAndPartitionAwarePartitioningStrategy (com.hazelcast.partition.strategy.StringAndPartitionAwarePartitioningStrategy)1 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)1 RootCauseMatcher (com.hazelcast.util.RootCauseMatcher)1 BeforeClass (org.junit.BeforeClass)1