Skip to content
Merged
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.2.3]
### Added
- `:conf` and `:set` commands to deal with configuration without restart.
- `sayHello()` method to receive greetings from plugins.

### Changed
- Jline3 is now bundled to `kshell.jar`.
- Small API changes to improve configuration support.

### Fixed
- Kotlin NPE if result is null [#24](http://github.com/khud/sparklin/issues/24)
- The shell should not truncate output after 2 lines already [#23](http://github.com/khud/sparklin/issues/23)
- You typed two blank lines. Starting a new command. [#22](http://github.com/khud/sparklin/issues/22)
- Kotlin v.1.2.41/v.1.2.50 compatibility [#21](http://github.com/khud/sparklin/issues/21)

## [0.2.1]
### Added
- Trap Ctrl-C [#18](http://github.com/khud/sparklin/issues/18)
Expand Down Expand Up @@ -61,6 +76,7 @@ All notable changes to this project will be documented in this file.
### Removed
- Old spark stuff: separate main class and so on.

[0.2.3]: http://github.com/khud/sparklin/compare/v0.2.1...v0.2.3
[0.2.1]: http://github.com/khud/sparklin/compare/v0.2...v0.2.1
[0.2]: http://github.com/khud/sparklin/compare/0.1.2...v0.2
[0.1.2]: http://github.com/khud/sparklin/compare/0.1.1...0.1.2
Expand Down
13 changes: 7 additions & 6 deletions bin/kshell.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

MAVEN_REPO_BASE=$HOME/.m2/repository/org/jetbrains/kotlin
KOTLIN_VERSION=1.2.30
SPARKLIN_VERSION=0.2.1
KOTLIN_VERSION=1.2.50
KSHELL_REPL_API_VERSION=0.2.3-1.2.41
SPARKLIN_VERSION=0.2-SNAPSHOT

# Kotlin libraries
KOTLIN_STDLIB=${MAVEN_REPO_BASE}/kotlin-stdlib/${KOTLIN_VERSION}/kotlin-stdlib-${KOTLIN_VERSION}.jar
Expand All @@ -12,12 +13,12 @@ KOTLIN_REFLECT=${MAVEN_REPO_BASE}/kotlin-reflect/${KOTLIN_VERSION}/kotlin-reflec

# JLine2 console support
FUSE_JANSI=$HOME/.m2/repository/org/fusesource/jansi/jansi/1.15/jansi-1.15.jar
KSHELL_CONSOLE_JLINE3=$HOME/.m2/repository/sparklin/jline3-shaded/${SPARKLIN_VERSION}/jline3-shaded-${SPARKLIN_VERSION}.jar
KSHELL_REPL_API=$HOME/.m2/repository/sparklin/kshell-repl-api/${SPARKLIN_VERSION}/kshell-repl-api-${SPARKLIN_VERSION}.jar
KSHELL_REPL_API=$HOME/.m2/repository/com/github/khud/kshell-repl-api/${KSHELL_REPL_API_VERSION}/kshell-repl-api-${KSHELL_REPL_API_VERSION}.jar

# KShell path

KSHELL=$HOME/.m2/repository/sparklin/kshell/${SPARKLIN_VERSION}/kshell-${SPARKLIN_VERSION}.jar

JARS=${KOTLIN_COMPILER}:${KOTLIN_STDLIB}:${KOTLIN_REFLECT}:${KOTLIN_SCRIPT_RUNTIME}:${KSHELL_CONSOLE_JLINE3}:${KSHELL_REPL_API}
JARS=${KOTLIN_COMPILER}:${KOTLIN_STDLIB}:${KOTLIN_REFLECT}:${KOTLIN_SCRIPT_RUNTIME}:${KSHELL_REPL_API}

java -classpath ${JARS}:${KSHELL} sparklin.kshell.KotlinShell $@
java -classpath ${JARS}:${KSHELL} com.github.khud.sparklin.kshell.KotlinShell $@
12 changes: 6 additions & 6 deletions bin/sparklin-spark1x.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

MAVEN_REPO_BASE=$HOME/.m2/repository/org/jetbrains/kotlin
KOTLIN_VERSION=1.2.30
SPARKLIN_VERSION=0.2.1
KOTLIN_VERSION=1.2.50
KSHELL_REPL_API_VERSION=0.2.3-1.2.41
SPARKLIN_VERSION=0.2-SNAPSHOT

# Kotlin libraries
KOTLIN_STDLIB=${MAVEN_REPO_BASE}/kotlin-stdlib/${KOTLIN_VERSION}/kotlin-stdlib-${KOTLIN_VERSION}.jar
Expand All @@ -12,8 +13,7 @@ KOTLIN_REFLECT=${MAVEN_REPO_BASE}/kotlin-reflect/${KOTLIN_VERSION}/kotlin-reflec

# JLine2 console support
FUSE_JANSI=$HOME/.m2/repository/org/fusesource/jansi/jansi/1.15/jansi-1.15.jar
KSHELL_CONSOLE_JLINE3=$HOME/.m2/repository/sparklin/jline3-shaded/${SPARKLIN_VERSION}/jline3-shaded-${SPARKLIN_VERSION}.jar
KSHELL_REPL_API=$HOME/.m2/repository/sparklin/kshell-repl-api/${SPARKLIN_VERSION}/kshell-repl-api-${SPARKLIN_VERSION}.jar
KSHELL_REPL_API=$HOME/.m2/repository/com/github/khud/kshell-repl-api/${KSHELL_REPL_API_VERSION}/kshell-repl-api-${KSHELL_REPL_API_VERSION}.jar

# Spark 1.x support
SPARKLIN_PLUGIN=$HOME/.m2/repository/sparklin/sparklin-spark-1.x/${SPARKLIN_VERSION}/sparklin-spark-1.x-${SPARKLIN_VERSION}.jar
Expand All @@ -30,9 +30,9 @@ KSHELL=$HOME/.m2/repository/sparklin/kshell/${SPARKLIN_VERSION}/kshell-${SPARKLI
# Apache Spark home directory must point to Spark version 1.x > 1.6
SPARK_HOME=$HOME/Programs/spark-1.6.1-bin-hadoop2.6

JARS=${KOTLIN_COMPILER},${KOTLIN_STDLIB},${KOTLIN_REFLECT},${KOTLIN_SCRIPT_RUNTIME},${KSHELL_CONSOLE_JLINE3},${KSHELL_REPL_API},${SPARKLIN_PLUGIN},${HDFS_BROWSER_PLUGIN}
JARS=${KOTLIN_COMPILER},${KOTLIN_STDLIB},${KOTLIN_REFLECT},${KOTLIN_SCRIPT_RUNTIME},${KSHELL_REPL_API},${SPARKLIN_PLUGIN},${HDFS_BROWSER_PLUGIN}

${SPARK_HOME}/bin/spark-submit --jars=${JARS} --conf "spark.driver.extraJavaOptions=-Dconfig.path=${SPARKLIN_CONFIG}" \
--master "local[2]" --class "sparklin.kshell.KotlinShell" \
--master "local[2]" --class "com.github.khud.sparklin.kshell.KotlinShell" \
${KSHELL} \
$@
12 changes: 6 additions & 6 deletions bin/sparklin-spark2x.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env bash

MAVEN_REPO_BASE=$HOME/.m2/repository/org/jetbrains/kotlin
KOTLIN_VERSION=1.2.30
SPARKLIN_VERSION=0.2.1
KOTLIN_VERSION=1.2.50
KSHELL_REPL_API_VERSION=0.2.3-1.2.41
SPARKLIN_VERSION=0.2-SNAPSHOT

# Kotlin libraries
KOTLIN_STDLIB=${MAVEN_REPO_BASE}/kotlin-stdlib/${KOTLIN_VERSION}/kotlin-stdlib-${KOTLIN_VERSION}.jar
Expand All @@ -12,8 +13,7 @@ KOTLIN_REFLECT=${MAVEN_REPO_BASE}/kotlin-reflect/${KOTLIN_VERSION}/kotlin-reflec

# JLine2 console support
FUSE_JANSI=$HOME/.m2/repository/org/fusesource/jansi/jansi/1.15/jansi-1.15.jar
KSHELL_CONSOLE_JLINE3=$HOME/.m2/repository/sparklin/jline3-shaded/${SPARKLIN_VERSION}/jline3-shaded-${SPARKLIN_VERSION}.jar
KSHELL_REPL_API=$HOME/.m2/repository/sparklin/kshell-repl-api/${SPARKLIN_VERSION}/kshell-repl-api-${SPARKLIN_VERSION}.jar
KSHELL_REPL_API=$HOME/.m2/repository/com/github/khud/kshell-repl-api/${KSHELL_REPL_API_VERSION}/kshell-repl-api-${KSHELL_REPL_API_VERSION}.jar

# Spark 2.x support
SPARKLIN_PLUGIN=$HOME/.m2/repository/sparklin/sparklin-spark-2.x/${SPARKLIN_VERSION}/sparklin-spark-2.x-${SPARKLIN_VERSION}.jar
Expand All @@ -30,9 +30,9 @@ KSHELL=$HOME/.m2/repository/sparklin/kshell/${SPARKLIN_VERSION}/kshell-${SPARKLI
# Apache Spark home directory must point to Spark version 2.x
SPARK_HOME=$HOME/Programs/spark-2.2.0-bin-hadoop2.7

JARS=${KOTLIN_COMPILER},${KOTLIN_STDLIB},${KOTLIN_REFLECT},${KOTLIN_SCRIPT_RUNTIME},${KSHELL_CONSOLE_JLINE3},${KSHELL_REPL_API},${SPARKLIN_PLUGIN},${HDFS_BROWSER_PLUGIN}
JARS=${KOTLIN_COMPILER},${KOTLIN_STDLIB},${KOTLIN_REFLECT},${KOTLIN_SCRIPT_RUNTIME},${KSHELL_REPL_API},${SPARKLIN_PLUGIN},${HDFS_BROWSER_PLUGIN}

${SPARK_HOME}/bin/spark-submit --jars=${JARS} --conf "spark.driver.extraJavaOptions=-Dconfig.path=${SPARKLIN_CONFIG}" \
--master "local[2]" --class "sparklin.kshell.KotlinShell" \
--master "local[2]" --class "com.github.khud.sparklin.kshell.KotlinShell" \
${KSHELL} \
$@
16 changes: 8 additions & 8 deletions conf/spark1x.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins=sparklin.kshell.plugins.LoadFilePlugin, \
sparklin.kshell.plugins.RuntimePlugin, \
sparklin.kshell.plugins.HelpPlugin, \
sparklin.kshell.plugins.PastePlugin, \
sparklin.spark1x.Spark1xPlugin, \
sparklin.hdfsbrowser.HdfsBrowserPlugin, \
sparklin.kshell.plugins.SyntaxPlugin, \
sparklin.kshell.plugins.PromptPlugin
plugins=com.github.khud.sparklin.kshell.plugins.LoadFilePlugin, \
com.github.khud.sparklin.kshell.plugins.RuntimePlugin, \
com.github.khud.sparklin.kshell.plugins.HelpPlugin, \
com.github.khud.sparklin.kshell.plugins.PastePlugin, \
com.github.khud.sparklin.spark1x.Spark1xPlugin, \
com.github.khud.sparklin.hdfsbrowser.HdfsBrowserPlugin, \
com.github.khud.sparklin.kshell.plugins.SyntaxPlugin, \
com.github.khud.sparklin.kshell.plugins.PromptPlugin
16 changes: 8 additions & 8 deletions conf/spark2x.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins=sparklin.kshell.plugins.LoadFilePlugin, \
sparklin.kshell.plugins.RuntimePlugin, \
sparklin.kshell.plugins.HelpPlugin, \
sparklin.kshell.plugins.PastePlugin, \
sparklin.spark2x.Spark2xPlugin, \
sparklin.hdfsbrowser.HdfsBrowserPlugin, \
sparklin.kshell.plugins.SyntaxPlugin, \
sparklin.kshell.plugins.PromptPlugin
plugins=com.github.khud.sparklin.kshell.plugins.LoadFilePlugin, \
com.github.khud.sparklin.kshell.plugins.RuntimePlugin, \
com.github.khud.sparklin.kshell.plugins.HelpPlugin, \
com.github.khud.sparklin.kshell.plugins.PastePlugin, \
com.github.khud.sparklin.spark2x.Spark2xPlugin, \
com.github.khud.sparklin.hdfsbrowser.HdfsBrowserPlugin, \
com.github.khud.sparklin.kshell.plugins.SyntaxPlugin, \
com.github.khud.sparklin.kshell.plugins.PromptPlugin
4 changes: 2 additions & 2 deletions hdfs-browser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>sparklin</groupId>
<artifactId>sparklin</artifactId>
<version>0.2.1</version>
<version>0.2-SNAPSHOT</version>
</parent>


<artifactId>hdfs-browser</artifactId>
<version>0.2.1</version>
<version>0.2-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package sparklin.hdfsbrowser
package com.github.khud.sparklin.hdfsbrowser

import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.fs.Path
import sparklin.kshell.BaseCommand
import sparklin.kshell.KShell
import sparklin.kshell.Plugin
import sparklin.kshell.calcHumanReadableSize
import sparklin.kshell.configuration.Configuration
import sparklin.kshell.plugins.SparkPlugin
import com.github.khud.sparklin.kshell.BaseCommand
import com.github.khud.sparklin.kshell.KShell
import com.github.khud.sparklin.kshell.Plugin
import com.github.khud.sparklin.kshell.calcHumanReadableSize
import com.github.khud.sparklin.kshell.configuration.Configuration
import com.github.khud.sparklin.kshell.plugins.SparkPlugin
import kotlin.reflect.KClass
import org.apache.hadoop.conf.Configuration as HadoopConfiguration

Expand Down Expand Up @@ -45,8 +45,8 @@ class HdfsBrowserPlugin : Plugin {
}

private fun findHadoopConfiguration(config: Configuration): HadoopConfiguration {
val spark1 = config.getPluginByClass("sparklin.spark1x.Spark1xPlugin", SparkPlugin::class)
val spark2 = config.getPluginByClass("sparklin.spark2x.Spark2xPlugin", SparkPlugin::class)
val spark1 = config.getPluginByClass("com.github.khud.sparklin.spark1x.Spark1xPlugin", SparkPlugin::class)
val spark2 = config.getPluginByClass("com.github.khud.sparklin.spark2x.Spark2xPlugin", SparkPlugin::class)

return when {
spark1 != null -> spark1.hadoopConfiguration()
Expand Down
4 changes: 2 additions & 2 deletions jline3-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>sparklin</groupId>
<artifactId>sparklin</artifactId>
<version>0.2.1</version>
<version>0.2-SNAPSHOT</version>
</parent>


<artifactId>jline3-shaded</artifactId>
<version>0.2.1</version>
<version>0.2-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
128 changes: 0 additions & 128 deletions kshell-repl-api/pom.xml

This file was deleted.

Loading