Bläddra i källkod

AMBARI-7136. pig-properties config is not available, after upgrade 1.6.0 -> 1.7.0.(vbrodetskyi)

Vitaly Brodetskyi 10 år sedan
förälder
incheckning
2d99741ab3

+ 22 - 0
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog161.java

@@ -291,6 +291,28 @@ public class UpgradeCatalog161 extends AbstractUpgradeCatalog {
     updateConfigurationProperties("hbase-site", Collections.singletonMap("hbase.master.info.port", "60010"), false, false);
     updateConfigurationProperties("global", Collections.singletonMap("oozie_admin_port", "11001"), false, false);
     updateConfigurationProperties("hive-site", Collections.singletonMap("hive.heapsize", "1024"), false, false);
+    updateConfigurationProperties("pig-properties", Collections.singletonMap("pig-content", "\n# Licensed to the Apache " +
+            "Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# " +
+            "distributed with this work for additional information\n# regarding copyright ownership.  The ASF " +
+            "licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may " +
+            "not use this file except in compliance\n# with the License.  You may obtain a copy of the License " +
+            "at\n#\n#http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to " +
+            "in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT " +
+            "WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# " +
+            "specific language governing permissions and limitations\n# under the License.\n\n# Pig default " +
+            "configuration file. All values can be overwritten by pig.properties and command line arguments.\n# " +
+            "see bin/pig -help\n\n# brief logging (no timestamps)\nbrief=false\n\n# debug level, INFO is default" +
+            "\ndebug=INFO\n\n# verbose print all log messages to screen (default to print only INFO and above to " +
+            "screen)\nverbose=false\n\n# exectype local|mapreduce, mapreduce is default\nexectype=mapreduce\n\n# " +
+            "Enable insertion of information about script into hadoop job conf \npig.script.info.enabled=true\n\n# " +
+            "Do not spill temp files smaller than this size (bytes)\npig.spill.size.threshold=5000000\n\n# " +
+            "EXPERIMENT: Activate garbage collection when spilling a file bigger than this size (bytes)\n# " +
+            "This should help reduce the number of files being spilled.\npig.spill.gc.activation.size=40000000\n\n# " +
+            "the following two parameters are to help estimate the reducer number\npig.exec.reducers.bytes.per." +
+            "reducer=1000000000\npig.exec.reducers.max=999\n\n# Temporary location to store the intermediate " +
+            "data.\npig.temp.dir=/tmp/\n\n# Threshold for merging FRJoin fragment files\npig.files.concatenation." +
+            "threshold=100\npig.optimistic.files.concatenation=false;\n\npig.disable.counter=false\n\n" +
+            "hcat.bin=/usr/bin/hcat"), true, true);
   }
 
   @Override

+ 24 - 0
ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog161Test.java

@@ -155,6 +155,30 @@ public class UpgradeCatalog161Test {
         Collections.singletonMap("hive.heapsize", "1024"), false, false);
     expectLastCall();
 
+    upgradeCatalog.updateConfigurationProperties("pig-properties", Collections.singletonMap("pig-content", "\n# Licensed to the Apache " +
+            "Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# " +
+            "distributed with this work for additional information\n# regarding copyright ownership.  The ASF " +
+            "licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may " +
+            "not use this file except in compliance\n# with the License.  You may obtain a copy of the License " +
+            "at\n#\n#http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to " +
+            "in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT " +
+            "WARRANTIES OR CONDITIONS OF ANY\n# KIND, either express or implied.  See the License for the\n# " +
+            "specific language governing permissions and limitations\n# under the License.\n\n# Pig default " +
+            "configuration file. All values can be overwritten by pig.properties and command line arguments.\n# " +
+            "see bin/pig -help\n\n# brief logging (no timestamps)\nbrief=false\n\n# debug level, INFO is default" +
+            "\ndebug=INFO\n\n# verbose print all log messages to screen (default to print only INFO and above to " +
+            "screen)\nverbose=false\n\n# exectype local|mapreduce, mapreduce is default\nexectype=mapreduce\n\n# " +
+            "Enable insertion of information about script into hadoop job conf \npig.script.info.enabled=true\n\n# " +
+            "Do not spill temp files smaller than this size (bytes)\npig.spill.size.threshold=5000000\n\n# " +
+            "EXPERIMENT: Activate garbage collection when spilling a file bigger than this size (bytes)\n# " +
+            "This should help reduce the number of files being spilled.\npig.spill.gc.activation.size=40000000\n\n# " +
+            "the following two parameters are to help estimate the reducer number\npig.exec.reducers.bytes.per." +
+            "reducer=1000000000\npig.exec.reducers.max=999\n\n# Temporary location to store the intermediate " +
+            "data.\npig.temp.dir=/tmp/\n\n# Threshold for merging FRJoin fragment files\npig.files.concatenation." +
+            "threshold=100\npig.optimistic.files.concatenation=false;\n\npig.disable.counter=false\n\n" +
+            "hcat.bin=/usr/bin/hcat"), true, true);
+    expectLastCall();
+
     replay(upgradeCatalog, dbAccessor, configuration, injector, provider, em,
       et, query);