Cyrill commented on code in PR #4119:
URL: https://github.com/apache/ignite-3/pull/4119#discussion_r1692647739


##########
modules/system-configuration/src/main/java/org/apache/ignite/internal/configuration/IgnitePaths.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.configuration;
+
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.function.Supplier;
+import org.apache.ignite.configuration.ConfigurationValue;
+import org.apache.ignite.internal.lang.IgniteInternalException;
+import org.apache.ignite.internal.util.LazyPath;
+
+/**
+ * Manages storage paths for Ignite.
+ */
+public class IgnitePaths {
+
+    /**
+     * Path to the base directory of the partitions data.
+     */
+    private static final Path PARTITIONS_BASE_PATH = Paths.get("partitions");
+
+    /**
+     * Path to the persistent storage used by the VaultService component.
+     */
+    private static final Path VAULT_DB_PATH = Paths.get("vault");
+
+    /**
+     * Path to the persistent storage used by the MetaStorageManager component.
+     */
+    private static final Path METASTORAGE_DB_PATH = Paths.get("metastorage");
+
+    /**
+     * Path to the persistent storage used by the 
ClusterManagementGroupManager component.
+     */
+    private static final Path CMG_DB_PATH = Paths.get("cmg");
+
+    /**
+     * Path for the persistent storage.
+     */
+    private static final Path STORAGE_PATH = Paths.get("db");
+
+    /**
+     * Path for the raft log.
+     */
+    private static final Path RAFT_LOG_PATH = Paths.get("log");
+
+    /**
+     * Path for the metadata.
+     */
+    private static final Path METADATA_PATH = Paths.get("meta");
+
+    public static LazyPath partitionsBasePath(SystemConfiguration 
systemConfiguration, Path workDir) {
+        return lazy(systemConfiguration.partitionsBasePath(), () -> 
workDir.resolve(PARTITIONS_BASE_PATH), true);
+    }
+
+    public static LazyPath partitionsMetaPath(LazyPath partitionsBaseDir) {
+        return partitionsBaseDir.resolveLazy(METADATA_PATH, true);
+    }
+
+    public static LazyPath partitionsRaftLogPath(LazyPath partitionsBaseDir) {
+        return partitionsBaseDir.resolveLazy(RAFT_LOG_PATH);
+    }
+
+    public static LazyPath partitionsRaftLogPath(SystemConfiguration 
systemConfiguration, Path workDir) {
+        return partitionsRaftLogPath(partitionsBasePath(systemConfiguration, 
workDir));
+    }
+
+    /**
+     * Returns a path to the partitions store directory. Creates a directory 
if it doesn't exist.
+     *
+     * @param partitionsBaseDir Partitions base directory, {@link 
#partitionsBasePath(SystemConfiguration, Path)}.
+     * @return Partitions store path.
+     */
+    public static LazyPath partitionsStorePath(LazyPath partitionsBaseDir) {

Review Comment:
   Done



-- 
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]

Reply via email to