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
import java.util.ArrayList | |
import scala.collection.JavaConversions._ | |
import com.stumbleupon.async.{Callback, Deferred} | |
import org.hbase.async.{HBaseClient, KeyValue, Scanner} | |
import com.twitter.util.{Future, Promise, Return, Throw} | |
/** Converts a Deferred into a Future. */ | |
implicit def futureFromDeferred[A](d: Deferred[A]): Future[A] = { | |
val promise = new Promise[A] | |
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
#encoding: utf-8 | |
require 'tire' | |
require 'json' | |
require 'active_support/core_ext/object/to_query' | |
require 'active_support/core_ext/object/to_param' | |
conf = { | |
settings: { | |
number_of_shards: 1, | |
number_of_replicas: 0, |
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
Hi :) | |
Here are some quick instruction on running the hbase-ec.properties recipe. | |
1. Download Whirr 0.7.0 RC0 from here. We are going to publish this as an official release soon. | |
http://people.apache.org/~asavu/whirr-0.7.0-candidate-0/whirr-0.7.0.tar.gz | |
2. Extract the archive |
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
import akka.dispatch.Future | |
import akka.pattern.pipe | |
import akka.actor.Actor | |
case class Work(s: String) | |
case class Result(s: String) | |
object MyActor { | |
// put here to avoid closing over actor’s state | |
def doWork(work: String): String = { |
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
scalaVersion := "2.9.1" | |
resolvers += "durgeshm repo" at "http://durgeshm.github.com/releases/" | |
libraryDependencies ++= Seq( | |
"com.twitter" %% "finagle-core" % "1.9.7", | |
"com.twitter" %% "finagle-http" % "1.9.7") |
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 akka.unfiltered | |
import akka.actor._ | |
import akka.dispatch.Future | |
import akka.pattern.ask | |
import akka.util.duration._ | |
import akka.util.Timeout | |
import unfiltered.Async | |
import unfiltered.request._ |
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
import scala.io.Source | |
def parseLines[T](file: String, transform: (Iterator[String]) => T): T = { | |
val log = Source.fromFile(file) | |
val logLines = log.getLines() | |
try { transform(logLines) } finally { log.close } | |
} | |
// Example usage. | |
// parseLines("verybigfile.txt", iterator.take(100).foreach(println)) |
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
import scala.io.Source | |
def parseLines[T](file: String, transform: (Iterator[String]) => T): T = { | |
val log = Source.fromFile(file) | |
val logLines = log.getLines() | |
try { transform(logLines) } finally { log.close } | |
} | |
// Example usage. | |
// parseLines("verybigfile.txt", iterator.take(100).foreach(println)) |
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 net.addictivesoftware.scala.akkaactors | |
import akka.actor.{Actor, PoisonPill} | |
import Actor._ | |
import akka.routing.{Routing, CyclicIterator} | |
import Routing._ | |
import collection.mutable.{HashMap, Map} | |
import java.util.concurrent.CountDownLatch |
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 demo1 | |
import com.espertech.esper.client.EventBean | |
import com.espertech.esper.client.EPAdministrator | |
import com.espertech.esper.client.UpdateListener | |
import com.espertech.esper.client.EPListenable | |
import com.espertech.esper.client.EPServiceProvider | |
object EsperUtil { |