aboutsummaryrefslogtreecommitdiff
path: root/repl
diff options
context:
space:
mode:
authorprashant <prashant.iiith@gmail.com>2013-03-19 12:29:08 +0530
committerprashant <prashant.iiith@gmail.com>2013-03-19 12:29:08 +0530
commit432a227320e505a1790d6fb22463ab3eba4fc830 (patch)
tree9220132a497772f410ecf330d3e5ab3938c1d3d5 /repl
parent15530c2b23d1f3871a51fd24d14ce11b8ffaff4a (diff)
downloadspark-432a227320e505a1790d6fb22463ab3eba4fc830.tar.gz
spark-432a227320e505a1790d6fb22463ab3eba4fc830.tar.bz2
spark-432a227320e505a1790d6fb22463ab3eba4fc830.zip
fixed autocompletion apparent hang due to logging
Diffstat (limited to 'repl')
-rw-r--r--repl/lib/scala-jline.jarbin158463 -> 0 bytes
-rw-r--r--repl/src/main/scala/spark/repl/SparkILoopInit.scala8
-rw-r--r--repl/src/main/scala/spark/repl/SparkJLineCompletion.scala9
3 files changed, 9 insertions, 8 deletions
diff --git a/repl/lib/scala-jline.jar b/repl/lib/scala-jline.jar
deleted file mode 100644
index 2f18c95cdd..0000000000
--- a/repl/lib/scala-jline.jar
+++ /dev/null
Binary files differ
diff --git a/repl/src/main/scala/spark/repl/SparkILoopInit.scala b/repl/src/main/scala/spark/repl/SparkILoopInit.scala
index b52c477474..b275faf981 100644
--- a/repl/src/main/scala/spark/repl/SparkILoopInit.scala
+++ b/repl/src/main/scala/spark/repl/SparkILoopInit.scala
@@ -31,7 +31,9 @@ trait SparkILoopInit {
val welcomeMsg = "Using Scala %s (%s, Java %s)".format(
versionString, javaVmName, javaVersion)
echo(welcomeMsg)
- }
+ echo("Type in expressions to have them evaluated.")
+ echo("Type :help for more information.")
+ }
protected def asyncMessage(msg: String) {
if (isReplInfo || isReplPower)
@@ -119,8 +121,6 @@ trait SparkILoopInit {
""")
command("import spark.SparkContext._");
}
- // echo("Type in expressions to have them evaluated.")
- // echo("Type :help for more information.")
}
// code to be executed only after the interpreter is initialized
@@ -131,7 +131,7 @@ trait SparkILoopInit {
}
protected def runThunks(): Unit = synchronized {
if (pendingThunks.nonEmpty)
- println("Clearing " + pendingThunks.size + " thunks.")
+ logDebug("Clearing " + pendingThunks.size + " thunks.")
while (pendingThunks.nonEmpty) {
val thunk = pendingThunks.head
diff --git a/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala b/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala
index 98638d90f9..0e1170688d 100644
--- a/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala
+++ b/repl/src/main/scala/spark/repl/SparkJLineCompletion.scala
@@ -14,10 +14,11 @@ import scala.tools.jline._
import scala.tools.jline.console.completer._
import Completion._
import scala.collection.mutable.ListBuffer
+import spark.Logging
// REPL completor - queries supplied interpreter for valid
// completions based on current contents of buffer.
-class SparkJLineCompletion(val intp: SparkIMain) extends Completion with CompletionOutput {
+class SparkJLineCompletion(val intp: SparkIMain) extends Completion with CompletionOutput with Logging {
val global: intp.global.type = intp.global
import global._
import definitions.{ PredefModule, AnyClass, AnyRefClass, ScalaPackage, JavaLangPackage }
@@ -318,7 +319,7 @@ class SparkJLineCompletion(val intp: SparkIMain) extends Completion with Complet
// This is jline's entry point for completion.
override def complete(buf: String, cursor: Int): Candidates = {
verbosity = if (isConsecutiveTabs(buf, cursor)) verbosity + 1 else 0
- Console.println("\ncomplete(%s, %d) last = (%s, %d), verbosity: %s".format(buf, cursor, lastBuf, lastCursor, verbosity))
+ logDebug("\ncomplete(%s, %d) last = (%s, %d), verbosity: %s".format(buf, cursor, lastBuf, lastCursor, verbosity))
// we don't try lower priority completions unless higher ones return no results.
def tryCompletion(p: Parsed, completionFunction: Parsed => List[String]): Option[Candidates] = {
@@ -331,7 +332,7 @@ class SparkJLineCompletion(val intp: SparkIMain) extends Completion with Complet
val advance = commonPrefix(winners)
lastCursor = p.position + advance.length
lastBuf = (buf take p.position) + advance
- Console.println("tryCompletion(%s, _) lastBuf = %s, lastCursor = %s, p.position = %s".format(
+ logDebug("tryCompletion(%s, _) lastBuf = %s, lastCursor = %s, p.position = %s".format(
p, lastBuf, lastCursor, p.position))
p.position
}
@@ -365,7 +366,7 @@ class SparkJLineCompletion(val intp: SparkIMain) extends Completion with Complet
*/
try tryAll
catch { case ex: Throwable =>
- Console.println("Error: complete(%s, %s) provoked".format(buf, cursor) + ex)
+ logWarning("Error: complete(%s, %s) provoked".format(buf, cursor) + ex)
Candidates(cursor,
if (isReplDebug) List("<error:" + ex + ">")
else Nil