private ConfigurationBuilder getConfigurationBuilder() { final ConfigurationBuilder conf = getDefaultClusteredCacheConfig(DIST_SYNC, false); conf.clustering().hash().keyPartitioner(new AffinityPartitioner()).numSegments(10).numOwners(1); return conf; }
protected ConfigurationBuilder getBaseConfigBuilder(CacheMode cacheMode) { ConfigurationBuilder configBuilder = getDefaultClusteredCacheConfig(cacheMode, false); HashConfigurationBuilder hashConfigurationBuilder = configBuilder .clustering() .remoteTimeout(getRemoteTimeoutInMinutes(), TimeUnit.MINUTES) .hash().numSegments(getNumSegments()).numOwners(getNumOwners()); if (getIndexManager().equals(AffinityIndexManager.class.getName())) { hashConfigurationBuilder.keyPartitioner(new AffinityPartitioner()); } return configBuilder; }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cacheCfg = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, transactionsEnabled()); cacheCfg.clustering().hash().keyPartitioner(new AffinityPartitioner()); cacheCfg.indexing() .index(Index.PRIMARY_OWNER) .addIndexedEntity(Person.class) .addProperty("default.indexmanager", AffinityIndexManager.class.getName()) .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); enhanceConfig(cacheCfg); List<Cache<Object, Person>> caches = createClusteredCaches(2, cacheCfg); cache1 = caches.get(0); cache2 = caches.get(1); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder dcc = cacheConfiguration(); dcc.clustering() .cacheMode(cacheMode).partitionHandling().whenSplit(partitionHandling).mergePolicy(mergePolicy) .hash().keyPartitioner(PARTITIONER); createClusteredCaches(numMembersInCluster, dcc, new TransportFlags().withFD(true).withMerge(true)); waitForClusterToForm(); }