Skip to content

Instantly share code, notes, and snippets.

View aphyr's full-sized avatar
💭
be gay, do crimes

Kyle Kingsbury aphyr

💭
be gay, do crimes
View GitHub Profile
@aphyr
aphyr / gist:1375435
Created November 18, 2011 02:55
Riak-client transparent failover
Each . is a successful get/put. Rescued ... shows where an exception was
raised and retried by the client. [float, float, float] are the error_rates
of the three nodes, exponentially decaying. When I kill a node, the exception
is caught and retried transparently. If any were to fail three times
successively, an X would be printed.
Throughout this test I'm restarting nodes left and right at random. So long
as fewer than two crash at once, no errors are raised.
This works so long as all operations in a given block are replayable.
10:11 <seancribbs> aphyr_: the internal dilemma - to encode or not to encode
10:11 <aphyr_> Seems like Riak should be content-agnostic for keys
10:12 <aphyr_> The encoding should be protocol-dependent and reversed once past
the HTTP/protobufs interface
10:12 <aphyr_> I'm running out of special characters to use as separators, haha
10:13 justinsheehy joined
10:13 amerine joined
10:14 <aphyr_> Dashes appear in datetimes...
10:14 <seancribbs> aphyr: yeah I'm on the fence about that.
10:15 <seancribbs> in one sense, you want keys sent via pbc to be available on h
Nov 30, 2011 5:44:45 PM clojure.contrib.logging$impl_write_BANG_ invoke
WARNING: lamina.core.pipeline
java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
at clojure.lang.RT.seqFrom(RT.java:471)
at clojure.lang.RT.seq(RT.java:452)
at clojure.core$seq.invoke(core.clj:122)
at clojure.core$empty_QMARK_.invoke(core.clj:4966)
at gloss.data.bytes.core$create_buf_seq.invoke(core.clj:249)
at gloss.core.formats$to_buf_seq.invoke(formats.clj:30)
at gloss.core.codecs$reify__5169.write_bytes(codecs.clj:78)
(ns ufold.core)
(use 'lamina.core 'aleph.tcp 'gloss.core)
(require 'gloss.io)
(use 'protobuf)
(defprotobuf Msg Ufold$Msg)
(defn dump-bytes [bytes]
(prn (seq bytes)))
(ns ufold.core
(:use clojure.contrib.logging))
(use 'lamina.core 'aleph.tcp 'gloss.core)
(require 'gloss.io)
(use 'protobuf)
(defprotobuf Msg Ufold$Msg)
(defn dump-bytes [bytes]
t[
:r_object,
"tablet_videos",
"y:dRz8C35AaW8",
[
t[
:r_content,
t[
:dict,
4,
# Is the given riak_object deleted?
# Without consideration for vclocks, naturally...
BERT.decode(robject)[3].all? { |content|
content[1][-1][0].flatten(1).any? { |list|
list == ["X-Riak-Deleted", 116,114,117,101]
}
}
Buy 195194 at 731.0 and sell 294016 at 741.13
Buy 195194 at 731.0 and sell 313921 at 744.04
Buy 195194 at 731.0 and sell 884655 at 744.02
Buy 195194 at 731.0 and sell 100000 at 752.0
Buy 195194 at 731.0 and sell 98478 at 752.58
Buy 195194 at 731.0 and sell 56113 at 752.3
Buy 195194 at 731.0 and sell 58536 at 752.55
Buy 195194 at 731.0 and sell 275020 at 745.03
Buy 195194 at 731.0 and sell 249714 at 741.25
Buy 195194 at 731.0 and sell 274715 at 745.03
; This is a ufold config file (or rather, what it *will* look like)
;
; Each event is applied to these streams. An event is a struct like
; :service "cpu"
; :host "foo.com"
; :time 123456789
; :metric_f 0.12
; :description "0.12 of 8 cores user/sys/io_wait"
; :state "ok"
;
lein deps
[INFO] snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT: checking for updates from JBoss
[WARNING] repository metadata for: 'snapshot org.clojure:clojure:1.2.0-master-SNAPSHOT' could not be retrieved from repository: JBoss due to an error: Error transferring file
[INFO] Repository 'JBoss' will be blacklisted
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from clojure-snapshots
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from clojars
Downloading: org/clojure/clojure/1.2.0-master-SNAPSHOT/clojure-1.2.0-master-SNAPSHOT.pom from central
Downloading: org/clojure/clojure-contrib/1.2.0-master-SNAPSHOT/clojure-contrib-1.2.0-master-SNAPSHOT.pom from clojure-snapshots
Downloading: org/clojure/clojure-contrib/1.2.0-master-SNAPSHOT/clojure-contrib-1.2.0-master-SNAPSHOT.pom from clojars
Downloading: org/clojure/clojure-contrib/1.2.0-master-SNAPSHOT/clojure-contrib-1.2.0-master-SNAPSHOT.pom from central