https://github.com/ueshin/docker
$ docker run -it -p 14040:4040 spark:1.1.0-rc4https://github.com/ueshin/docker
$ docker run -it -p 14040:4040 spark:1.1.0-rc4https://github.com/ueshin/docker
$ docker run -it -p 14040:4040 spark:1.1.0-rc4| implicit def ClosableLoan[C <: { def close(): Unit }] = new Loan[C] { | |
| override def using[A](closable: C)(block: C => A) = try { | |
| block(closable) | |
| } finally { closable.close } | |
| } |
| package object example { | |
| implicit class Foo(val foo: String) extends AnyVal { | |
| def hello = println("hello") | |
| } | |
| } |
| > create 'fizzbuzz', | |
| { NAME => 'num', VERSIONS => JInteger::MAX_VALUE }, | |
| { NAME => 'fizz', VERSIONS => JInteger::MAX_VALUE }, | |
| { NAME => 'buzz', VERSIONS => JInteger::MAX_VALUE }, | |
| { NAME => 'fizzbuzz', VERSIONS => JInteger::MAX_VALUE } | |
| > create 'fb', 'family' | |
| > disable 'fb' | |
| > alter 'fb', METHOD => 'table_att','coprocessor' => 'maprfs:////user/ueshin/hbase-coprocessors-0.0.2-SNAPSHOT.jar|st.happy_camper.hbase.coprocessors.fizzbuzz.FizzBuzzRegionObserver|1000|targets=family' | |
| > enable 'fb' |
| public class J { | |
| public static void setClass(Class<? extends java.util.List> clazz) { | |
| System.out.println(clazz.getName()); | |
| } | |
| } |
| object WordCount { | |
| def main(args: Array[String]) { | |
| import mapreduce._ | |
| import _root_.scala.io.Source | |
| def textInputFormat(lines: Iterator[String], offset: Long = 0): Stream[(Long, String)] = { | |
| if(lines.hasNext) { | |
| val line = lines.next |