Giriş
Not : Kod için ayarlar MapStoreConfig ile yapılıyor
Tüm ayarlar <map-store tag></map-store tag> içinde. XML ayarlarının açıklaması şöyle
Örnekclass-name: Name of the class implementing MapLoader and/or MapStore.write-delay-seconds: Number of seconds to delay to call the MapStore.store(key, value)`. If the value is zero then it is write-through, so the MapStore.store(key,value) method is called as soon as the entry is updated. Otherwise, it is write-behind; so the updates will be stored after the write-delay-seconds value by calling the Hazelcast.storeAll(map) method. Its default value is 0 (write-through).write-batch-size: Used to create batch chunks when writing to the external data store. In default mode, all map entries are tried to be written in one go. To create batch chunks, the minimum meaningful value for write-batch-size is 2. For values smaller than 2, it works as in default mode.write-coalescing: In write-behind mode, Hazelcast coalesces updates on a specific key by default; it applies only the last update on it. You can set this element to false to store all updates performed on a key to the data store.enabled: True to enable this map-store, false to disable. Its default value is true.initial-mode: Sets the initial load mode. LAZY is the default load mode, where load is asynchronous. EAGER means map operations are blocked until all partitions are loaded.
Şöyle yaparız
<map name="..."><map-store enabled="true"><write-delay-seconds>1</write-delay-seconds><write-batch-size>5</write-batch-size><write-coalescing>true</write-coalescing></map-store><in-memory-format>NATIVE</in-memory-format><backup-count>0</backup-count><async-backup-count>1</async-backup-count><time-to-live-seconds>0</time-to-live-seconds><max-idle-seconds>1800</max-idle-seconds><eviction eviction-policy="NONE" max-size-policy="PER_NODE" size="0"/><merge-policy>com.hazelcast.spi.merge.PutIfAbsentMergePolicy</merge-policy></map>
Hiç yorum yok:
Yorum Gönder