You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2022/07/26 05:07:50 UTC

[orc] branch branch-1.8 updated: ORC-1226: Add a deprecation warning for Hadoop 2.7.2 and below

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new 10efea576 ORC-1226: Add a deprecation warning for Hadoop 2.7.2 and below
10efea576 is described below

commit 10efea57632336777330ddbb1707fb0792db6c8a
Author: William Hyun <wi...@apache.org>
AuthorDate: Mon Jul 25 22:07:35 2022 -0700

    ORC-1226: Add a deprecation warning for Hadoop 2.7.2 and below
    
    ### What changes were proposed in this pull request?
    This PR aims to add a deprecation warning for Hadoop 2.7.2 and below at Apache ORC 1.7.6.
    
    ### Why are the changes needed?
    To remove old Hadoop dependency from 1.8.0.
    
    ### How was this patch tested?
    Pass the CIs and test like below:
    
    ```
    $ jshell -c core/target/orc-core-1.9.0-SNAPSHOT.jar:shims/target/orc-shims-1.9.0-SNAPSHOT.jar:~/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:~/.m2/repository/org/slf4j/slf4j-simple/1.7.36/slf4j-simple-1.7.36.jar:~/.m2/repository/org/apache/hadoop/hadoop-common/2.2.0/hadoop-common-2.2.0.jar:~/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
    |  Welcome to JShell -- Version 11.0.15
    |  For an introduction type: /help intro
    
    jshell> org.apache.orc.impl.HadoopShimsFactory.get()
    [main] WARN org.apache.orc.impl.HadoopShimsFactory - Hadoop 2.2.0 support is deprecated. Please upgrade to Hadoop 2.7.3 or above.
    $1 ==> org.apache.orc.impl.HadoopShimsPre2_3646d64ab
    ```
    
    Closes #1194 from williamhyun/deprecation.
    
    Authored-by: William Hyun <wi...@apache.org>
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
    (cherry picked from commit 601870d8f809563de65ea8e83cdb1cdf14a9a2ef)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 java/core/src/java/org/apache/orc/impl/HadoopShimsFactory.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/java/core/src/java/org/apache/orc/impl/HadoopShimsFactory.java b/java/core/src/java/org/apache/orc/impl/HadoopShimsFactory.java
index 4d2cabdca..f146c7fd8 100644
--- a/java/core/src/java/org/apache/orc/impl/HadoopShimsFactory.java
+++ b/java/core/src/java/org/apache/orc/impl/HadoopShimsFactory.java
@@ -19,11 +19,15 @@
 package org.apache.orc.impl;
 
 import org.apache.hadoop.util.VersionInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The factory for getting the proper version of the Hadoop shims.
  */
 public class HadoopShimsFactory {
+  private static final Logger LOG = LoggerFactory.getLogger(HadoopShimsFactory.class);
+
   private static final String CURRENT_SHIM_NAME =
       "org.apache.orc.impl.HadoopShimsCurrent";
   private static final String PRE_2_6_SHIM_NAME =
@@ -48,6 +52,10 @@ public class HadoopShimsFactory {
       String[] versionParts = VersionInfo.getVersion().split("[.]");
       int major = Integer.parseInt(versionParts[0]);
       int minor = Integer.parseInt(versionParts[1]);
+      if (major < 2 || (major == 2 && minor < 7)) {
+        LOG.warn("Hadoop " + VersionInfo.getVersion() + " support is deprecated. " +
+            "Please upgrade to Hadoop 2.7.3 or above.");
+      }
       if (major < 2 || (major == 2 && minor < 3)) {
         SHIMS = new HadoopShimsPre2_3();
       } else if (major == 2 && minor < 6) {