[GitHub] [incubator-hudi] leesf commented on a change in pull request #1096: [HUDI-398]Add set env for spark launcher

2019-12-12 Thread GitBox
leesf commented on a change in pull request #1096: [HUDI-398]Add set env for 
spark launcher
URL: https://github.com/apache/incubator-hudi/pull/1096#discussion_r357401784
 
 

 ##
 File path: 
hudi-cli/src/main/java/org/apache/hudi/cli/commands/SetSparkEnvCommand.java
 ##
 @@ -0,0 +1,68 @@
+/*
+ * 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.hudi.cli.commands;
+
+import org.apache.hudi.cli.HoodiePrintHelper;
+
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * CLI command to set env.
 
 Review comment:
   to set and get env. ?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-hudi] leesf commented on a change in pull request #1096: [HUDI-398]Add set env for spark launcher

2019-12-12 Thread GitBox
leesf commented on a change in pull request #1096: [HUDI-398]Add set env for 
spark launcher
URL: https://github.com/apache/incubator-hudi/pull/1096#discussion_r357399619
 
 

 ##
 File path: 
hudi-cli/src/main/java/org/apache/hudi/cli/commands/SetSparkEnvCommand.java
 ##
 @@ -0,0 +1,68 @@
+/*
+ * 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.hudi.cli.commands;
+
+import org.apache.hudi.cli.HoodiePrintHelper;
+
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * CLI command to set env.
+ */
+@Component
+public class SetSparkEnvCommand implements CommandMarker {
 
 Review comment:
   How about renaming to SparkEnvCommand as it also supports show command?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-hudi] leesf commented on a change in pull request #1096: [HUDI-398]Add set env for spark launcher

2019-12-11 Thread GitBox
leesf commented on a change in pull request #1096: [HUDI-398]Add set env for 
spark launcher
URL: https://github.com/apache/incubator-hudi/pull/1096#discussion_r356851835
 
 

 ##
 File path: 
hudi-cli/src/main/java/org/apache/hudi/cli/commands/SetSparkEnvCommand.java
 ##
 @@ -0,0 +1,46 @@
+/*
+ * 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.hudi.cli.commands;
+
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * CLI command to set env.
+ */
+@Component
+public class SetSparkEnvCommand implements CommandMarker {
+
+  public static Map env = new HashMap();
+
+  @CliCommand(value = "set", help = "Set spark launcher env to cli")
+  public void setEnv(@CliOption(key = {"conf"}, help = "Env config to be set") 
final String confMap)
+  throws IllegalArgumentException {
+String[] map = confMap.split("=");
+if (map.length != 2) {
+  throw new IllegalArgumentException("Illegal set parameter, please use 
like [set SPARK_HOME=/usr/etc/spark]'");
 
 Review comment:
   Is it neccessary to support multi set in one batch such as set 
SPARK_HOME=/usr/etc/spark; set HADOOP_HOME=/usr/etc/hadoop? Or the changes only 
support set SPARK_HOME?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-hudi] leesf commented on a change in pull request #1096: [HUDI-398]Add set env for spark launcher

2019-12-11 Thread GitBox
leesf commented on a change in pull request #1096: [HUDI-398]Add set env for 
spark launcher
URL: https://github.com/apache/incubator-hudi/pull/1096#discussion_r356851835
 
 

 ##
 File path: 
hudi-cli/src/main/java/org/apache/hudi/cli/commands/SetSparkEnvCommand.java
 ##
 @@ -0,0 +1,46 @@
+/*
+ * 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.hudi.cli.commands;
+
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * CLI command to set env.
+ */
+@Component
+public class SetSparkEnvCommand implements CommandMarker {
+
+  public static Map env = new HashMap();
+
+  @CliCommand(value = "set", help = "Set spark launcher env to cli")
+  public void setEnv(@CliOption(key = {"conf"}, help = "Env config to be set") 
final String confMap)
+  throws IllegalArgumentException {
+String[] map = confMap.split("=");
+if (map.length != 2) {
+  throw new IllegalArgumentException("Illegal set parameter, please use 
like [set SPARK_HOME=/usr/etc/spark]'");
 
 Review comment:
   Is it neccessary to support multi set in one batch such as set 
SPARK_HOME=/usr/etc/spark; set HADOOP_HOME=/usr/etc/hadoop?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] [incubator-hudi] leesf commented on a change in pull request #1096: [HUDI-398]Add set env for spark launcher

2019-12-11 Thread GitBox
leesf commented on a change in pull request #1096: [HUDI-398]Add set env for 
spark launcher
URL: https://github.com/apache/incubator-hudi/pull/1096#discussion_r356850671
 
 

 ##
 File path: 
hudi-cli/src/main/java/org/apache/hudi/cli/commands/SetSparkEnvCommand.java
 ##
 @@ -0,0 +1,46 @@
+/*
+ * 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.hudi.cli.commands;
+
+import org.springframework.shell.core.CommandMarker;
+import org.springframework.shell.core.annotation.CliCommand;
+import org.springframework.shell.core.annotation.CliOption;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * CLI command to set env.
+ */
+@Component
+public class SetSparkEnvCommand implements CommandMarker {
+
+  public static Map env = new HashMap();
+
+  @CliCommand(value = "set", help = "Set spark launcher env to cli")
+  public void setEnv(@CliOption(key = {"conf"}, help = "Env config to be set") 
final String confMap)
+  throws IllegalArgumentException {
+String[] map = confMap.split("=");
+if (map.length != 2) {
+  throw new IllegalArgumentException("Illegal set parameter, please use 
like [set SPARK_HOME=/usr/etc/spark]'");
 
 Review comment:
   remove ' ?


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services