2

我正在寻找使用 Infinispan 配置 Hibernate Search 的帮助,将索引存储在 S3 上

目前,它似乎大部分都在工作,但它创建的索引文件之一有一个字母数字名称,它回来抛出以下错误:

Exception in thread "LuceneIndexesMetadata-CloudCacheStore-3" java.lang.IllegalArgumentException: bucketId: A566834176 (expected: integer)
    at org.infinispan.loaders.bucket.Bucket.setBucketId(Bucket.java:77)
    at org.infinispan.loaders.cloud.CloudCacheStore.readFromBlob(CloudCacheStore.java:446)
    at org.infinispan.loaders.cloud.CloudCacheStore.scanBlobForExpiredEntries(CloudCacheStore.java:291)
    at org.infinispan.loaders.cloud.CloudCacheStore.purge(CloudCacheStore.java:283)
    at org.infinispan.loaders.cloud.CloudCacheStore.purgeInternal(CloudCacheStore.java:335)
    at org.infinispan.loaders.AbstractCacheStore$2.run(AbstractCacheStore.java:111)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:680)

附带说明一下,对索引启用压缩会导致“.bz2”扩展名,这会在每个索引文件上引发此错误。

我不确定问题出在哪里。它应该只创建具有整数名称的索引文件吗?某处是否有配置项将使用不同的读取方法,允许使用字母数字名称(因此允许我使用压缩)?

可能是版本差异。这是我目前正在使用的列表:

Hibernate (core, entitymanager, search, search-infinispan): 4.2.0.Final Infinispan (core, lucene-directory, cachestore-cloud): 5.1.8.Final JClouds (core, blobstore, allblobstore, provider.aws-s3) : 1.1.1

以下是我的一些配置文件:

持久性.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="###">
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
            <property name="hibernate.search.default.directory_provider" value="infinispan"/> 
            <property name="hibernate.search.infinispan.configuration_resourcename" value="infinispan.xml"/>
        </properties>
    </persistence-unit>
</persistence>

infinispan.xml

<infinispan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:infinispan:config:5.1 http://www.infinispan.org/schemas/infinispan-config-5.1.xsd" xmlns="urn:infinispan:config:5.1">


<!-- *************************** -->
<!-- System-wide global settings -->
<!-- *************************** -->
<global>
    <globalJmxStatistics enabled="false" cacheManagerName="HibernateSearch" allowDuplicateDomains="true" />

    <transport clusterName="HibernateSearch-Infinispan-cluster" distributedSyncTimeout="30000">
        <properties>
            <property name="configurationFile" value="infinispan-s3.xml"/>
        </properties>
    </transport>

    <shutdown hookBehavior="REGISTER" />
</global>


<!-- *************************** -->
<!-- Default "template" settings -->
<!-- *************************** -->
<default>
    <locking lockAcquisitionTimeout="30000" writeSkewCheck="false" concurrencyLevel="500" useLockStriping="false" />

    <!-- Invocation batching is required for use with the Lucene Directory -->
    <invocationBatching enabled="true" />

    <clustering mode="invalidation">
        <!-- Prefer loading all data at startup than later -->
        <stateTransfer timeout="60000" fetchInMemoryState="false" />
        <!-- Network calls are synchronous by default -->
        <sync replTimeout="30000" />
    </clustering>
    <jmxStatistics enabled="false" />
    <eviction maxEntries="-1" strategy="NONE" />
    <expiration maxIdle="300000" />

<loaders passivation="false" shared="false" preload="true">
    <loader class="org.infinispan.loaders.cloud.CloudCacheStore" fetchPersistentState="false" ignoreModifications="false" purgeOnStartup="false">
         <properties>
            <property name="identity" value="${AWS_ACCESS_KEY_ID}"/>
            <property name="password" value="${AWS_SECRET_KEY}"/>
            <property name="bucketPrefix" value="${PARAM2}"/>
            <property name="cloudService" value="aws-s3"/>
            <property name="compress" value="false"/>
        </properties>
        <async
                   enabled="true"
                   flushLockTimeout="15000"
                   threadPoolSize="10"
        />
    </loader>
</loaders>

</default>

<!-- *************************************** -->
<!--  Cache to store Lucene's file metadata  -->
<!-- *************************************** -->
<namedCache
    name="LuceneIndexesMetadata">
    <clustering
        mode="invalidation">
        <stateTransfer
            fetchInMemoryState="false" />
        <!--<sync
            replTimeout="30000" /> -->
    </clustering>
</namedCache>

<!-- **************************** -->
<!--  Cache to store Lucene data  -->
<!-- **************************** -->
<namedCache
    name="LuceneIndexesData">
    <clustering
        mode="invalidation">
        <stateTransfer
            fetchInMemoryState="false" />
        <!--<sync
            replTimeout="30000" /> -->
    </clustering>
</namedCache>

<!-- ***************************** -->
<!--  Cache to store Lucene locks  -->
<!-- ***************************** -->
<namedCache
    name="LuceneIndexesLocking">
    <clustering
        mode="invalidation">
        <stateTransfer
            fetchInMemoryState="false" />
        <!--<sync
            replTimeout="30000" /> -->
    </clustering>
</namedCache>

任何有助于正确配置的帮助将不胜感激!

4

1 回答 1

2

Apache LuceneHibernate Search都没有创建这样的文件:Infinispan使用数字存储桶 id,并且根据这些存储桶的值散列,一些可能在负空间中:这似乎是 JClouds 集成的问题。

请在此处提交问题:https ://issues.jboss.org/browse/ISPN

于 2013-07-02T10:38:58.313 回答