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
(ns cards.union-follow-on-reads | |
(:require [devcards.core :as dc :refer-macros [defcard dom-node]] | |
[om.dom :as dom] | |
[om.next :as om :refer [defui]] | |
[om.util :as util])) | |
(defui ^:once ActiveUsersTab | |
static om/IQuery | |
(query [this] [:which-tab]) |
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
(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) |
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
(clojure.pprint/pprint | |
#:task-bundle | |
{:name nil | |
:doc nil | |
:derived-task nil | |
:lifecycles [#:task-bundle.lifecycle | |
{:name nil | |
:id nil | |
:required-catalog-keys nil}] |
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
(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) |
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
[[: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]] |
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
(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)) |
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
(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)) |
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
(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 [] |
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
(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 |
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
(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 | |
} |