This file contains 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 RedirectFilter extends SimpleFilter[HttpRequest, HttpResponse] { | |
def apply(req: HttpRequest, serv: Service[HttpRequest, HttpResponse] = { | |
serv(req) | |
.flatMap { res => | |
if(res.statusCode == 302) { // Obviously, you can handle 301 and 307 as well | |
val uri = res.headers.get("Location") | |
// You'll want to check if uri is to the same host. | |
// You'll want to copy all of req (headers, body, etc) and only replace uri, this is incomplete: | |
val redirect = RequestBuilder().create.uri(uri).buildGet |
This file contains 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 CancelableExecutorServiceFuturePool(val executor: ExecutorService) extends FuturePool { | |
def apply[T](f: => T): Future[T] = { | |
val runOk = new AtomicBoolean(true) | |
val p = new Promise[T] | |
val task = new Runnable { | |
val saved = Local.save() | |
def run() { | |
// Make an effort to skip work in the case the promise | |
// has been cancelled or already defined. |
This file contains 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 com.twitter.util.{Future => TwFuture} | |
import scala.concurrent.{Future => ScFuture, promise => ScPromise} | |
implicit def twFutureToScala[T](twFuture: TwFuture[T]): ScFuture[T] = { | |
val prom = ScPromise[T] | |
twFuture.onSuccess { res: T => | |
prom.success(res) | |
} | |
twFuture.onFailure { t: Throwable => | |
prom.failure(t) | |
} |
This file contains 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
(launching attempt 072_1) | |
2013-02-24 16:12:52,106 INFO org.apache.hadoop.mapred.TaskTracker: Trying to launch : attempt_201302151249_0043_m_000072_1 which needs 1 slots | |
2013-02-24 16:12:52,107 INFO org.apache.hadoop.mapred.TaskTracker: In TaskLauncher, current free slots : 1 and trying to launch attempt_201302151249_0043_m_000072_1 which needs 1 slots | |
2013-02-24 16:12:52,138 INFO org.apache.hadoop.mapred.JvmManager: Killing JVM: jvm_201302151249_0044_m_357428054 | |
2013-02-24 16:12:52,146 INFO org.apache.hadoop.util.ProcessTree: Killing process group4426 with signal TERM. Exit code 0 | |
(spawns JVM 0043_m_146) | |
2013-02-24 16:12:52,146 INFO org.apache.hadoop.mapred.JvmManager: In JvmRunner constructed JVM ID: jvm_201302151249_0043_m_1460399232 | |
2013-02-24 16:12:52,147 INFO org.apache.hadoop.mapred.JvmManager: JVM Runner jvm_201302151249_0043_m_1460399232 spawned. | |
2013-02-24 16:12:52,155 INFO org.apache.hadoop.mapred.TaskController: Writing commands to /u04/app/hadoop/mapred-data/local/ttprivate/taskTracker/hadoop/job |
This file contains 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
Exception: unable to load serializer for: [B from: org.apache.hadoop.io.serializer.SerializationFactory | |
at cascading.tuple.hadoop.TupleSerialization.getNewSerializer(TupleSerialization.java:420) | |
at cascading.tuple.hadoop.TupleSerialization$SerializationElementWriter.write(TupleSerialization.java:695) | |
at cascading.tuple.io.TupleOutputStream.writeElement(TupleOutputStream.java:114) | |
at cascading.tuple.io.TupleOutputStream.write(TupleOutputStream.java:89) | |
at cascading.tuple.io.TupleOutputStream.writeTuple(TupleOutputStream.java:64) | |
at cascading.tuple.hadoop.io.HadoopTupleOutputStream.writeIndexTuple(HadoopTupleOutputStream.java:161) | |
at cascading.tuple.hadoop.io.IndexTupleSerializer.serialize(IndexTupleSerializer.java:37) | |
at cascading.tuple.hadoop.io.IndexTupleSerializer.serialize(IndexTupleSerializer.java:28) | |
at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(MapTask.java:916) |
This file contains 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
14c14 | |
< cascading.flow.step => H4sIAAAAAAAAAJVXfWwcRxUf3/k7TmInbRKUOnVbh9aE3ubOd2e7BrV7vrvkyDlxc06JbD662Z2722Tvdjo7a68rFFRB+hcSSCioLQoIFSRAASFBxcdfpQVVFFGp5Q+qigpR1EogAULijwJC4b3Zvbtd37k1lny7OzPvY977vd+buflXMuBwMq1rjq4ZZrOWqFr2ZqKuGbbNEqflowgjFUHZhcmnvvNSKfXnGImVyZ6Gxhjlq1xjjiD7y5e1DU1xhWkpyxpbLJMxTg1XDxY8Rq6SPo+Te7aZYZbWbFKeyGkObVlJv/OLv3/hrRcGY2RviQw5MHLWbZTIPse91DDFCjdtboqtMjmi6brbcC1NUKNiu1ynTm7rY7bZlMbKZBAtlPKCHPB9A1M1pSI4GAf3hnH2rNaguDpeJgM18LMuyL1lm9eUy/6XIh9KxWwwi+ZNTnWwdQrHQMNgjdsu7n08tPey6QiYi5lGoLe/GbLhmM0rTuDekOP7HHze5ghOYWmwlchOhgVtsArICnKw3I6gIjSmrEKsPUYI6YN/TORh9CWBviTKIEGN05pTh4yknz/7iXHr+f/ESN8a2QOho45zjhuUQ1YmOjLB6oGhN37+4qFHX42TWJGMWrZmFDVd2LxERkSdU6duW4bHHnyI4N/Y5jD8juOrRwSZUovqbCaXzJxMJXNzal6dzeaKmeRcMTlfzKeS+Zwgo9RjNhdTLrfA5eMQ8UQQ8YR8JHpEfD6VnU2lUnMxsAJA6pZRL0EIwUvEkpT4m/fVHx197sFvxcjgGtmrWZBwCFsZAO2skdtb38uuJUwwVjBq1AFYU3j6m90S5AMRNBQ6U5DjIVwJsQqStA8/K1S0Ze/ugaRCZA0oGXEY1c2qqQOOlB4CXZuarrQEZN4hfPd2h2LJ0hwHRYyQyxC/7NzcwnwMvR1Bb+UyQSZC9SGHQPMGJ3fsUKsV3Wa0v/4mn3nzozko0jUyYjqnsBZyW2tkyHSWK |
This file contains 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.example | |
import cc.spray._ | |
import cc.spray.directives.IntNumber | |
trait HelloService extends Directives { | |
val helloService = { | |
path("") { | |
get { _.complete("Say hello to Spray!") } |
This file contains 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
curl localhost:9200/_search -d '{ | |
"query" : { | |
"filtered" : { | |
"query" : {"match_all" : {}}, | |
"filter" : { | |
"or" : [ | |
{ | |
"range" : { | |
"file_size" : {"from" : 10, "to" : 10000} | |
} |
This file contains 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
facets : "facets" : { | |
<facet_def> | |
[,<facet_def>]* | |
} | |
facet_def: <facet_name> : { | |
<facet_type> | |
[,"global":true] | |
[,<facet_filter>] |
NewerOlder