smengcl commented on code in PR #8555:
URL: https://github.com/apache/ozone/pull/8555#discussion_r2139193087


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotLocalPropertyYamlImpl.java:
##########
@@ -0,0 +1,178 @@
+/*
+ * 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.hadoop.ozone.om;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.atomic.AtomicBoolean;
+import org.apache.hadoop.hdds.server.YamlUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.yaml.snakeyaml.DumperOptions;
+import org.yaml.snakeyaml.Yaml;
+import org.yaml.snakeyaml.scanner.ScannerException;
+
+/**
+ * Implementation of {@link OmSnapshotLocalProperty} that uses a YAML file
+ * to store and retrieve snapshot local properties.
+ * Changes are only persisted when the object is closed.
+ */
+public class OmSnapshotLocalPropertyYamlImpl implements 
OmSnapshotLocalProperty, AutoCloseable {
+
+  private static final Logger LOG = 
LoggerFactory.getLogger(OmSnapshotLocalPropertyYamlImpl.class);
+
+  /**
+   * The path to the YAML file used to store properties.
+   * If this file does not exist, it will be created upon close().
+   */
+  private final File yamlFile;
+
+  /**
+   * A map storing key-value pairs of snapshot properties.
+   * Read from the YAML file upon initialization.
+   */
+  private Map<String, String> properties;

Review Comment:
   > have an empty/basic YAML implementation in this PR but not implement any 
usecase like the SstFiltering use case,
   
   Agreed. Added for demo purpose right now. Will remove before merge.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to