0

As in ehcache we have diskstore where we could control the location of temp directory and I don’t see the equivalent in hazelcast.

<diskStore path="java.io.tmpdir/ehcache" />

Is there a configuration we can add to the xml to control the location to keep it part of our install directory?

ripunj2408813
  • 33
  • 1
  • 9

3 Answers3

0

Yes it does, it is called Hot Restart but is only available in the commercial edition of Hazelcast.

Neil Stevenson
  • 3,060
  • 9
  • 11
0

@Neil. Thanks

But, I did below configuration but no file created for cache at below path. Please let me know if I need to some edits in configuration.

ORM Properties

jpa.orm.properties = hibernate.format_sql=true,hibernate.show_sql=true, hibernate.id.new_generator_mappings=true, hibernate.id.optimizer.pooled.prefer_lo=true, hibernate.jdbc.batch_size=500,hibernate.cache.use_second_level_cache=true, hibernate.cache.use_query_cache=true, hibernate.cache.provider_class=com.hazelcast.hibernate.provider.HazelcastCacheProvider, hibernate.cache.region.factory_class=com.hazelcast.hibernate.HazelcastLocalCacheRegionFactory, hibernate.javax.cache.uri =achorigination-hazelcast-custom-config.xml, hibernate.javax.cache.provider = com.hazelcast.client.cache.impl.HazelcastClientCachingProvider, hibernate.cache.hazelcast.configuration_file_path=achorigination--custom-config.xml

hazelcast-custom-config.xml file:

 <hot-restart-persistence enabled="true">
        <base-dir>C:\ACH_Maven_Latest\ACHOrigination\Eclipse\</base-dir>
        <backup-dir>C:\ACH_Maven_Latest\ACHOrigination\Eclipse\ppd_ach_origination_resources</backup-dir>
        <parallelism>1</parallelism>
 </hot-restart-persistence>
<map name="default">

<hot-restart enabled="true">
        <fsync>false</fsync>
    </hot-restart>

    <backup-count>1</backup-count>

    <time-to-live-seconds>120</time-to-live-seconds>
    <max-idle-seconds>120</max-idle-seconds>
    <eviction-policy>LRU</eviction-policy>
    <max-size policy="PER_NODE">5000</max-size>

</map>

ripunj2408813
  • 33
  • 1
  • 9
0

Hazelcast guarantees to store your data in memory and therefore you don't configure any directory, diskstore, or any place in the disk where the data is stored. Actually, it's one of the biggest benefits and features or Hazelcast that it provides HA and at the same time it guarantees the super-fast data access, because it's always stored in memory.

Saying that, @Neil is right that one of the Hazelcast Enterprise features is Hot Restart, which allows you to persist data with some clear restrictions. Please read more about Hot Restart in the Hazelcast Reference Manual, but in general Hot Restart is used to perform a controlled shutdown of your Hazelcast cluster (for the maintenance period), not really to always persist the cache data.

Rafał Leszko
  • 4,939
  • 10
  • 19