- Presto 0.73
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class J { | |
| public static void setClass(Class<? extends java.util.List> clazz) { | |
| System.out.println(clazz.getName()); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| > 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package object example { | |
| implicit class Foo(val foo: String) extends AnyVal { | |
| def hello = println("hello") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 } | |
| } |
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-rc4