All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lucidworks.spark.util.Utils Maven / Gradle / Ivy

package com.lucidworks.spark.util;


import scala.collection.JavaConverters$;

public class Utils {
  /**
   * 

* Gets the class for the given name using the Context ClassLoader on this thread or, * if not present, the ClassLoader that loaded Spark Solr. *

*

Copied from Spark org.apache.spark.util.Utils.scala

*/ public static Class classForName(String className) throws ClassNotFoundException { return Class.forName(className, true, getContextOrSparkSolrClassLoader()); } /** *

* Get the Context ClassLoader on this thread or, if not present, the ClassLoader that * loaded spark-solr. *

*

* This should be used whenever passing a ClassLoader to Class.forName or finding the currently * active loader when setting up ClassLoader delegation chains. *

*

Copied from Spark org.apache.spark.util.Utils.scala

*/ public static ClassLoader getContextOrSparkSolrClassLoader() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); return classLoader == null ? getSparkSolrClassLoader() : classLoader; } /** Get the ClassLoader that loaded spark-solr. */ public static ClassLoader getSparkSolrClassLoader() { return Utils.class.getClassLoader(); } public static scala.collection.immutable.Map convertJavaMapToScalaImmmutableMap(final java.util.Map m) { return JavaConverters$.MODULE$.mapAsScalaMapConverter(m).asScala().toMap(scala.Predef$.MODULE$.$conforms()); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy