dam4rus commented on code in PR #6838: URL: https://github.com/apache/nifi/pull/6838#discussion_r1071891302
########## nifi-toolkit/nifi-toolkit-kafka-migrator/src/main/java/org/apache/nifi/toolkit/kafkamigrator/KafkaMigratorMain.java: ########## @@ -0,0 +1,113 @@ +/* + * 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.nifi.toolkit.kafkamigrator; + +import org.apache.nifi.toolkit.kafkamigrator.service.KafkaMigrationService; +import org.apache.nifi.xml.processing.parsers.DocumentProvider; +import org.apache.nifi.xml.processing.parsers.StandardDocumentProvider; +import org.apache.nifi.xml.processing.transform.StandardTransformProvider; +import org.w3c.dom.Document; + +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.HashMap; +import java.util.Map; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +public class KafkaMigratorMain { + + private static void printUsage() { + System.out.println("This application replaces Kafka processors from version 0.8, 0.9, 0.10 and 0.11 to version 2.0 processors" + + " in a flow.xml.gz file."); + System.out.println("\n"); + System.out.println("Usage: kafka-migrator.sh <path to input flow.xml.gz> <path to output flow.xml.gz>" + + " <use transaction true or false>\n<optional: coma separated kafka brokers in <host>:<port> format. " + + "Required for version 0.8 processors only>"); + } + + public static void main(final String[] args) throws Exception { Review Comment: I'm kinda worried about using only arguments (`arg1 argN...`) instead of options (`--input-file <file> --output-file <file>`). Is there any chance this script will require additional required arguments in the future? It would be really weird to introduce a new required argument since the optional arguments index should change or make them into required. It's "fine" if we are 100% sure that this script will never change but I would still take this into consideration -- 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]
