Procházet zdrojové kódy

Merge -r -r583423:583424 and -r593745:593747 from 0.15 branch to 0.14 branch to fix HADOOP-2001, HADOOP-2140, and HADOOP-2169

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/branches/branch-0.14@593853 13f79535-47bb-0310-9956-ffa450edef68
Nigel Daley před 17 roky
rodič
revize
c53d785aba

+ 16 - 0
CHANGES.txt

@@ -1,6 +1,22 @@
 Hadoop Change Log
 
 
+Release 0.14.4 -
+
+  BUG FIXES
+
+    HADOOP-2140.  Add missing Apache Licensing text at the front of several
+    C and C++ files.
+
+    HADOOP-2169.  Fix the DT_SONAME field of libhdfs.so to set it to the
+    correct value of 'libhdfs.so', currently it is set to the absolute path of
+    libhdfs.so. (acmurthy)
+
+    HADOOP-2001.  Make the job priority updates and job kills synchronized on
+    the JobTracker. Deadlock was seen in the JobTracker because of the lack of
+    this synchronization.  (Arun C Murthy via ddas)
+
+
 Release 0.14.3 - 2007-10-19
 
   BUG FIXES

+ 4 - 3
src/c++/libhdfs/Makefile

@@ -31,8 +31,9 @@ PLATFORM = $(shell echo $$OS_NAME | tr [A-Z] [a-z])
 CPPFLAGS = -m32 -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(PLATFORM)
 
 LIB_NAME = hdfs
-SO_TARGET = $(LIBHDFS_BUILD_DIR)/lib$(LIB_NAME).so.$(SHLIB_VERSION)
-SO = $(LIBHDFS_BUILD_DIR)/lib$(LIB_NAME).so
+SO_NAME = lib$(LIB_NAME).so
+SO_TARGET = $(LIBHDFS_BUILD_DIR)/$(SO_NAME).$(SHLIB_VERSION)
+SO = $(LIBHDFS_BUILD_DIR)/$(SO_NAME)
 
 RM = rm -rf
 LINK = ln -sf
@@ -52,7 +53,7 @@ HDFS_WRITE_TEST = $(LIBHDFS_BUILD_DIR)/hdfs_write
 all: $(SO_TARGET) $(HDFS_TEST) $(HDFS_READ_TEST) $(HDFS_WRITE_TEST)
 
 $(SO_TARGET): $(COBJS)
-	$(LD) $(LDFLAGS) -o $(SO_TARGET) -Wl,-soname,$(SO_TARGET) $(COBJS) \
+	$(LD) $(LDFLAGS) -o $(SO_TARGET) -Wl,-soname,$(SO_NAME) $(COBJS) \
 	&& $(LINK) $(SO_TARGET) $(SO)
 	
 $(LIBHDFS_BUILD_DIR)/%.o: %.c

+ 17 - 0
src/c++/pipes/api/hadoop/Pipes.hh

@@ -1,3 +1,20 @@
+/**
+ * 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.
+ */
 #ifndef HADOOP_PIPES_HH
 #define HADOOP_PIPES_HH
 

+ 17 - 0
src/c++/pipes/api/hadoop/TemplateFactory.hh

@@ -1,3 +1,20 @@
+/**
+ * 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.
+ */
 #ifndef HADOOP_PIPES_TEMPLATE_FACTORY_HH
 #define HADOOP_PIPES_TEMPLATE_FACTORY_HH
 

+ 18 - 0
src/c++/pipes/impl/HadoopPipes.cc

@@ -1,3 +1,21 @@
+/**
+ * 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.
+ */
+
 #include "hadoop/Pipes.hh"
 #include "hadoop/SerialUtils.hh"
 #include "hadoop/StringUtils.hh"

+ 17 - 0
src/examples/pipes/impl/wordcount-nopipe.cc

@@ -1,3 +1,20 @@
+/**
+ * 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.
+ */
 #include "hadoop/Pipes.hh"
 #include "hadoop/TemplateFactory.hh"
 #include "hadoop/StringUtils.hh"

+ 18 - 0
src/examples/pipes/impl/wordcount-part.cc

@@ -1,3 +1,21 @@
+/**
+ * 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.
+ */
+
 #include "hadoop/Pipes.hh"
 #include "hadoop/TemplateFactory.hh"
 #include "hadoop/StringUtils.hh"

+ 18 - 0
src/examples/pipes/impl/wordcount-simple.cc

@@ -1,3 +1,21 @@
+/**
+ * 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.
+ */
+
 #include "hadoop/Pipes.hh"
 #include "hadoop/TemplateFactory.hh"
 #include "hadoop/StringUtils.hh"

+ 18 - 1
src/java/org/apache/hadoop/mapred/JobTracker.java

@@ -1495,7 +1495,7 @@ public class JobTracker implements MRConstants, InterTrackerProtocol, JobSubmiss
   /**
    * Sort jobs by priority and then by start time.
    */
-  public void resortPriority() {
+  private synchronized void resortPriority() {
     Comparator<JobInProgress> comp = new Comparator<JobInProgress>() {
       public int compare(JobInProgress o1, JobInProgress o2) {
         int res = o1.getPriority().compareTo(o2.getPriority());
@@ -1696,6 +1696,23 @@ public class JobTracker implements MRConstants, InterTrackerProtocol, JobSubmiss
     return jobs.get(jobid);
   }
 
+  /**
+   * Change the run-time priority of the given job.
+   * @param jobId job id
+   * @param priority new {@link JobPriority} for the job
+   */
+  synchronized void setJobPriority(String jobId, JobPriority priority) {
+    JobInProgress job = jobs.get(jobId);
+    if (job != null) {
+      job.setPriority(priority);
+      
+      // Re-sort jobs to reflect this change
+      resortPriority();
+    } else {
+      LOG.warn("Trying to change the priority of an unknown job: " + jobId);
+    }
+  }
+  
   ////////////////////////////////////////////////////
   // Methods to track all the TaskTrackers
   ////////////////////////////////////////////////////

+ 18 - 0
src/native/src/org/apache/hadoop/io/compress/lzo/LzoCompressor.c

@@ -1,3 +1,21 @@
+/**
+ * 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.
+ */
+
 #if defined HAVE_CONFIG_H
   #include <config.h>
 #endif

+ 18 - 0
src/native/src/org/apache/hadoop/io/compress/lzo/LzoDecompressor.c

@@ -1,3 +1,21 @@
+/**
+ * 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.
+ */
+
 #if defined HAVE_CONFIG_H
   #include <config.h>
 #endif

+ 4 - 4
src/webapps/job/jobdetails.jsp

@@ -104,8 +104,8 @@
     
     String action = request.getParameter("action");
     if("changeprio".equalsIgnoreCase(action)) {
-	  job.setPriority(JobPriority.valueOf(request.getParameter("prio")));
-	  tracker.resortPriority();
+      tracker.setJobPriority(jobId, 
+                             JobPriority.valueOf(request.getParameter("prio")));
     }
     
     if(JspHelper.conf.getBoolean(PRIVATE_ACTIONS_KEY, false)) {
@@ -114,8 +114,8 @@
   	      printConfirm(out, jobId);
     	    return;
 	    }
-  	  else if(action != null && action.equalsIgnoreCase("kill")) {
-				job.kill();
+  	    else if(action != null && action.equalsIgnoreCase("kill")) {
+	      tracker.killJob(jobId);
 	    }
     }
 %>