pig-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject svn commit: r1786955 - in /pig/branches/spark/src/org/apache/pig/backend/hadoop: executionengine/spark/ executionengine/spark/streaming/ streaming/
Date Tue, 14 Mar 2017 21:42:07 GMT
Author: zly
Date: Tue Mar 14 21:42:07 2017
New Revision: 1786955

URL: http://svn.apache.org/viewvc?rev=1786955&view=rev
Log:
PIG-5179:BigData_Streaming_1 is failing (Nandor via Liyun)

Added:
    pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/streaming/
    pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/streaming/SparkExecutableManager.java
Modified:
    pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/SparkExecutionEngine.java
    pig/branches/spark/src/org/apache/pig/backend/hadoop/streaming/HadoopExecutableManager.java

Modified: pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/SparkExecutionEngine.java
URL: http://svn.apache.org/viewvc/pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/SparkExecutionEngine.java?rev=1786955&r1=1786954&r2=1786955&view=diff
==============================================================================
--- pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/SparkExecutionEngine.java
(original)
+++ pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/SparkExecutionEngine.java
Tue Mar 14 21:42:07 2017
@@ -20,7 +20,9 @@ package org.apache.pig.backend.hadoop.ex
 import java.util.UUID;
 
 import org.apache.pig.backend.hadoop.executionengine.HExecutionEngine;
+import org.apache.pig.backend.hadoop.executionengine.spark.streaming.SparkExecutableManager;
 import org.apache.pig.impl.PigContext;
+import org.apache.pig.impl.streaming.ExecutableManager;
 import org.apache.pig.tools.pigstats.PigStats;
 import org.apache.pig.tools.pigstats.ScriptState;
 import org.apache.pig.tools.pigstats.spark.SparkPigStats;
@@ -41,6 +43,11 @@ public class SparkExecutionEngine extend
     }
 
     @Override
+    public ExecutableManager getExecutableManager() {
+        return new SparkExecutableManager();
+    }
+
+    @Override
     public PigStats instantiatePigStats() {
         return new SparkPigStats();
     }

Added: pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/streaming/SparkExecutableManager.java
URL: http://svn.apache.org/viewvc/pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/streaming/SparkExecutableManager.java?rev=1786955&view=auto
==============================================================================
--- pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/streaming/SparkExecutableManager.java
(added)
+++ pig/branches/spark/src/org/apache/pig/backend/hadoop/executionengine/spark/streaming/SparkExecutableManager.java
Tue Mar 14 21:42:07 2017
@@ -0,0 +1,32 @@
+/*
+ * 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.pig.backend.hadoop.executionengine.spark.streaming;
+
+import org.apache.pig.backend.hadoop.streaming.HadoopExecutableManager;
+import org.apache.spark.TaskContext;
+
+public class SparkExecutableManager extends HadoopExecutableManager {
+    @Override
+    protected boolean writeErrorToHDFS(int limit, String taskId) {
+        if (command.getPersistStderr()) {
+            int tipId = TaskContext.get().attemptNumber();
+            return tipId < command.getLogFilesLimit();
+        }
+        return false;
+    }
+}

Modified: pig/branches/spark/src/org/apache/pig/backend/hadoop/streaming/HadoopExecutableManager.java
URL: http://svn.apache.org/viewvc/pig/branches/spark/src/org/apache/pig/backend/hadoop/streaming/HadoopExecutableManager.java?rev=1786955&r1=1786954&r2=1786955&view=diff
==============================================================================
--- pig/branches/spark/src/org/apache/pig/backend/hadoop/streaming/HadoopExecutableManager.java
(original)
+++ pig/branches/spark/src/org/apache/pig/backend/hadoop/streaming/HadoopExecutableManager.java
Tue Mar 14 21:42:07 2017
@@ -172,7 +172,7 @@ public class HadoopExecutableManager ext
      * @return <code>true</code> if stderr data of task should be persisted on

      *         HDFS, <code>false</code> otherwise
      */
-    private boolean writeErrorToHDFS(int limit, String taskId) {
+    protected boolean writeErrorToHDFS(int limit, String taskId) {
         if (command.getPersistStderr() && taskId != null) {
             int tipId = TaskAttemptID.forName(taskId).getTaskID().getId();
             return tipId < command.getLogFilesLimit();



Mime
View raw message