anton-vinogradov commented on code in PR #13266:
URL: https://github.com/apache/ignite/pull/13266#discussion_r3476172138
##########
docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Snapshots.java:
##########
@@ -28,7 +31,7 @@ void configuration() {
//tag::config[]
IgniteConfiguration cfg = new IgniteConfiguration();
- File exSnpDir = U.resolveWorkDirectory(U.defaultWorkDirectory(),
"ex_snapshots", true);
+ File exSnpDir = new File("work", "ex_snapshots");
Review Comment:
Small doc-quality nit on the rendered output: this line lives inside
`tag::config[]`, so it ships verbatim into
`persistence/snapshot-directory.adoc`. `new File("work", "ex_snapshots")` is
resolved against the process working directory, which *reads* like Ignite's
work dir but isn't guaranteed to be it — the old `U.resolveWorkDirectory(...)`
(rightly dropped, internal API) used to make that explicit. A one-line comment
keeps the example unambiguous for readers:
```suggestion
// Any directory the Ignite process can write to (example value).
File exSnpDir = new File("work", "ex_snapshots");
```
##########
docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/WarmUpStrategy.java:
##########
@@ -14,70 +14,91 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-//tag::warm-all-regions[]
-IgniteConfiguration cfg = new IgniteConfiguration();
+package org.apache.ignite.snippets;
-DataStorageConfiguration storageCfg = new DataStorageConfiguration();
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.LoadAllWarmUpConfiguration;
+import org.apache.ignite.configuration.NoOpWarmUpConfiguration;
-//Changing the default warm-up strategy for all data regions
-storageCfg.setDefaultWarmUpConfiguration(new LoadAllWarmUpConfiguration());
+public class WarmUpStrategy {
+ public void warmAllRegions() {
+ //tag::warm-all-regions[]
+ IgniteConfiguration cfg = new IgniteConfiguration();
-cfg.setDataStorageConfiguration(storageCfg);
-//end::warm-all-regions[]
-//tag::warm-specific-region[]
-IgniteConfiguration cfg = new IgniteConfiguration();
+ DataStorageConfiguration storageCfg = new DataStorageConfiguration();
-DataStorageConfiguration storageCfg = new DataStorageConfiguration();
+ //Changing the default warm-up strategy for all data regions
+ storageCfg.setDefaultWarmUpConfiguration(new
LoadAllWarmUpConfiguration());
Review Comment:
Not introduced by this PR, but flagging since it's the same feature: this
snippet is included by `memory-configuration/data-regions.adoc`, whose prose
says to "pass the configuration parameter `LoadAllWarmUpStrategy` to
`DataStorageConfiguration#setDefaultWarmUpConfiguration`" (and
`NoOpWarmUpStrategy` further down). The actual public config — correctly used
here — is `LoadAllWarmUpConfiguration` / `NoOpWarmUpConfiguration`.
`*WarmUpStrategy` is the (internal) strategy, not what
`setDefaultWarmUpConfiguration(WarmUpConfiguration)` accepts. Since the whole
point of the ticket is that doc and code agree, worth fixing that prose in the
same pass.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]