0

SB を使用して Geode クライアント キャッシュを作成する場合、リモート Geode インスタンスでの PDX シリアライゼーションに問題があります ->

@Configuration
public class GeodeClientConfiguration {

@Bean
ClientCache cache() {
    return new ClientCacheFactory()
        .setPdxPersistent(true)
        .setPdxDiskStore("foo")
        .setPdxReadSerialized(true)
        .setPdxSerializer(new ReflectionBasedAutoSerializer(false, "foo.EpgProgram"))
        .create();
}

@Bean
Region<String, List<EpgProgram>> testRegion(final ClientCache cache) {
    return cache.<String, List<EpgProgram>> getRegion("schedule");
}

cache.xml は次のようになります ->

<?xml version="1.0" encoding="UTF-8"?>
<client-cache
    xmlns="http://geode.apache.org/schema/cache"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://geode.apache.org/schema/cache
                    http://geode.apache.org/schema/cache/cache-1.0.xsd"
    version="1.0">
<pool name="serverPool">
    <locator host="localhost" port="10334"/>
</pool>
<region name="schedule"  refid="CACHING_PROXY">
    <region-attributes pool-name="serverPool"
            scope="global" />
</region>

Gfsh では、リージョンを次のように作成しました。

create region --name=/schedule --type=REPLICATE_PERSISTENT

メソッドでのテスト中に EpgProgram の List をリージョンに追加する場合

public List<EpgProgram> getScheduleFromWhatson(String channel, LocalDate broadcastDate, Boolean expand) throws RestClientException, URISyntaxException {
    List<EpgProgram> programs = transform(whatsOnServiceInternal.getScheduleFromWhatson(channel, broadcastDate), expand);
    schedule.put(channel, programs);
    return programs;
}

pdx インスタンスは、情報トレースから確認できる内容からのリフレクションを使用して生成されているようです ->

[info 2016/12/09 11:32:33.361 CET <http-nio-8080-exec-1> tid=0xc8] Auto serializer generating type for class dk.dr.epg.core.EpgProgram for fields: 
printable: private boolean dk.dr.epg.core.EpgProgram.printable
live: private boolean dk.dr.epg.core.EpgProgram.live
rerun: private boolean dk.dr.epg.core.EpgProgram.rerun

しかし、その直後に例外が発生します->

org.apache.geode.pdx.PdxInitializationException: The PDX metadata must be persistent in a member that has persistent data. See CacheFactory.setPdxPersistent.

Pdxの持続性を設定する必要がある他の場所を見逃しましたか??

Geode バージョン: 1.0.0-インキュベーション中。

4

1 に答える 1

3

サーバー上で永続的になるように pdx レジストリを構成する必要があります。次のように gfsh でそれを行うことができます。

gfsh> configure pdx --disk-store=DEFAULT

変更を有効にするには、その後サーバーを再起動する必要があると思います。

于 2016-12-12T20:40:04.860 に答える