0

Below is my code. LivyClient is not able to upload jar with dependency and it throws exception java.util.concurrent.ExecutionException. Please help to resolve this issue.

public class LivyConfig {
@Bean
public LivyClient client() throws URISyntaxException, IOException {
    
    URI uri = new URI("http://localhost:8998");
    
Map<String,String> config = new HashMap<String,String>();
config.put("spark.app.name","livy-poc");        
config.put("livy.client.http.connection.timeout", "180s");
config.put("livy.client.http.connection.socket.timeout", "180s");
config.put("spark.driver.memory", "4g");

config.put("spark.hadoop.mapreduce.fileoutputcommitter.algorithm.version", "2");
config.put("spark.hadoop.fs.s3a.impl", "org.apache.hadoop.fs.s3a.S3AFileSystem");
config.put("fs.s3a.access.key", "<access_key>");
config.put("fs.s3a.secret.key", "<secret_key>");
    
    LivyClient client = new LivyClientBuilder(false).setURI(uri).setAll(config).build();        
    
    try {
        //client.uploadJar(new File("/mnt/vol1/LivyDemoApp.jar")).get(60, TimeUnit.SECONDS);//It's working
        client.uploadJar(new File("/mnt/vol1/LivyDemoApp-jar-with-dependencies.jar")).get(180, TimeUnit.SECONDS);//Not working
    } catch (Exception e) {
        e.printStackTrace();
    }
    return client;
}   

}

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

0 Answers0