Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/java/org/apache/livy/JobContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* Holds runtime information about the job execution context.
*
* <br>
* An instance of this class is kept on the node hosting a remote Spark context and is made
* available to jobs being executed via RemoteSparkContext#submit().
*/
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/org/apache/livy/JobHandle.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface JobHandle<T> extends Future<T> {
/**
* The current state of the submitted job.
*/
static enum State {
enum State {
SENT,
QUEUED,
STARTED,
Expand All @@ -56,7 +56,7 @@ static enum State {
* A listener for monitoring the state of the job in the remote context. Callbacks are called
* when the corresponding state change occurs.
*/
static interface Listener<T> {
interface Listener<T> {

/**
* Notifies when a job has been queued for execution on the remote context. Note that it is
Expand Down
22 changes: 6 additions & 16 deletions api/src/main/java/org/apache/livy/LivyClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public LivyClientBuilder() throws IOException {
/**
* Creates a new builder that will optionally load the default Livy and Spark configuration
* from the classpath.
*
* <br>
* Livy client configuration is stored in a file called "livy-client.conf", and Spark client
* configuration is stored in a file called "spark-defaults.conf", both in the root of the
* application's classpath. Livy configuration takes precedence over Spark's (in case
Expand All @@ -85,12 +85,9 @@ public LivyClientBuilder(boolean loadDefaults) throws IOException {
for (String file : confFiles) {
URL url = classLoader().getResource(file);
if (url != null) {
Reader r = new InputStreamReader(url.openStream(), UTF_8);
try {
config.load(r);
} finally {
r.close();
}
try (Reader r = new InputStreamReader(url.openStream(), UTF_8)) {
config.load(r);
}
}
}
}
Expand Down Expand Up @@ -123,7 +120,7 @@ public LivyClientBuilder setAll(Properties props) {
public LivyClient build() {
String uriStr = config.getProperty(LIVY_URI_KEY);
if (uriStr == null) {
throw new IllegalArgumentException("URI must be provided.");
throw new IllegalArgumentException("URI must be provided in " + LIVY_URI_KEY + ".");
}
URI uri;
try {
Expand All @@ -138,14 +135,7 @@ public LivyClient build() {
}

for (LivyClientFactory factory : CLIENT_FACTORIES) {
try {
client = factory.createClient(uri, config);
} catch (Exception e) {
if (!(e instanceof RuntimeException)) {
e = new RuntimeException(e);
}
throw (RuntimeException) e;
}
client = factory.createClient(uri, config);
if (client != null) {
break;
}
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/java/org/apache/livy/TestClientFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class TestClientFactory implements LivyClientFactory {

private static AtomicLong instanceCount = new AtomicLong();
private static final AtomicLong instanceCount = new AtomicLong();
public static long getInstanceCount() {
return instanceCount.get();
}
Expand Down
48 changes: 48 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,52 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala.maven.version}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
<goal>doc-jar</goal>
</goals>
</execution>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<recompileMode>incremental</recompileMode>
<checkMultipleScalaVersions>false</checkMultipleScalaVersions>
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
</args>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-target</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-Xlint:unchecked</javacArg>
</javacArgs>
<jvmArgs>
<jvmArg>-Xms1024m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-XX:ReservedCodeCacheSize=${CodeCacheSize}</jvmArg>
</jvmArgs>
</configuration>
</plugin>
</plugins>
</build>

</project>
45 changes: 45 additions & 0 deletions integration-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,51 @@
<skipTests>${skipITs}</skipTests>
</configuration>
</plugin>

<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala.maven.version}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
<goal>doc-jar</goal>
</goals>
</execution>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<recompileMode>incremental</recompileMode>
<checkMultipleScalaVersions>false</checkMultipleScalaVersions>
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
</args>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-target</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-Xlint:unchecked</javacArg>
</javacArgs>
<jvmArgs>
<jvmArg>-Xms1024m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-XX:ReservedCodeCacheSize=${CodeCacheSize}</jvmArg>
</jvmArgs>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class LivyRestClient(val httpClient: CloseableHttpClient, val livyEndpoint: Stri
def snapshot(): SessionSnapshot = {
val httpGet = new HttpGet(url)
val r = httpClient.execute(httpGet)
val statusLine = r.getStatusLine()
val responseBody = r.getEntity().getContent
val statusLine = r.getStatusLine
val responseBody = r.getEntity.getContent
val sessionSnapshot = mapper.readValue(responseBody, classOf[SessionSnapshot])
r.close()

Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<scalatest.version>3.0.8</scalatest.version>
<scalatra.version>2.6.5</scalatra.version>
<java.version>1.8</java.version>
<scala.maven.version>4.3.0</scala.maven.version>
<extraJavaTestArgs>
-XX:+IgnoreUnrecognizedVMOptions
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
Expand Down Expand Up @@ -907,7 +908,7 @@
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.3.0</version>
<version>${scala.maven.version}</version>
<executions>
<execution>
<goals>
Expand Down
1 change: 1 addition & 0 deletions repl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
</plugin>

</plugins>

</build>

</project>
48 changes: 48 additions & 0 deletions repl/scala-2.12/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,52 @@
<relativePath>../pom.xml</relativePath>
</parent>

<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>${scala.maven.version}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
<goal>doc-jar</goal>
</goals>
</execution>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<recompileMode>incremental</recompileMode>
<checkMultipleScalaVersions>false</checkMultipleScalaVersions>
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
</args>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-target</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-Xlint:unchecked</javacArg>
</javacArgs>
<jvmArgs>
<jvmArg>-Xms1024m</jvmArg>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-XX:ReservedCodeCacheSize=${CodeCacheSize}</jvmArg>
</jvmArgs>
</configuration>
</plugin>
</plugins>
</build>

</project>
Loading