Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] ISPN-12246 shared vs non-shared cache store #8640

Merged
merged 1 commit into from Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -6,7 +6,7 @@
.shared(false)
.fetchPersistentState(true)
.ignoreModifications(false)
.purgeOnStartup(false)
.purgeOnStartup(true)
.location(System.getProperty("java.io.tmpdir"))
.async()
.enabled(true)
Expand Up @@ -4,7 +4,7 @@
shared="false" preload="true"
fetch-state="true"
read-only="false"
purge="false"
purge="true"
path="${java.io.tmpdir}">
<write-behind modification-queue-size="123" />
   </file-store>
Expand Down
Expand Up @@ -9,29 +9,39 @@ only.
.Procedure

. Use the `persistence` parameter to configure the persistence layer for caches.
. Add {brandname} cache stores with the appropriate configuration, as in the
following examples:
. Configure whether cache stores are local to the node or shared across the cluster.
+
Use either the `shared` attribute declaratively or the `shared(false)` method programmatically.
+
. Configure other cache stores properties as appropriate. Custom cache stores can also include `property` parameters.
+
[NOTE]
====
Configuring cache stores as shared or not shared (local only) determines which
parameters you should set. In some cases, using the wrong combination of
parameters in your cache store configuration can lead to data loss or
performance issues.

For example, if the cache store is local to a node then it makes sense to fetch
state and purge on startup. However, if the cache store is shared, then you
should not fetch state or purge on startup.
====

.Declarative configuration for a file-based cache store
.Local (non-shared) file store

[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/file_store.xml[]
----

.Declarative configuration for a custom cache store configuration
.Shared custom cache store

[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/custom_cache_store.xml[]
----

[NOTE]
====
Custom cache stores include `property` parameters that let you configure specific attributes for your cache store.
====

.Programmatic configuration for a single file cache store
.Single file store

[source,java]
----
Expand Down