walterddr commented on code in PR #9288:
URL: https://github.com/apache/pinot/pull/9288#discussion_r959032010


##########
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchSparkDataIngestionJobCommand.java:
##########
@@ -0,0 +1,368 @@
+/**
+ * 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.pinot.tools.admin.command;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.lang3.JavaVersion;
+import org.apache.commons.lang3.SystemUtils;
+import org.apache.pinot.spi.auth.AuthProvider;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.ingestion.batch.IngestionJobLauncher;
+import org.apache.pinot.spi.ingestion.batch.spec.PinotFSSpec;
+import org.apache.pinot.spi.ingestion.batch.spec.SegmentGenerationJobSpec;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.apache.pinot.spi.utils.GroovyTemplateUtils;
+import org.apache.pinot.tools.Command;
+import org.apache.spark.launcher.SparkLauncher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine;
+
+
+/**
+ * Class to implement LaunchDataIngestionJob command.
+ *
+ */
+@CommandLine.Command(name = "LaunchSparkDataIngestionJob")
+public class LaunchSparkDataIngestionJobCommand extends 
AbstractBaseAdminCommand implements Command {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(LaunchSparkDataIngestionJobCommand.class);
+  public static final String MAIN_CLASS = 
"org.apache.pinot.tools.admin.command.LaunchDataIngestionJobCommand";
+  public static final String SPARK_HOME = "SPARK_HOME";
+  public static final String BASEDIR = "basedir";
+  public static final String LOCAL_FILE_PREFIX = "local://";
+  public static final String PINOT_MAIN_JAR_PREFIX = "pinot-all";
+
+  @CommandLine.Option(names = {"-help", "-h", "--h", "--help"}, required = 
false, help = true, description = "Print "
+      + "this message.")
+  private boolean _help = false;
+  @CommandLine.Option(names = {"-jobSpecFile", "-jobSpec"}, required = true, 
description = "Ingestion job spec file")
+  private String _jobSpecFile;
+  @CommandLine.Option(names = {"-values"}, required = false, arity = "1..*", 
description = "Context values set to the"
+      + " job spec template")
+  private List<String> _values;
+  @CommandLine.Option(names = {"-propertyFile"}, required = false, description 
= "A property file contains context "
+      + "values to set the job spec template")
+  private String _propertyFile;
+  @CommandLine.Option(names = {"-pluginsToLoad"}, required = false, arity = 
"1..*", split = ":", description = "List "
+      + "of plugin name separated by : to load at runtime. e.g. 
pinto-s3:pinot-parquet")
+  private List<String> _pluginsToLoad;
+
+  // Kafka plugins need to be excluded as they contain scala dependencies 
which cause
+  // NoSuchMethodErrors with runtime spark.
+  // It is also fine to exclude Kafka plugins as they are not going to be used 
in batch ingestion in any case
+  @CommandLine.Option(names = {"-pluginsToExclude"}, defaultValue = 
"pinot-kafka-0.9:pinot-kafka-2.0", required =

Review Comment:
   i wonder if we already hav a property file and a jobspec file. do we still 
want to support these commandline options



##########
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/LaunchSparkDataIngestionJobCommand.java:
##########
@@ -0,0 +1,368 @@
+/**
+ * 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.pinot.tools.admin.command;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Preconditions;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.lang3.JavaVersion;
+import org.apache.commons.lang3.SystemUtils;
+import org.apache.pinot.spi.auth.AuthProvider;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.filesystem.PinotFS;
+import org.apache.pinot.spi.filesystem.PinotFSFactory;
+import org.apache.pinot.spi.ingestion.batch.IngestionJobLauncher;
+import org.apache.pinot.spi.ingestion.batch.spec.PinotFSSpec;
+import org.apache.pinot.spi.ingestion.batch.spec.SegmentGenerationJobSpec;
+import org.apache.pinot.spi.plugin.PluginManager;
+import org.apache.pinot.spi.utils.GroovyTemplateUtils;
+import org.apache.pinot.tools.Command;
+import org.apache.spark.launcher.SparkLauncher;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine;
+
+
+/**
+ * Class to implement LaunchDataIngestionJob command.
+ *
+ */
+@CommandLine.Command(name = "LaunchSparkDataIngestionJob")
+public class LaunchSparkDataIngestionJobCommand extends 
AbstractBaseAdminCommand implements Command {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(LaunchSparkDataIngestionJobCommand.class);
+  public static final String MAIN_CLASS = 
"org.apache.pinot.tools.admin.command.LaunchDataIngestionJobCommand";
+  public static final String SPARK_HOME = "SPARK_HOME";
+  public static final String BASEDIR = "basedir";
+  public static final String LOCAL_FILE_PREFIX = "local://";
+  public static final String PINOT_MAIN_JAR_PREFIX = "pinot-all";
+
+  @CommandLine.Option(names = {"-help", "-h", "--h", "--help"}, required = 
false, help = true, description = "Print "
+      + "this message.")
+  private boolean _help = false;
+  @CommandLine.Option(names = {"-jobSpecFile", "-jobSpec"}, required = true, 
description = "Ingestion job spec file")
+  private String _jobSpecFile;
+  @CommandLine.Option(names = {"-values"}, required = false, arity = "1..*", 
description = "Context values set to the"
+      + " job spec template")
+  private List<String> _values;
+  @CommandLine.Option(names = {"-propertyFile"}, required = false, description 
= "A property file contains context "
+      + "values to set the job spec template")
+  private String _propertyFile;
+  @CommandLine.Option(names = {"-pluginsToLoad"}, required = false, arity = 
"1..*", split = ":", description = "List "
+      + "of plugin name separated by : to load at runtime. e.g. 
pinto-s3:pinot-parquet")
+  private List<String> _pluginsToLoad;
+
+  // Kafka plugins need to be excluded as they contain scala dependencies 
which cause
+  // NoSuchMethodErrors with runtime spark.
+  // It is also fine to exclude Kafka plugins as they are not going to be used 
in batch ingestion in any case
+  @CommandLine.Option(names = {"-pluginsToExclude"}, defaultValue = 
"pinot-kafka-0.9:pinot-kafka-2.0", required =

Review Comment:
   i wonder if we already have a property file and a jobspec file. do we still 
want to support these commandline options



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to