3 Replies Latest reply on Oct 5, 2017 2:59 AM by gustavonalle

    Confused by the indexing change introduced by 9.1.1.Final.

    seto

      I can use persistence and eviction with LuceneIndexesMetadata cache in the 9.1.0.Final.

      But now I can't use the settings with 9.1.1.Final.

       

      When I enable persistence and eviction, I get the error below.

      Lucene Directory for index 'co.kaiba.blueeyes.dimensionstory.impl.data.model.social.Group' can not use Metadata Cache 'LuceneIndexesMetadata': eviction enabled on the Cache configuration!

      When I enable persistence only, I get the error below.

      org.infinispan.persistence.keymappers.UnsupportedKeyTypeException: Unsupported key type: 'org.infinispan.lucene.FileCacheKey' on key: M|segments_1|co.kaiba.blueeyes.impl.network.ClientChannelGroupMemberImpl|-1

       

      And from the docs for Infinispan mentioning index caches.

      It’s not necessary to redefine the configuration of those 3 cases, Infinispan will pick sensible defaults. Reasons re-define them would be performance tuning for a specific scenario, or for example to make them persistent by configuring a cache store.

      If I can't make them persistence, does it mean I have to index the cache every launch? I'm using distributed shared indexing before.

        • 1. Re: Confused by the indexing change introduced by 9.1.1.Final.
          gustavonalle

          Eviction is not supported for the Lucene caches, it's strange that you can use it with 9.1.0.Final. Regarding persistence, it should work both on 9.1.0 and 9.1.1. Could you post your complete configuration?

          • 2. Re: Confused by the indexing change introduced by 9.1.1.Final.
            seto

            I can use both eviction and persitence with 9.0.0, 9.0.1 and 9.1.0 before.

            private ConfigurationBuilder evictionConfig(ConfigurationBuilder configurationBuilder) {
              configurationBuilder.memory()
              .evictionType(EvictionType.MEMORY)
              .storageType(StorageType.OFF_HEAP)
              .size(500 * 1024 * 1024);
              return configurationBuilder;
            }
            

             

            
            private ConfigurationBuilder persistenceConfig(ConfigurationBuilder configurationBuilder) {
              configurationBuilder.persistence()
              .addStore(JdbcStringBasedStoreConfigurationBuilder.class)
              .async().enable()
              .preload(preload)
              .shared(shared)
              .fetchPersistentState(fecthPersistentState)
              .ignoreModifications(ignoreModifications)
              .purgeOnStartup(purgeOnStartup)
              .table()
              .createOnStart(createOnStart)
              .dropOnExit(dropOnExit)
              .tableNamePrefix("ISPN_STRING_TABLE")
              .idColumnName("ID_COLUMN").idColumnType("VARCHAR(255)")
              .dataColumnName("DATA_COLUMN").dataColumnType("BLOB")
              .timestampColumnName("TIMESTAMP_COLUMN").timestampColumnType("BIGINT")
              .connectionPool()
              .connectionUrl(connectionUrl)
              .username(username)
              .password(password)
              .driverClass(driverClass);
              return configurationBuilder;
            }
            

             

            And here's the error.

            org.infinispan.persistence.keymappers.UnsupportedKeyTypeException: Unsupported key type: 'org.infinispan.lucene.FileCacheKey' on key: M|segments_1|co.kaiba.blueeyes.impl.network.ClientChannelGroupMemberImpl|-1

            • 3. Re: Confused by the indexing change introduced by 9.1.1.Final.
              gustavonalle

              You need to declare the key to string mapper in order to persist the lucene caches. In the programmatic configuration, it's achieved by

               

              .key2StringMapper(LuceneKey2StringMapper.class)