Skip to content

Instantly share code, notes, and snippets.

View lgiorda's full-sized avatar

Logan Giorda lgiorda

  • Audax Health
  • San Francisco, CA
View GitHub Profile
(ns com.snowtide.util.test-coord-search
(:import (com.snowtide.dom Direction RectStruct Bounded))
(:require [com.snowtide.dom.regionutils :as reg]
[clojure.set :as sets])
(:use com.snowtide.util
(com.snowtide.dom regionutils)
(clojure.contrib def test-is
[map-utils :only (deep-merge-with)]
[seq-utils :only (shuffle)])))
case class Stock(date: String, open: Double, high: Double, low: Double, close: Double, volume: Int, adjClose: Double)
object RiakTest {
def main(args: Array[String]) = {
val riakClient = RiakFactory.httpClient("http://localhost:8091/riak")
var myBucket = riakClient.fetchBucket("goog").execute()
var myObject = myBucket.fetch("2004-09-28", classOf[Stock]).execute()
/**
@lgiorda
lgiorda / gist:2933001
Created June 14, 2012 21:15
Akka Futures, Actors, and timeouts..
object FuturesTimeoutApp extends App {
implicit val timeout = Timeout(10 seconds)
val actorSystem = ActorSystem.create("TimeoutActorSystem")
val actorA = actorSystem.actorOf(Props[ActorA],"actorA")
var responseFuture = actorA ? DoCalculateActorA(6) mapTo manifest[Int]
var response = Await.result(responseFuture, 35 seconds) // yes, blocking is bad...bear with us..
println("Response received finally 1:" + response)
Error received while attempting an operation in class org.dell.sna.base.persistence.RiakPersistenceProvider. Reducing attemps from 2 and retrying
ERR [20121008-16:54:47.183] org.dell.sna.base.service.component: com.basho.riak.client.RiakRetryFailedException: com.basho.riak.pbc.RiakError: {precommit_fail,{hook_crashed,{riak_search_kv_hook,precommit,error,badarg}}}
ERR [20121008-16:54:47.183] org.dell.sna.base.service.component: at com.basho.riak.client.cap.DefaultRetrier.attempt(DefaultRetrier.java:79)
ERR [20121008-16:54:47.183] org.dell.sna.base.service.component: at com.basho.riak.client.cap.DefaultRetrier.attempt(DefaultRetrier.java:81)
ERR [20121008-16:54:47.183] org.dell.sna.base.service.component: at com.basho.riak.client.cap.DefaultRetrier.attempt(DefaultRetrier.java:81)
ERR [20121008-16:54:47.183] org.dell.sna.base.service.component: at com.basho.riak.client.cap.DefaultRetrier.attempt(DefaultRetrier.java:81)
ERR [20121008-16:54:47.183] org.dell.sna.base.service.component: at com.ba
`[' expected but `'' found (RiakMultipleIndexSearch.scala:38)
[error] org.dell.sna.base.persistence.query.RiakMultipleIndexSearch$class.query(RiakMultipleIndexSearch.scala:38)
[error] org.dell.sna.base.persistence.RiakPersistenceProvider.query(RiakPersistenceProvider.scala:20)
[error] org.dell.sna.base.model.web.Note$.getByCategoryDate(Note.scala:84)
[error] org.dell.sna.base.model.web.NoteSpec$$anonfun$1$$anonfun$apply$3.apply(NoteSpec.scala:18)
[error] org.dell.sna.base.model.web.NoteSpec$$anonfun$1$$anonfun$apply$3.apply(NoteSpec.scala:16)
[error] org.specs.specification.LifeCycle$class.withCurrent(ExampleLifeCycle.scala:66)
[error] org.specs.specification.Examples.withCurrent(Examples.scala:52)
[error] org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:114)
[error] org.specs.specification.Examples$$anonfun$specifyExample$1.apply(Examples.scala:114)