Skip to content

Instantly share code, notes, and snippets.

Avatar
😀

Gardner Vickers gardnervickers

😀
View GitHub Profile
View follow-on-read-issue.cljs
(ns cards.union-follow-on-reads
(:require [devcards.core :as dc :refer-macros [defcard dom-node]]
[om.dom :as dom]
[om.util :as util]
[om.next :as om :refer [defui]]
[untangled.client.core :as uc :refer [initial-state InitialAppState]]))
(defmulti mutate om/dispatch)
View model.clj
(clojure.pprint/pprint
#:task-bundle
{:name nil
:doc nil
:derived-task nil
:lifecycles [#:task-bundle.lifecycle
{:name nil
:id nil
:required-catalog-keys nil}]
View transducerwindow.clj
(defn segments
([] (segments {:event-time 1 :name "mike"}))
([n] (lazy-seq (cons n (segments (-> (update n :event-time inc)
(assoc :name (rand-nth ["gardner" "mike" "lucas"]))))))))
(defn wids-lower [min-windowing-attr w-slide t]
(dec (long (Math/floor (/ (- t
min-windowing-attr)
View gist:30ed9e032db8daef5b3c
[[:window :fixed [10 :minutes]]
[:aggregating [:average :emoji-key]]]
[[:trigger :watermark]
[:on-trigger :accumulating :fire-extent ::to-stdout]]
[[:window :sliding [10 :minutes] :every [1 :minute]]
[:aggregating :conj]]
[[:trigger [:segment 10]]
[:on-trigger :discarding :fire-all-extents ::to-stdout]]
View updated.clj
(def msg-seq [{:msg 1} {:msg 2} {:msg 3} {:type :barrier} {:msg 4} {:msg 5}])
(defn start-peer [id a]
(let [ch (chan)
peer (go-loop [msg (<! ch)]
(when msg
(swap! a update id conj msg)
(recur (<! ch))))]
ch))
View clojure.clj
(def msg-seq [{:msg 1} {:msg 2} {:msg 3} {:type :barrier} {:msg 4} {:msg 5}])
(defn start-peer [id a sleepiness] ;; Simulates a peer lifecycle, just writing the message it got under it's slot in a db atom
(let [ch (chan)
peer (go-loop [msg (<! ch)]
(when msg
(Thread/sleep sleepiness)
(swap! a update id conj msg)
(recur (<! ch))))]
ch))
View something.clj
(defn build-job [db-uri log-end-tx batch-size batch-timeout]
(let [batch-settings {:onyx/batch-size batch-size :onyx/batch-timeout batch-timeout}
base-job (merge {:workflow [[:read-log :persist]]
:catalog []
:lifecycles []
:windows []
:triggers []
:flow-conditions []
View kafka.clj
(s/defn input-task
([task-name :- s/Keyword {:keys [kafka/topic kafka/group-id
kafka/zookeeper kafka/offset-reset
kafka/force-reset? kafka/deserializer-fn
kafka/chan-capacity kafka/fetch-size
kafka/empty-read-back-off kafka/commit-interval] :as opts}]
{:task {:task-map (merge {:onyx/name task-name
:onyx/plugin :onyx.plugin.kafka/read-messages
:onyx/type :input
:onyx/medium :kafka
View clojure.clj
(ns fuzzy-schema.core-test
(:require [schema
[core :as s]
[utils :as utils]]
[schema.spec.core :as spec]))
(def sample-schema
{:zookeeper/configuration {:zookeeper/address s/Str
:zookeeper/port s/Num
}
View zkerror.log
15-Dec-10 10:39:17 Gardner-Vickers-Mac.local INFO [onyx.log.zookeeper] - Stopping ZooKeeper client connection
Exception updating the ns-cache #error {
:cause Task clojure.lang.Agent$Action@e382ea9 rejected from java.util.concurrent.ThreadPoolExecutor@44771cf1[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4]
:via
[{:type java.util.concurrent.RejectedExecutionException
:message Task clojure.lang.Agent$Action@e382ea9 rejected from java.util.concurrent.ThreadPoolExecutor@44771cf1[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 4]
:at [java.util.concurrent.ThreadPoolExecutor$AbortPolicy rejectedExecution ThreadPoolExecutor.java 2047]}]
:trace
[[java.util.concurrent.ThreadPoolExecutor$AbortPolicy rejectedExecution ThreadPoolExecutor.java 2047]
[java.util.concurrent.ThreadPoolExecutor reject ThreadPoolExecutor.java 823]