Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caused by: java.io.IOException: Unable to connect to provided ports 10000~10010 #346

Open
wants to merge 76 commits into
base: revert-237-LIVY-255
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
cd10eed
LIVY-255. Update the docs for Livy build and Spark2 support (#241)
jerryshao Nov 30, 2016
f52c0d9
LIVY-248. Clean up how PySpark python intepreters are set. (#233)
alex-the-man Dec 1, 2016
2a8e9cf
LIVY-257. Added access log (#239)
zjffdu Dec 2, 2016
a896305
LIVY-256. Add Gzip support for HTTP response (#238)
jerryshao Dec 3, 2016
8cf0eff
LIVY-259. Name of interactive sessions are not override-able. (#242)
Dec 5, 2016
923d96c
LIVY-264. Fixed PySpark %table magic returning wrong header. (#244)
purechoc Dec 9, 2016
1ee2ed8
LIVY-268. Fixed flaky unit test. (#249)
alex-the-man Dec 9, 2016
1b72ce9
LIVY-233. SparkSession support for Job API. (#217)
jerryshao Dec 12, 2016
e82780b
LIVY-251. YARN session leaked if RSC connection times out (#234)
Dec 12, 2016
6e427ca
LIVY-261. Fixed SparkRInterpreter failed to include error message ran…
alex-the-man Dec 12, 2016
e4586cb
LIVY-250. Change livy.repl.jars to work with different scala interpre…
jerryshao Dec 13, 2016
4cc999a
LIVY-271. traceback could be json list or json object which is mislea…
zjffdu Dec 13, 2016
fe06299
Minor. Fixed flaky unit test. (#254)
alex-the-man Dec 14, 2016
e4a52bf
LIVY-270. %table shouldn't treat None as its own type. (#250)
purechoc Dec 15, 2016
de816f5
LIVY-252. HTTP auth support for Scala LivyClient. (#245)
alex-the-man Dec 15, 2016
2ae091d
LIVY-260. repl is stuck in busy state if Scala interpreter returns so…
alex-the-man Dec 15, 2016
d3cc09b
LIVY-215. Support statement canceling in interactive sessions. (#230)
jerryshao Dec 16, 2016
e0b0b80
Minor. Fixed flaky unit test. (#257)
jerryshao Dec 16, 2016
f6829a5
Bump supported Spark version to 2.1.x (#258)
jerryshao Dec 21, 2016
4eec41b
LIVY-269. Fixed SparkRInterpreter hangs forever on executing `x[`. (#…
alex-the-man Dec 21, 2016
678839c
LIVY-276. Fixed test to timeout when Livy failed to restart. (#256)
alex-the-man Dec 21, 2016
69ac11e
LIVY-165. Added session heartbeat to help notebooks to prevent leakag…
alex-the-man Dec 21, 2016
01f3b98
LIVY-282. Fixed pyspark doesn't start with Spark 1.x. (#261)
jerryshao Dec 22, 2016
c9f947e
LIVY-275. Add livy REST API to detect Livy version info (#262)
jerryshao Dec 26, 2016
6077628
LIVY-284. Make Livy server request log configurable (#263)
jerryshao Dec 27, 2016
f5dea60
LIYV-289. Fix NPE in ContextLauncher when Driver is not successfully …
jerryshao Jan 4, 2017
9974aac
LIVY-286. Update the doc to align with 0.3 code. (#267)
jerryshao Jan 5, 2017
95f1459
LIVY-285. Run unit tests and integration tests in parallel on Travis.…
jerryshao Jan 5, 2017
6215413
LIVY-295. Make livy.rsc.jars a LivyConf. (#271)
jerryshao Jan 10, 2017
89099b0
LIVY-294. HiveContext is always created instead of SQLContext for pys…
zjffdu Jan 10, 2017
b75bc11
LIVY-273. Add Spnego support for Java/scala and Python Job API client…
jerryshao Jan 11, 2017
dc0bc1d
LIVY-280. Livy session leakage issue when app submission timeout (#259)
zjffdu Jan 12, 2017
354e47d
code should be re-escaped in R interpreter (#276)
jerryshao Jan 12, 2017
4024f14
Minor. Document statement state "waiting". (#275)
alex-the-man Jan 12, 2017
c50fb1c
LIVY-292. Fix Python Job API issue and add Java/python Job API exampl…
jerryshao Jan 12, 2017
dc496a3
LIVY-300. Fixed a race condition in rsc's RPC channel. (#274)
alex-the-man Jan 13, 2017
5418a18
LIVY-302. Failed to parse Spark version with suffix like -CDH or -SNA…
purechoc Jan 19, 2017
69462b9
Minor. Remove backslash textwrap.dedent heredoc breaks python interpr…
javadba Jan 21, 2017
34f6c7f
LIVY-311. Set classpath in MiniCluster only when it is not in real cl…
zjffdu Feb 8, 2017
9575d8f
Bump to 0.4.0-SNAPSHOT for master branch (#282)
jerryshao Feb 10, 2017
807036a
LIVY-310. Kinit should be called before doing recovery check. (#285)
jerryshao Feb 13, 2017
663c613
LIVY-308. Avoid enabling Hive by default in Spark2. (#287)
jerryshao Feb 13, 2017
a36e44f
LIVY-274. Add travis CI status in README (#288)
jonalter Feb 14, 2017
693a795
Fixed a typo in the README (#289)
ajbozarth Feb 15, 2017
b872978
LIVY-316. NPE when starting kinit thread (#292)
zjffdu Feb 15, 2017
f7c434c
Minor. Relax the permission constraint of recovery state store folder…
jerryshao Feb 15, 2017
ed1c86e
LIVY-315. Fixed SparkRInterpreter to respect config enableHiveContext…
zjffdu Feb 17, 2017
14c29e4
Fix issue for some parent poms (#295)
jerryshao Feb 20, 2017
a72bbff
LIVY-306. Removed hard-coded minimum timeout value. (#290)
ajbozarth Feb 22, 2017
6bfe177
LIVY-320. Livy python-api client test failing. (#298)
akchinSTC Feb 22, 2017
bfdb5a1
LIVY-240. Improve the session gc mechanism. (#277)
jerryshao Feb 22, 2017
2aa910c
Minor. Ignore empty string in configuration join. (#299)
jerryshao Feb 23, 2017
932d397
LIVY-303. Add statement retention mechanism. (#279)
jerryshao Feb 24, 2017
d74d5a9
LIVY-293: Redirect spark-submit log to REST response Log field for in…
praveen-kanamarlapudi Feb 27, 2017
76d969e
LIVY-90. Update conf dir to use templates (#301)
ajbozarth Mar 4, 2017
126b57e
LIVY-319. Unify the indent for all POM files. (#302)
ajbozarth Mar 4, 2017
70f23b9
LIVY-272. Support Statement progress for interactive session. (#260)
jerryshao Mar 12, 2017
fbccb69
LIVY-326. Change Hadoop dependencies to Apache Hadoop (#306)
jerryshao Mar 13, 2017
2ff8f5c
LIVY-329. Fix two SSL issues. (#308)
jerryshao Mar 13, 2017
eb7e6cc
LIVY-331. Fix flaky test 'interactive session should not gc-ed if ses…
jerryshao Mar 14, 2017
b7cc00a
Make several modules push-able to repo (#305)
jerryshao Mar 16, 2017
5e6f9ed
LIVY-249. Update livy-server script to include status command and ret…
ajbozarth Mar 17, 2017
0de0e28
LIVY-313. Fixed SparkRInterpreter always returning success. (#307)
jonalter Mar 23, 2017
221aa9c
LIVY-287. Add Deprecation to Livy Configurations and update naming. (…
ajbozarth Apr 5, 2017
07f6072
LIVY-323. Fixed livy-repl doesn't start with a lot of spark packages.…
alex-the-man Apr 9, 2017
511a05f
Minor. Changed git clone command in README to use http instead of ssh…
alex-the-man Apr 18, 2017
7212e3f
LIVY-340. Add YARN queue support to interactive sessions. (#314)
praveen-kanamarlapudi Apr 18, 2017
e8c3e06
Remove guava api in Livy (#321)
jerryshao Apr 28, 2017
f5ef489
Fix two SparkR test issue regarding to different versions of R (#322)
jerryshao Apr 28, 2017
0ddcaf6
LIVY-355. Refactor statement progress tracker to fix binary compatibl…
jerryshao May 9, 2017
61b206e
LIVY-342. Create Livy UI: Create Web UI Servlet and All Sessions Page…
ajbozarth May 9, 2017
d51e998
Minor. Add session information log when session is created (#325)
jerryshao May 12, 2017
59af39d
LIVY-358. Make JettyServer Http request and response header size conf…
jerryshao May 12, 2017
2abb8a3
LIVY-358. [Follow-up] Add unit test to verify header size configurati…
jerryshao May 18, 2017
02eef9a
Make sure to install setuptools less then version 36.0.0 to avoid mod…
jerryshao Jun 2, 2017
9ae24d0
Livy:337 Binding RPCServer to user provided port and not random port …
pralabhkumar Jun 8, 2017
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
.project
.classpath
.scala_dependencies
conf/*.conf
conf/*.properties
conf/*.sh
lib_managed/
logs/
src_managed/
target/
reports/
Expand Down
17 changes: 11 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ dist: trusty
language: scala

env:
- MVN_FLAG=-Pspark-1.6
- MVN_FLAG=-Pspark-2.0
- MVN_FLAG='-Pspark-1.6 -DskipTests'
- MVN_FLAG='-Pspark-2.0 -DskipTests'
- MVN_FLAG='-Pspark-2.1 -DskipTests'
- MVN_FLAG='-Pspark-1.6 -DskipITs'
- MVN_FLAG='-Pspark-2.0 -DskipITs'
- MVN_FLAG='-Pspark-2.1 -DskipITs'

jdk:
- oraclejdk7
Expand All @@ -24,18 +28,19 @@ cache:

before_install:
- sudo apt-get -y install python3-pip python-dev
- sudo apt-get -y install libkrb5-dev
- sudo apt-get -y remove python-setuptools
- pip install --user --upgrade pip setuptools
- pip3 install --user --upgrade pip setuptools
- pip install --user --upgrade pip "setuptools < 36"
- pip3 install --user --upgrade pip "setuptools < 36"
- pip install --user codecov cloudpickle
- pip3 install --user cloudpickle

install:
- mvn $MVN_FLAG install -Dskip -DskipTests -DskipITs -Dmaven.javadoc.skip=true -B -V

before_script:
- pip install --user requests pytest flaky flake8
- pip3 install --user requests pytest flaky
- pip install --user requests pytest flaky flake8 requests-kerberos
- pip3 install --user requests pytest flaky requests-kerberos

script:
- mvn $MVN_FLAG verify -e
Expand Down
413 changes: 292 additions & 121 deletions README.rst

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
<parent>
<groupId>com.cloudera.livy</groupId>
<artifactId>livy-main</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
</parent>

<groupId>com.cloudera.livy</groupId>
<artifactId>livy-api</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
Expand Down
8 changes: 6 additions & 2 deletions api/src/main/java/com/cloudera/livy/JobContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public interface JobContext {
/** The shared SparkContext instance. */
JavaSparkContext sc();

/** The shared SQLContext inststance. */
/** The shared SQLContext instance. */
SQLContext sqlctx();

/** The shared HiveContext inststance. */
/** The shared HiveContext instance. */
HiveContext hivectx();

/** Returns the JavaStreamingContext which has already been created. */
Expand All @@ -63,4 +63,8 @@ public interface JobContext {
*/
File getLocalTmpDir();

/**
* Returns SparkSession if it existed, otherwise throws Exception.
*/
<E> E sparkSession() throws Exception;
}
4 changes: 2 additions & 2 deletions assembly/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
<parent>
<groupId>com.cloudera.livy</groupId>
<artifactId>livy-main</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>livy-assembly</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down
22 changes: 18 additions & 4 deletions bin/livy-server
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ start_livy_server() {
if [ -f "$pid" ]; then
TARGET_ID="$(cat "$pid")"
if [[ $(ps -p "$TARGET_ID" -o comm=) =~ "java" ]]; then
echo "livy_server running as process $TARGET_ID. Stop it first."
echo "livy-server running as process $TARGET_ID. Stop it first."
exit 1
fi
fi
Expand All @@ -125,6 +125,7 @@ start_livy_server() {
tail -2 "$log" | sed 's/^/ /'
echo "full log in $log"
rm -rf "$pid"
exit 1
fi
fi
}
Expand All @@ -146,13 +147,26 @@ case $option in
if [ -f $pid ]; then
TARGET_ID="$(cat "$pid")"
if [[ $(ps -p "$TARGET_ID" -o comm=) =~ "java" ]]; then
echo "stopping livy_server"
echo "stopping livy-server"
kill "$TARGET_ID" && rm -f "$pid"
else
echo "no livy_server to stop"
echo "no livy-server to stop"
fi
else
echo "no livy_server to stop"
echo "no livy-server to stop"
fi
;;

(status)
if [ -f "$pid" ]; then
TARGET_ID="$(cat "$pid")"
if [[ $(ps -p "$TARGET_ID" -o comm=) =~ "java" ]]; then
echo "livy-server is running (pid: $TARGET_ID)"
else
echo "livy-server is not running"
fi
else
echo "livy-server is not running"
fi
;;

Expand Down
9 changes: 7 additions & 2 deletions client-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
<parent>
<groupId>com.cloudera.livy</groupId>
<artifactId>livy-main</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
</parent>

<groupId>com.cloudera.livy</groupId>
<artifactId>livy-client-common</artifactId>
<version>0.3.0-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
Expand All @@ -45,5 +45,10 @@
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cloudera.livy.annotations.Private;

/**
Expand All @@ -37,6 +40,8 @@
public abstract class ClientConf<T extends ClientConf>
implements Iterable<Map.Entry<String, String>> {

protected Logger LOG = LoggerFactory.getLogger(getClass());

public static interface ConfEntry {

/** The key in the configuration file. */
Expand Down Expand Up @@ -71,24 +76,37 @@ protected ClientConf(Properties config) {
this.config = new ConcurrentHashMap<>();
if (config != null) {
for (String key : config.stringPropertyNames()) {
logDeprecationWarning(key);
this.config.put(key, config.getProperty(key));
}
}
}

public String get(String key) {
return config.get(key);
String val = config.get(key);
if (val != null) {
return val;
}
DeprecatedConf depConf = getConfigsWithAlternatives().get(key);
if (depConf != null) {
return config.get(depConf.key());
} else {
return val;
}
}

@SuppressWarnings("unchecked")
public T set(String key, String value) {
logDeprecationWarning(key);
config.put(key, value);
return (T) this;
}

@SuppressWarnings("unchecked")
public T setIfMissing(String key, String value) {
config.putIfAbsent(key, value);
if (config.putIfAbsent(key, value) == null) {
logDeprecationWarning(key);
}
return (T) this;
}

Expand Down Expand Up @@ -163,6 +181,7 @@ public T set(ConfEntry e, Object value) {
if (value == null) {
config.remove(e.key());
} else {
logDeprecationWarning(e.key());
config.put(e.key(), value.toString());
}
return (T) this;
Expand All @@ -176,7 +195,7 @@ public Iterator<Map.Entry<String, String>> iterator() {
private String get(ConfEntry e, Class<?> requestedType) {
check(getType(e.dflt()).equals(requestedType), "Invalid type conversion requested for %s.",
e.key());
return config.get(e.key());
return this.get(e.key());
}

private boolean typesMatch(Object test, Object expected) {
Expand All @@ -193,4 +212,40 @@ private void check(boolean test, String message, Object... args) {
}
}

/** Logs a warning message if the given config key is deprecated. */
private void logDeprecationWarning(String key) {
DeprecatedConf altConfs = getConfigsWithAlternatives().get(key);
if (altConfs != null) {
LOG.warn("The configuration key " + altConfs.key() + " has been deprecated as of Livy "
+ altConfs.version() + " and may be removed in the future. Please use the new key "
+ key + " instead.");
return;
}

DeprecatedConf depConfs = getDeprecatedConfigs().get(key);
if (depConfs != null) {
LOG.warn("The configuration key " + depConfs.key() + " has been deprecated as of Livy "
+ depConfs.version() + " and may be removed in the future. "
+ depConfs.deprecationMessage());
}
}

/** Maps valid key to DeprecatedConf with the deprecated key. */
protected abstract Map<String, DeprecatedConf> getConfigsWithAlternatives();

/** Maps deprecated key to DeprecatedConf with the same key. */
protected abstract Map<String, DeprecatedConf> getDeprecatedConfigs();

public static interface DeprecatedConf {

/** The key in the configuration file. */
String key();

/** The Livy version in which the key was deprecated. */
String version();

/** Message to include in the deprecation warning for configs without alternatives */
String deprecationMessage();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package com.cloudera.livy.client.common;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

Expand Down Expand Up @@ -122,6 +124,31 @@ public void testTimeWithoutDefault() {
conf.getTimeAsMs(TestConf.Entry.TIME_NO_DEFAULT);
}


@Test
public void testDeprecation() {
TestConf conf = new TestConf(null);

assertNull(conf.get("depKey"));
assertNull(conf.get("dep_alt"));
assertNull(conf.get("new-key"));
assertEquals("value", conf.get(TestConf.Entry.NEW_CONF));

TestConf depProps = new TestConf(null);
depProps.set("depKey", "dep-val");
depProps.set("dep_alt", "alt-val");
conf.setAll(depProps);
assertEquals("dep-val", conf.get("depKey"));
assertEquals("alt-val", conf.get("dep_alt"));
assertEquals("alt-val", conf.get(TestConf.Entry.NEW_CONF));
assertEquals("alt-val", conf.get("new-key"));

conf.set("new-key", "new-val");
assertEquals("new-val", conf.get(TestConf.Entry.NEW_CONF));
assertEquals("alt-val", conf.get("dep_alt"));
assertEquals("new-val", conf.get("new-key"));
}

private static class TestConf extends ClientConf<TestConf> {

static enum Entry implements ConfEntry {
Expand All @@ -131,7 +158,8 @@ static enum Entry implements ConfEntry {
INT("int", 42),
LONG("long", 84L),
TIME("time", "168ms"),
TIME_NO_DEFAULT("time2", null);
TIME_NO_DEFAULT("time2", null),
NEW_CONF("new-key", "value");

private final String key;
private final Object dflt;
Expand All @@ -153,6 +181,51 @@ private Entry(String key, Object dflt) {
super(p);
}

private static final Map<String, DeprecatedConf> configsWithAlternatives
= Collections.unmodifiableMap(new HashMap<String, DeprecatedConf>() {{
put(TestConf.Entry.NEW_CONF.key, DepConf.DEP_WITH_ALT);
}});

private static final Map<String, DeprecatedConf> deprecatedConfigs
= Collections.unmodifiableMap(new HashMap<String, DeprecatedConf>() {{
put(DepConf.DEP_NO_ALT.key, DepConf.DEP_NO_ALT);
}});

protected Map<String, DeprecatedConf> getConfigsWithAlternatives() {
return configsWithAlternatives;
}

protected Map<String, DeprecatedConf> getDeprecatedConfigs() {
return deprecatedConfigs;
}

static enum DepConf implements DeprecatedConf {
DEP_WITH_ALT("dep_alt", "0.4"),
DEP_NO_ALT("depKey", "1.0");

private final String key;
private final String version;
private final String deprecationMessage;

private DepConf(String key, String version) {
this(key, version, "");
}

private DepConf(String key, String version, String deprecationMessage) {
this.key = key;
this.version = version;
this.deprecationMessage = deprecationMessage;
}

@Override
public String key() { return key; }

@Override
public String version() { return version; }

@Override
public String deprecationMessage() { return deprecationMessage; }
}
}

}
Loading