3.3.2. エビクションの設定例
設定 Bean または XML ファイルを使用して Red Hat JBoss Data Grid のエビクションを設定します。エビクションの設定はキャッシュごとに行います。
- ライブラリーモードの XML 設定例は以下のようになります。
<eviction strategy="LRU" maxEntries="2000"/>
<eviction strategy="LRU" maxEntries="2000"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - リモートクライアントサーバーモードの XML 設定例は以下のようになります。
<eviction strategy="LRU" max-entries="20"/>
<eviction strategy="LRU" max-entries="20"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - ライブラリーモードのプログラムを用いた設定例は以下のようになります。
Configuration c = new ConfigurationBuilder().eviction().strategy(EvictionStrategy.LRU) .maxEntries(2000) .build();Configuration c = new ConfigurationBuilder().eviction().strategy(EvictionStrategy.LRU) .maxEntries(2000) .build();Copy to Clipboard Copied! Toggle word wrap Toggle overflow
注記
エビクションの設定では、JBoss Data Grid のライブラリーモードは
maxEntries パラメーター、リモートクライアントサーバーモードは max-entries パラメーターを使用します。