use of com.thinkbiganalytics.kylo.spark.client.jersey.LivyRestClient in project kylo by Teradata.
the class SparkLivyConfig method livyHeartbeatMonitor.
@Bean
public LivyHeartbeatMonitor livyHeartbeatMonitor() {
// LivyHeartbeatMonitor gets it's own jersey client
LivyProperties livyProperties = livyProperties();
final JerseyClientConfig config = new JerseyClientConfig();
config.setHost(livyProperties.getHostname());
config.setPort(livyProperties.getPort());
if (livyProperties().getTruststorePassword() != null) {
config.setHttps(true);
config.setTruststorePath(livyProperties.getTruststorePath());
config.setTruststorePassword(livyProperties.getTruststorePassword());
config.setTrustStoreType(livyProperties.getTruststoreType());
}
// end if
// all clients will have kerberos
LivyRestClient.setKerberosSparkProperties(kerberosSparkProperties());
JerseyRestClient livyRestClient = new LivyRestClient(config);
return new LivyHeartbeatMonitor(livyClient(), livyRestClient, livyServer(livyProperties()), livyProperties());
}
use of com.thinkbiganalytics.kylo.spark.client.jersey.LivyRestClient in project kylo by Teradata.
the class SparkLivyProcessManager method getClient.
/**
* Gets or creates a Jersey REST client for the specified Spark Shell process.
*
* @param process the Spark Shell process
* @return the Jersey REST client
*/
@Nonnull
JerseyRestClient getClient(@Nonnull final SparkShellProcess process) {
return clients.computeIfAbsent(process, target -> {
final JerseyClientConfig config = new JerseyClientConfig();
config.setHost(target.getHostname());
config.setPort(target.getPort());
if (livyProperties.getTruststorePassword() != null) {
config.setHttps(true);
config.setTruststorePath(livyProperties.getTruststorePath());
config.setTruststorePassword(livyProperties.getTruststorePassword());
config.setTrustStoreType(livyProperties.getTruststoreType());
}
// end if
// TODO: we don't need a Spring bean of the rest client if we are doing this ...
// all clients will have kerberos
LivyRestClient.setKerberosSparkProperties(kerberosSparkProperties);
return new LivyRestClient(config);
});
}
Aggregations