@Test public void testDistWitAutoConfig() { IndexingConfiguration cfg = new ConfigurationBuilder() .clustering().cacheMode(CacheMode.DIST_SYNC) .indexing().index(Index.ALL).autoConfig(true) .create(); assertFalse(cfg.properties().isEmpty()); assertEquals(cfg.properties().get("hibernate.search.default.directory_provider"), "infinispan"); }
private ConfigurationBuilder getBaseConfig() { ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.clustering().cacheMode(CacheMode.REPL_SYNC).indexing().index(Index.ALL) .addProperty("default.indexmanager", "org.infinispan.query.indexmanager.InfinispanIndexManager") .addProperty("lucene_version", "LUCENE_CURRENT"); return cfg; }
/** * Creates the embedded cache manager. * * @return the embedded cache manager. */ public static EmbeddedCacheManager createManager() { final GlobalConfigurationBuilder globalBuilder = new GlobalConfigurationBuilder(); globalBuilder.nonClusteredDefault().globalJmxStatistics() .allowDuplicateDomains(true).transport() .clusterName(CLUSTER_NAME); final GlobalConfiguration globalCfg = globalBuilder.build(); final ConfigurationBuilder builder = new ConfigurationBuilder(); builder.clustering().cacheMode(CacheMode.LOCAL).indexing().disable(); final Configuration cfg = builder.build(); final EmbeddedCacheManager manager = new DefaultCacheManager(globalCfg, cfg); return manager; }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cacheCfg = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, TX_ENABLED); cacheCfg.clustering().remoteTimeout(120000) .indexing().index(Index.PRIMARY_OWNER) .addProperty("default.directory_provider", "infinispan") .addProperty("default.indexmanager", "org.infinispan.query.indexmanager.InfinispanIndexManager") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("default.indexwriter.merge_factor", MERGE_FACTOR) .addProperty("hibernate.search.default.worker.execution", "async") .addProperty("default.indexwriter.merge_max_size", "1024") .addProperty("default.indexwriter.ram_buffer_size", "256") .addProperty("lucene_version", "LUCENE_CURRENT"); List<Cache<Long, Person>> caches = createClusteredCaches(2, cacheCfg); cache1 = caches.get(0); cache2 = caches.get(1); }
public static EmbeddedCacheManager createCacheManager(CacheMode mode, boolean indexing) { ConfigurationBuilder builder = new ConfigurationBuilder(); builder .clustering() .cacheMode(mode) .indexing() .index(indexing ? Index.ALL : Index.NONE) .addProperty("lucene_version", "LUCENE_CURRENT") ; if (mode.isClustered()) { return createClusteredCacheManager(builder); } else { return createCacheManager(builder); } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cacheCfg = getDefaultClusteredCacheConfig(CACHE_MODE, TX_ENABLED); cacheCfg.clustering().remoteTimeout(120000) .indexing().index(Index.PRIMARY_OWNER) .addIndexedEntity(Transaction.class) .addProperty("default.directory_provider", DIRECTORY_PROVIDER.toString()) .addProperty("default.indexmanager", INDEX_MANAGER.toString()) .addProperty("default.indexwriter.merge_factor", MERGE_FACTOR) .addProperty("hibernate.search.default.worker.execution", WORKER_MODE.toString()) .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); List<Cache<Integer, Transaction>> caches = createClusteredCaches(2, cacheCfg); cache1 = caches.get(0); cache2 = caches.get(1); massIndexer = Search.getSearchManager(cache1).getMassIndexer(); }
protected EmbeddedCacheManager createCacheManager() throws IOException { ConfigurationBuilder builder = new ConfigurationBuilder(); builder .clustering() .cacheMode(CacheMode.LOCAL) .indexing() .index(Index.ALL) .addIndexedEntity(Person.class) .addProperty("lucene_version", "LUCENE_CURRENT") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("default.indexmanager", "org.infinispan.query.indexmanager.InfinispanIndexManager"); if(transactionsEnabled()) { builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL); } return TestCacheManagerFactory.createCacheManager(builder); }