adoroszlai commented on code in PR #5061: URL: https://github.com/apache/ozone/pull/5061#discussion_r1264072722
########## hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/CompactionLogDagPrinter.java: ########## @@ -0,0 +1,70 @@ +/* + * 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; + +import org.apache.hadoop.hdds.cli.SubcommandWithParent; +import org.apache.hadoop.ozone.client.OzoneClient; +import org.apache.hadoop.ozone.client.OzoneClientException; +import org.apache.hadoop.ozone.shell.Handler; +import org.apache.hadoop.ozone.shell.OzoneAddress; +import org.kohsuke.MetaInfServices; +import picocli.CommandLine; + +import java.io.IOException; + +/** + * Handler to generate image for current compaction DAG in the OM. + * ozone sh snapshot print-log-dag. + */ [email protected]( + name = "print-log-dag", + aliases = "pld", + description = "List snapshots for the buckets.") Review Comment: Leftover description. ########## hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/CompactionLogDagPrinter.java: ########## @@ -0,0 +1,70 @@ +/* + * 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; + +import org.apache.hadoop.hdds.cli.SubcommandWithParent; +import org.apache.hadoop.ozone.client.OzoneClient; +import org.apache.hadoop.ozone.client.OzoneClientException; +import org.apache.hadoop.ozone.shell.Handler; +import org.apache.hadoop.ozone.shell.OzoneAddress; +import org.kohsuke.MetaInfServices; +import picocli.CommandLine; + +import java.io.IOException; + +/** + * Handler to generate image for current compaction DAG in the OM. + * ozone sh snapshot print-log-dag. + */ [email protected]( + name = "print-log-dag", + aliases = "pld", + description = "List snapshots for the buckets.") +@MetaInfServices(SubcommandWithParent.class) +public class CompactionLogDagPrinter extends Handler + implements SubcommandWithParent { + + @CommandLine.Option(names = {"-f", "--file-name"}, + description = "Name of the image file. (optional)") + private String fileName; + + @CommandLine.Option(names = {"-t", "--graph-type"}, + description = "Type of node name to use in the graph image.\n" + + "Accepted values are: \n" + + " file_name: to use file name as node name in DAG,\n" + + " key_size: to show the no. of keys in the file along with file " + + "name in the DAG node name,\n" + + " cumulative_size: to show the cumulative size along with file " + + "name in the DAG node name.", + defaultValue = "file_name") + private String graphType; Review Comment: Possible future improvement: use `enum`. -- 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]
