lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject [1/2] lucene-solr:master: Revert "SOLR-10951, HADOOP-14586: Add a hack to make Hadoop's Shell work with Java 9 release"
Date Wed, 28 Jun 2017 15:47:38 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 1e93367c0 -> 85a27a231


Revert "SOLR-10951, HADOOP-14586: Add a hack to make Hadoop's Shell work with Java 9 release"

This reverts commit 1e93367c00bc48905ec66754e0143b82b8cdec55.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/02caab4c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/02caab4c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/02caab4c

Branch: refs/heads/master
Commit: 02caab4ce1601281a38200007b70950ed214de7e
Parents: 1e93367
Author: Uwe Schindler <uschindler@apache.org>
Authored: Wed Jun 28 17:46:16 2017 +0200
Committer: Uwe Schindler <uschindler@apache.org>
Committed: Wed Jun 28 17:46:16 2017 +0200

----------------------------------------------------------------------
 solr/CHANGES.txt                                |  3 -
 .../org/apache/solr/servlet/BaseSolrFilter.java |  3 -
 .../apache/solr/servlet/BaseSolrServlet.java    |  3 -
 .../org/apache/solr/util/Java9InitHack.java     | 78 --------------------
 .../java/org/apache/solr/SolrTestCaseJ4.java    |  6 --
 5 files changed, 93 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/02caab4c/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 208512c..3f25c26 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -527,9 +527,6 @@ Other Changes
   with point fields and provides control over dynamic fields used for the raw amount and
currency
   code sub-fields.  (hossman, Steve Rowe)
 
-* SOLR-10966: Add workaround for Hadoop-Common 2.7.2 incompatibility with Java 9.
-  (Uwe Schindler)
-
 ==================  6.6.1 ==================
 
 Bug Fixes

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/02caab4c/solr/core/src/java/org/apache/solr/servlet/BaseSolrFilter.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/BaseSolrFilter.java b/solr/core/src/java/org/apache/solr/servlet/BaseSolrFilter.java
index 40a2df2..6f9bbe6 100644
--- a/solr/core/src/java/org/apache/solr/servlet/BaseSolrFilter.java
+++ b/solr/core/src/java/org/apache/solr/servlet/BaseSolrFilter.java
@@ -18,8 +18,6 @@ package org.apache.solr.servlet;
 
 import javax.servlet.Filter;
 
-import org.apache.solr.util.Java9InitHack;
-
 /**
  * All Solr filters available to the user's webapp should
  * extend this class and not just implement {@link Filter}.
@@ -30,7 +28,6 @@ abstract class BaseSolrFilter implements Filter {
   
   static {
     CheckLoggingConfiguration.check();
-    Java9InitHack.initJava9();
   }
   
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/02caab4c/solr/core/src/java/org/apache/solr/servlet/BaseSolrServlet.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/servlet/BaseSolrServlet.java b/solr/core/src/java/org/apache/solr/servlet/BaseSolrServlet.java
index e175f8e..5042e93 100644
--- a/solr/core/src/java/org/apache/solr/servlet/BaseSolrServlet.java
+++ b/solr/core/src/java/org/apache/solr/servlet/BaseSolrServlet.java
@@ -18,8 +18,6 @@ package org.apache.solr.servlet;
 
 import javax.servlet.http.HttpServlet;
 
-import org.apache.solr.util.Java9InitHack;
-
 /**
  * All Solr servlets available to the user's webapp should
  * extend this class and not {@link HttpServlet}.
@@ -31,7 +29,6 @@ abstract class BaseSolrServlet extends HttpServlet {
   
   static {
     CheckLoggingConfiguration.check();
-    Java9InitHack.initJava9();
   }
   
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/02caab4c/solr/core/src/java/org/apache/solr/util/Java9InitHack.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/util/Java9InitHack.java b/solr/core/src/java/org/apache/solr/util/Java9InitHack.java
deleted file mode 100644
index 0565207..0000000
--- a/solr/core/src/java/org/apache/solr/util/Java9InitHack.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.solr.util;
-
-import java.lang.invoke.MethodHandles;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.util.Objects;
-
-import org.apache.lucene.util.Constants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class works around a bug in hadoop-common-2.7.2 where the Hadoop Shell class cannot
- * initialize on Java 9 (due to a bug while parsing Java's version number).
- * This class does some early checks and fakes the java version for a very short time
- * during class loading of Solr's web application or Solr's test framework.
- * <p>
- * Be sure to run this only in static initializers, as soon as possible after JVM startup!
- * <p>
- * Related issues: HADOOP-14586, SOLR-10966
- * <p>
- * TODO: <b>Remove this ASAP, once we have upgraded Hadoop (SOLR-10951)!</b>
- * 
- * @lucene.internal
- */
-public final class Java9InitHack {
-  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  
-  private static final String JAVA_VERSION_PROP = "java.version";
-  private static boolean done = false;
-
-  /**
-   * Runs the hack. Should be done as early as possible on JVM startup, from a static initializer
-   * to prevent concurrency issues - because we change temporarily some 'important' system
properties.
-   */
-  public static synchronized void initJava9() {
-    if (Constants.JRE_IS_MINIMUM_JAVA9 && done == false) {
-      AccessController.doPrivileged((PrivilegedAction<Void>) Java9InitHack::initPrivileged);
-      done = true;
-    }
-  }
-     
-  private static Void initPrivileged() {
-    log.info("Adding temporary workaround for Hadoop's Shell class to allow running on Java
9 (please ignore any warnings/failures).");
-    String oldVersion = System.getProperty(JAVA_VERSION_PROP);
-    try {
-      System.setProperty(JAVA_VERSION_PROP, "1.9");
-      Class.forName("org.apache.hadoop.util.Shell");
-    } catch (Throwable t) {
-      log.warn("Cannot initialize Hadoop's Shell class on Java 9.", t);
-    } finally {
-      if (!Objects.equals(System.getProperty(JAVA_VERSION_PROP), oldVersion)) {
-        System.setProperty(JAVA_VERSION_PROP, oldVersion);
-      }
-    }
-    return null;
-  }
-  
-  private Java9InitHack() {}
-    
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/02caab4c/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
----------------------------------------------------------------------
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index c8ec6c0..e9b7043 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -115,7 +115,6 @@ import org.apache.solr.schema.SchemaField;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.servlet.DirectSolrConnection;
 import org.apache.solr.util.AbstractSolrTestCase;
-import org.apache.solr.util.Java9InitHack;
 import org.apache.solr.util.LogLevel;
 import org.apache.solr.util.RandomizeSSL;
 import org.apache.solr.util.RandomizeSSL.SSLRandomizer;
@@ -161,11 +160,6 @@ import static java.util.Objects.requireNonNull;
 public abstract class SolrTestCaseJ4 extends LuceneTestCase {
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
-  
-  // this must be a static init block to be safe!
-  static {
-    Java9InitHack.initJava9();
-  }
 
   private static final List<String> DEFAULT_STACK_FILTERS = Arrays.asList(new String
[] {
       "org.junit.",


Mime
View raw message