From 0d00f03d079f6851b2f545556e1b51efc5038674 Mon Sep 17 00:00:00 2001 From: Dmitriy Pavlov Date: Wed, 26 Aug 2026 21:09:20 +0300 Subject: [PATCH] IGNITE-27380 Document extra snapshot paths --- .../org/apache/ignite/snippets/Snapshots.java | 12 ++++++++++++ docs/_docs/code-snippets/xml/snapshots.xml | 18 ++++++++++++++++++ docs/_docs/persistence/snapshot-directory.adoc | 10 ++++++++++ 3 files changed, 40 insertions(+) diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Snapshots.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Snapshots.java index fe0c026ed501e..f014fa7c36e0f 100644 --- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Snapshots.java +++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Snapshots.java @@ -22,6 +22,7 @@ import org.apache.ignite.IgniteCache; import org.apache.ignite.Ignition; import org.apache.ignite.configuration.CacheConfiguration; +import org.apache.ignite.configuration.DataStorageConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.spi.encryption.keystore.KeystoreEncryptionSpi; @@ -35,6 +36,17 @@ void configuration() { File exSnpDir = new File("work", "ex_snapshots"); cfg.setSnapshotPath(exSnpDir.getAbsolutePath()); + + cfg.setDataStorageConfiguration(new DataStorageConfiguration() + .setExtraStoragePaths( + new File("work", "persistence-a").getAbsolutePath(), + new File("work", "persistence-b").getAbsolutePath() + ) + .setExtraSnapshotPaths( + new File("work", "snapshots-a").getAbsolutePath(), + new File("work", "snapshots-b").getAbsolutePath() + ) + ); //end::config[] Ignite ignite = Ignition.start(cfg); diff --git a/docs/_docs/code-snippets/xml/snapshots.xml b/docs/_docs/code-snippets/xml/snapshots.xml index f2e9d98499d9c..5de483137b1bb 100644 --- a/docs/_docs/code-snippets/xml/snapshots.xml +++ b/docs/_docs/code-snippets/xml/snapshots.xml @@ -24,6 +24,24 @@ --> + + + + + /ignite/persistence-a + /ignite/persistence-b + + + + + + /snapshots/persistence-a + /snapshots/persistence-b + + + + + diff --git a/docs/_docs/persistence/snapshot-directory.adoc b/docs/_docs/persistence/snapshot-directory.adoc index a046fabb31ae6..5277c7f1fb6d8 100644 --- a/docs/_docs/persistence/snapshot-directory.adoc +++ b/docs/_docs/persistence/snapshot-directory.adoc @@ -37,3 +37,13 @@ tab:Java[] include::{javaCodeDir}/Snapshots.java[tags=config, indent=0] ---- -- + +If persistence data is distributed across several storage directories with +`DataStorageConfiguration.extraStoragePaths`, you can also configure +`DataStorageConfiguration.extraSnapshotPaths`. Each extra snapshot path is used +for snapshot files that correspond to the matching extra storage path. + +The `extraSnapshotPaths` array must have the same number of entries as +`extraStoragePaths`, and all extra snapshot paths must be unique. If an absolute +`IgniteConfiguration.snapshotPath` is configured without `extraSnapshotPaths`, +Ignite stores snapshot files only under the configured snapshot path.