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 com.twitter.algebird | |
| import com.twitter.scalding.typed.TypedPipe | |
| /** | |
| * @author Mansur Ashraf. | |
| */ | |
| class jankyMonoid { | |
| implicit val sg = new EnumSemiGroup |
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 com.twitter.algebird | |
| import com.twitter.scalding.typed.TypedPipe | |
| /** | |
| * @author Mansur Ashraf. | |
| */ | |
| class jankyMonoid { | |
| implicit val sg = new EnumSemiGroup |
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
| def checkPath(p: String) : Boolean | |
| val futureA = Future{ | |
| if(!checkPath(...)) throw new IllegalStateException("path doesnt exisit") | |
| } | |
| val futureB = Future(..) | |
| futureA.flatMap(futureB) |
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
| colums: A B C D E | |
| types: String String String Int Int | |
| /** | |
| Group By ABC, and within each group find the max of (E-D) | |
| then fanout from E to D, assign 1 to each value from E to D and put them in a map. | |
| GroupBy AB, merge all the maps | |
| */ |
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
| class InMemoryStore[M[_]: Monad, K, V] extends Store[M, K, V] { | |
| override val monad: Monad[M] = implicitly[Monad[M]] | |
| private val map = new ConcurrentHashMap[K, V]() | |
| override def get(k: K): M[Option[V]] = monad.pure(Option(map.get(k))) | |
| override def put(kv: (K, V)): M[Unit] = monad.pure { | |
| val (k, v) = kv | |
| map.put(k, v) |
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
| -- | |
| -- NOTE: | |
| -- | |
| -- File paths need to be edited. Search for $$PATH$$ and | |
| -- replace it with the path to the directory containing | |
| -- the extracted data files. | |
| -- | |
| -- | |
| -- PostgreSQL database dump | |
| -- |
OlderNewer