aryangupta1998 commented on code in PR #8254: URL: https://github.com/apache/ozone/pull/8254#discussion_r2040348231
########## hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/container/ContainerLogParser.java: ########## @@ -0,0 +1,77 @@ +/* + * 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.debug.container; + +import java.sql.SQLException; +import java.util.concurrent.Callable; +import org.apache.hadoop.ozone.containerlog.parser.ContainerDatanodeDatabase; +import org.apache.hadoop.ozone.containerlog.parser.ContainerLogFileParser; +import picocli.CommandLine; + +/** + * Parses container logs, processes them, and updates the database accordingly. + */ + [email protected]( + name = "container_log_parse", + description = "parse the container logs" +) +public class ContainerLogParser implements Callable<Void> { + @CommandLine.Option(names = {"--parse"}, + description = "path to the dir which contains log files") + private String path; + + @CommandLine.Option(names = {"--thread-count"}, + description = "Thread count for concurrent processing.", + defaultValue = "10") + private int threadCount; + + @CommandLine.ParentCommand + private ContainerLogController parent; + + @Override + public Void call() throws Exception { + if (path != null) { Review Comment: ```suggestion if (path != null) { Path logPath = Paths.get(path); if (!Files.exists(logPath) || !Files.isDirectory(logPath)) { System.err.println("Invalid path provided: " + path); return null; } } ``` -- 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]
