@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(true); cfg .indexing().index(Index.ALL) .addIndexedEntity(NumericType.class) .addIndexedEntity(Person.class) .addIndexedEntity(AnotherGrassEater.class) .addProperty("default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(cfg); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder defaultConfiguration = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false); defaultConfiguration.clustering() .stateTransfer().fetchInMemoryState(true); createClusteredCaches(2, defaultConfiguration); ConfigurationBuilder cfg = initialCacheConfiguration(); IndexingConfigurationBuilder indexingConfigurationBuilder = cfg.clustering() .stateTransfer().fetchInMemoryState(true) .indexing() .index(Index.PRIMARY_OWNER) .addIndexedEntity(getModelFactory().getUserImplClass()) .addIndexedEntity(getModelFactory().getAccountImplClass()) .addIndexedEntity(getModelFactory().getTransactionImplClass()); getIndexConfig().forEach(indexingConfigurationBuilder::addProperty); manager(0).defineConfiguration(TEST_CACHE_NAME, cfg.build()); manager(1).defineConfiguration(TEST_CACHE_NAME, cfg.build()); cache1 = manager(0).getCache(TEST_CACHE_NAME); cache2 = manager(1).getCache(TEST_CACHE_NAME); }
private ConfigurationBuilder getIndexedConfig() { ConfigurationBuilder cfg = getBaseConfig(); cfg.indexing().index(Index.ALL) .addIndexedEntity(Person.class) .addIndexedEntity(AnotherGrassEater.class) .addProperty("default.directory_provider", "infinispan") .addProperty("lucene_version", "LUCENE_CURRENT"); return cfg; }
protected void configureCache(ConfigurationBuilder builder) { builder.indexing().index(Index.ALL) .addIndexedEntity(Person.class) .addProperty("default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); }
@Produces @ConfigureCache("faq-cache") @FaqCache() public Configuration specialCacheCfg(InjectionPoint injectionPoint) throws ClassNotFoundException, NoSuchMethodException { log.info("Configuring faq-cache..."); Class classToIndex = null; String defaultValue = (String) FaqCache.class.getMethod("classToIndex").getDefaultValue(); try { classToIndex = Class.forName(injectionPoint.getAnnotated().getAnnotation(FaqCache.class).classToIndex()); } catch (final Exception e) { log.warning("Failed to lookup the class: " + classToIndex + " --> " + e.getMessage()); log.warning("Configuring classToIndex to [" + defaultValue + "]"); classToIndex = Class.forName(defaultValue); } return new ConfigurationBuilder() .indexing() .autoConfig(true) .addIndexedEntity(classToIndex) .index(Index.ALL) .addProperty("default.directory_provider", "ram") .build(); } }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(false); cfg.indexing().index(Index.ALL) .addIndexedEntity(Bond.class) .addIndexedEntity(Debenture.class) .addProperty("default.directory_provider", "local-heap") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(cfg); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cfg = TestCacheManagerFactory.getDefaultCacheConfiguration(true); cfg.transaction() .transactionMode(TransactionMode.TRANSACTIONAL) .indexing().index(Index.ALL) .addIndexedEntity(UserHS.class) .addIndexedEntity(AccountHS.class) .addIndexedEntity(TransactionHS.class) .addIndexedEntity(TheEntity.class) .addIndexedEntity(Book.class) .addProperty("default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); createClusteredCaches(1, cfg); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(true); cfg.indexing().index(Index.ALL) .addIndexedEntity(Person.class) .addIndexedEntity(AnotherGrassEater.class) .addProperty("default.directory_provider", "filesystem") .addProperty("default.indexBase", indexDirectory) .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(cfg); }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(true); c.indexing() .index(Index.ALL) .addIndexedEntity(TestEntity.class) .addIndexedEntity(AnotherTestEntity.class) .addProperty("default.directory_provider", "local-heap") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(c); }
private ConfigurationBuilder buildCacheConfig(String indexName) { ConfigurationBuilder cb = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); cb.indexing() .index(Index.ALL) //index also changes originated on other nodes, the index is not shared .addIndexedEntity(Person.class) .addProperty("default.directory_provider", "filesystem") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("default.indexBase", TMP_DIR + File.separator + indexName) .addProperty("lucene_version", "LUCENE_CURRENT"); return cb; }
protected ConfigurationBuilder getConfigurationBuilder() { ConfigurationBuilder cfgBuilder = new ConfigurationBuilder(); cfgBuilder.indexing().index(Index.ALL) .addIndexedEntity(Person.class) .addProperty("default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); return cfgBuilder; }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(isTransactional()); c.indexing() .index(Index.PRIMARY_OWNER) .addIndexedEntity(TestEntity.class) .addIndexedEntity(AnotherTestEntity.class) .addProperty("default.indexmanager", AffinityIndexManager.class.getName()) .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(c); }
protected ConfigurationBuilder getDefaultCacheConfigBuilder() { ConfigurationBuilder baseConfigBuilder = getBaseConfigBuilder(CacheMode.DIST_SYNC); IndexingConfigurationBuilder indexCfgBuilder = baseConfigBuilder.indexing() .index(Index.PRIMARY_OWNER).addIndexedEntity(Entity.class); this.getIndexingProperties() .entrySet().forEach(entry -> indexCfgBuilder.addProperty(entry.getKey(), entry.getValue())); return baseConfigBuilder; }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = getDefaultStandaloneCacheConfig(isTransactional()); c.indexing() .index(Index.PRIMARY_OWNER) .addIndexedEntity(TestEntity.class) .addIndexedEntity(AnotherTestEntity.class) .addProperty("default.indexmanager", "org.infinispan.query.indexmanager.InfinispanIndexManager") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(c); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, transactionsEnabled()); builder.indexing().index(Index.ALL) .addIndexedEntity(Person.class) .addIndexedEntity(AnotherGrassEater.class) .addProperty("hibernate.search.default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); createClusteredCaches(2, builder); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cacheCfg = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false); cacheCfg.indexing() .index(Index.PRIMARY_OWNER) .addIndexedEntity(Foo.class) .addProperty("default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); List<Cache<String, Person>> caches = createClusteredCaches(2, cacheCfg); cache1 = caches.get(0); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(true); cfg .indexing() .index(Index.ALL) .addIndexedEntity(TestEntity.class) .addProperty("default.directory_provider", "local-heap") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(cfg); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(true); cfg .indexing() .index(Index.ALL) .addIndexedEntity(Person.class) .addIndexedEntity(AnotherGrassEater.class) .addProperty("default.directory_provider", "local-heap") .addProperty("error_handler", "org.infinispan.query.helper.StaticTestingErrorHandler") .addProperty("lucene_version", "LUCENE_CURRENT"); enhanceConfig(cfg); return TestCacheManagerFactory.createCacheManager(cfg); }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(true); cfg .indexing() .index(Index.ALL) .addIndexedEntity(Team.class) .addProperty("hibernate.search.default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(cfg); }
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = getDefaultStandaloneCacheConfig(true); cfg.indexing() .index(Index.ALL) .addIndexedEntity(CitySpatial.class) .addProperty("default.directory_provider", "local-heap") .addProperty("lucene_version", "LUCENE_CURRENT"); return TestCacheManagerFactory.createCacheManager(cfg); }