Search in sources :

Example 1 with LivySessionController

use of org.apache.nifi.controller.livy.LivySessionController in project nifi by apache.

the class TestExecuteSparkInteractive method before.

@Before
public void before() throws Exception {
    runner = TestRunners.newTestRunner(ExecuteSparkInteractive.class);
    LivySessionController livyControllerService = new LivySessionController();
    runner.addControllerService("livyCS", livyControllerService);
    runner.setProperty(livyControllerService, LivySessionController.LIVY_HOST, url.substring(url.indexOf("://") + 3, url.lastIndexOf(":")));
    runner.setProperty(livyControllerService, LivySessionController.LIVY_PORT, url.substring(url.lastIndexOf(":") + 1));
    runner.enableControllerService(livyControllerService);
    runner.setProperty(ExecuteSparkInteractive.LIVY_CONTROLLER_SERVICE, "livyCS");
    server.clearHandlers();
}
Also used : LivySessionController(org.apache.nifi.controller.livy.LivySessionController) Before(org.junit.Before)

Example 2 with LivySessionController

use of org.apache.nifi.controller.livy.LivySessionController in project nifi by apache.

the class TestExecuteSparkInteractiveSSL method before.

@Before
public void before() throws Exception {
    runner = TestRunners.newTestRunner(ExecuteSparkInteractive.class);
    final StandardSSLContextService sslService = new StandardSSLContextService();
    runner.addControllerService("ssl-context", sslService, sslProperties);
    runner.enableControllerService(sslService);
    // Allow time for the controller service to fully initialize
    Thread.sleep(500);
    LivySessionController livyControllerService = new LivySessionController();
    runner.addControllerService("livyCS", livyControllerService);
    runner.setProperty(livyControllerService, LivySessionController.LIVY_HOST, url.substring(url.indexOf("://") + 3, url.lastIndexOf(":")));
    runner.setProperty(livyControllerService, LivySessionController.LIVY_PORT, url.substring(url.lastIndexOf(":") + 1));
    runner.setProperty(livyControllerService, LivySessionController.SSL_CONTEXT_SERVICE, "ssl-context");
    runner.enableControllerService(livyControllerService);
    runner.setProperty(ExecuteSparkInteractive.LIVY_CONTROLLER_SERVICE, "livyCS");
    server.clearHandlers();
}
Also used : LivySessionController(org.apache.nifi.controller.livy.LivySessionController) StandardSSLContextService(org.apache.nifi.ssl.StandardSSLContextService) Before(org.junit.Before)

Aggregations

LivySessionController (org.apache.nifi.controller.livy.LivySessionController)2 Before (org.junit.Before)2 StandardSSLContextService (org.apache.nifi.ssl.StandardSSLContextService)1