@Test public void scalaSparkContext() { List<String> jars = List$.MODULE$.empty(); Map<String, String> environment = Map$.MODULE$.empty(); new SparkContext(new SparkConf().setMaster("local").setAppName("name")).stop(); new SparkContext("local", "name", new SparkConf()).stop(); new SparkContext("local", "name").stop(); new SparkContext("local", "name", "sparkHome").stop(); new SparkContext("local", "name", "sparkHome", jars).stop(); new SparkContext("local", "name", "sparkHome", jars, environment).stop(); } }
@Test public void scalaSparkContext() { List<String> jars = List$.MODULE$.empty(); Map<String, String> environment = Map$.MODULE$.empty(); new SparkContext(new SparkConf().setMaster("local").setAppName("name")).stop(); new SparkContext("local", "name", new SparkConf()).stop(); new SparkContext("local", "name").stop(); new SparkContext("local", "name", "sparkHome").stop(); new SparkContext("local", "name", "sparkHome", jars).stop(); new SparkContext("local", "name", "sparkHome", jars, environment).stop(); } }
private static Config config() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Properties properties = System.getProperties(); scala.collection.immutable.Map<String, Object> directSettings = scala.collection.immutable.Map$.MODULE$.empty(); // We are allowing missing application conf because it can handle both cases. boolean allowMissingApplicationConf = true; // Using play.api.Configuration.load because it is more consistent with how the // actual configuration is loaded for the application. return play.api.Configuration.load(classLoader, properties, directSettings, allowMissingApplicationConf).underlying(); }
/** * Converts a {@link java.util.Map} to an immutable Scala Map. * * See scala.collection.JavaConverters.asScalaMap if you do * not need the returned Map to be immutable. * * @return an empty Map if the input is null. */ public static <K, V> scala.collection.immutable.Map<K, V> asImmutableMap( java.util.Map<K, V> jMap ) { scala.collection.immutable.Map<K, V> sMap = scala.collection.immutable.Map$.MODULE$.empty(); if (jMap != null) { for (java.util.Map.Entry<K, V> entry : jMap.entrySet()) { sMap = sMap.$plus(new Tuple2<K, V>(entry.getKey(), entry.getValue())); } } return sMap; }
/** * Converts a {@link java.util.Map} to an immutable Scala Map. * * See scala.collection.JavaConverters.asScalaMap if you do * not need the returned Map to be immutable. * * @return an empty Map if the input is null. */ public static <K, V> scala.collection.immutable.Map<K, V> asImmutableMap( java.util.Map<K, V> jMap ) { scala.collection.immutable.Map<K, V> sMap = scala.collection.immutable.Map$.MODULE$.empty(); if (jMap != null) { for (java.util.Map.Entry<K, V> entry : jMap.entrySet()) { sMap = sMap.$plus(new Tuple2<K, V>(entry.getKey(), entry.getValue())); } } return sMap; }
/** * Converts a {@link java.util.Map} to an immutable Scala Map. * * See scala.collection.JavaConversions.asScalaMap if you do * not need the returned Map to be immutable. * * @return an empty Map if the input is null. */ public static <K, V> scala.collection.immutable.Map<K, V> asImmutableMap( java.util.Map<K, V> jMap ) { scala.collection.immutable.Map<K, V> sMap = scala.collection.immutable.Map$.MODULE$.empty(); if (jMap != null) { for (java.util.Map.Entry<K, V> entry : jMap.entrySet()) { sMap = sMap.$plus(new Tuple2<K, V>(entry.getKey(), entry.getValue())); } } return sMap; }
private static <K, V> Map<K, V> emptyMap() { Map<K, V> result = Map$.MODULE$.empty(); return result; }
/** * Returns a simple request builder. The initial request is "GET / HTTP/1.1" from * 127.0.0.1 over an insecure connection. The request is created using the given * factory. * @param requestFactory the incoming request factory */ public RequestBuilder(RequestFactory requestFactory) { req = requestFactory.createRequest( RemoteConnection$.MODULE$.apply("127.0.0.1", false, OptionConverters.toScala(Optional.empty())), "GET", RequestTarget$.MODULE$.apply("/", "/", Map$.MODULE$.empty()), "HTTP/1.1", Headers$.MODULE$.create(), TypedMap.empty().asScala(), new RequestBody(null) ); }
/** * Returns a simple request builder. The initial request is "GET / HTTP/1.1" from * 127.0.0.1 over an insecure connection. The request is created using the given * factory. * @param requestFactory the incoming request factory */ public RequestBuilder(RequestFactory requestFactory) { req = requestFactory.createRequest( RemoteConnection$.MODULE$.apply("127.0.0.1", false, OptionConverters.toScala(Optional.empty())), "GET", RequestTarget$.MODULE$.apply("/", "/", Map$.MODULE$.empty()), "HTTP/1.1", Headers$.MODULE$.create(), TypedMap.empty().asScala(), new RequestBody(null) ); }
private Application createApplication() { RequestFactory requestFactory = new DefaultRequestFactory(httpConfiguration()); SimpleInjector injector = new SimpleInjector(NewInstanceInjector$.MODULE$, Map$.MODULE$.empty()); return new play.api.DefaultApplication( environment().asScala(), applicationLifecycle().asScala(), injector, configuration(), requestFactory, httpRequestHandler().asScala(), scalaHttpErrorHandler(), actorSystem(), materializer(), coordinatedShutdown() ).asJava(); }
private Application createApplication() { RequestFactory requestFactory = new DefaultRequestFactory(httpConfiguration()); SimpleInjector injector = new SimpleInjector(NewInstanceInjector$.MODULE$, Map$.MODULE$.empty()); return new play.api.DefaultApplication( environment().asScala(), applicationLifecycle().asScala(), injector, configuration(), requestFactory, httpRequestHandler().asScala(), scalaHttpErrorHandler(), actorSystem(), materializer(), coordinatedShutdown() ).asJava(); }
/** * Returns a simple request builder. The initial request is "GET / HTTP/1.1" from * 127.0.0.1 over an insecure connection. The request is created using the given * factory. * @param requestFactory the incoming request factory */ public RequestBuilder(RequestFactory requestFactory) { req = requestFactory.createRequest( RemoteConnection$.MODULE$.apply("127.0.0.1", false, OptionConverters.toScala(Optional.empty())), "GET", RequestTarget$.MODULE$.apply("/", "/", Map$.MODULE$.empty()), "HTTP/1.1", Headers$.MODULE$.create(), TypedMap.empty().asScala(), new RequestBody(null) ); }
private Application createApplication() { RequestFactory requestFactory = new DefaultRequestFactory(httpConfiguration()); SimpleInjector injector = new SimpleInjector(NewInstanceInjector$.MODULE$, Map$.MODULE$.empty()); return new play.api.DefaultApplication( environment().asScala(), applicationLifecycle().asScala(), injector, configuration(), requestFactory, httpRequestHandler().asScala(), scalaHttpErrorHandler(), actorSystem(), materializer(), coordinatedShutdown() ).asJava(); }
private static Config config() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Properties properties = System.getProperties(); scala.collection.immutable.Map<String, Object> directSettings = scala.collection.immutable.Map$.MODULE$.empty(); // We are allowing missing application conf because it can handle both cases. boolean allowMissingApplicationConf = true; // Using play.api.Configuration.load because it is more consistent with how the // actual configuration is loaded for the application. return play.api.Configuration.load(classLoader, properties, directSettings, allowMissingApplicationConf).underlying(); }
private static Config config() { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); Properties properties = System.getProperties(); scala.collection.immutable.Map<String, Object> directSettings = scala.collection.immutable.Map$.MODULE$.empty(); // We are allowing missing application conf because it can handle both cases. boolean allowMissingApplicationConf = true; // Using play.api.Configuration.load because it is more consistent with how the // actual configuration is loaded for the application. return play.api.Configuration.load(classLoader, properties, directSettings, allowMissingApplicationConf).underlying(); }