This file contains hidden or 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 values | |
[[(/ 1.0 2.0) | |
(/ 1.0 2.0)] | |
[(/ 1.0 3.0) | |
(/ 1.0 3.0) | |
(/ 1.0 3.0)]]) | |
(defn mean | |
[xs] | |
(/ (double (reduce + xs)) (count xs))) |
This file contains hidden or 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
#!/bin/sh | |
#_( | |
#_DEPS is same format as deps.edn. Multiline is okay. | |
DEPS='{:deps {aysylu/loom {:mvn/version "1.0.2"} | |
org.apache.kafka/kafka-streams {:mvn/version "2.2.0"}}}' | |
#_You can put other options here | |
OPTS='-J-Xms256m -J-Xmx256m -J-client' | |
exec clojure $OPTS -Sdeps "$DEPS" "$0" "$@" | |
) |
This file contains hidden or 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
(setq-default indent-tabs-mode nil) | |
(load "server") | |
(unless (server-running-p) | |
(server-start)) | |
(defun mac-metas () | |
"for mac keyboard" | |
(setq mac-option-modifier 'super) | |
(setq mac-command-modifier 'meta)) |
This file contains hidden or 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 watermarks) | |
(defn partition-of | |
[partitions key] | |
(mod (.hashCode "test") partitions)) | |
(def partitions 12) | |
(defn produce! | |
[broker topic key message] |
This file contains hidden or 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
## Consumer Throughput: Single consumer thread, no compression | |
## Consumer Throughput: 3 consumer thread, no compression | |
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \ | |
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \ | |
--messages 15000000 \ | |
--threads 1 |
This file contains hidden or 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
(load "server") | |
(unless (server-running-p) | |
(server-start)) | |
(require 'package) | |
(package-initialize) | |
(add-to-list 'package-archives '("melpa" . "https://stable.melpa.org/packages/")) | |
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) | |
(add-to-list 'load-path (expand-file-name "el-get/el-get" "~/.emacs.d")) |
This file contains hidden or 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
clj -J-Dclojure.server.repl="{:port 1234 :accept clojure.core.server/repl}" | |
rlwrap -q ^Q nc 127.0.0.1 1234 |
This file contains hidden or 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 trees | |
(:require [clojure.walk :as walk])) | |
(defonce id (atom 0)) | |
(defrecord Ref [id]) | |
(defn new-id! [] | |
(->Ref (swap! id inc))) |
This file contains hidden or 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
[org.apache.kafka/kafka-clients "0.11.0.0"] | |
[spootnik/kinsky "0.1.16"] | |
(ns space.kafka | |
(:require [kinsky.client :as client]) | |
(:import [java.util ArrayList Properties] | |
org.apache.kafka.clients.consumer.KafkaConsumer | |
[org.apache.kafka.clients.producer KafkaProducer ProducerRecord] | |
[org.apache.kafka.common.serialization StringDeserializer StringSerializer] | |
org.apache.kafka.common.TopicPartition |
This file contains hidden or 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
https://engineering.linkedin.com/distributed-systems/log-what-every-software-engineer-should-know-about-real-time-datas-unifying | |
https://www.oreilly.com/ideas/questioning-the-lambda-architecture | |
http://www.paperplanes.de/2011/12/9/the-magic-of-consistent-hashing.html | |
http://www.benstopford.com/2015/04/28/elements-of-scale-composing-and-scaling-data-platforms/ | |
http://www.benstopford.com/2015/02/14/log-structured-merge-trees/ | |
https://www.confluent.io/blog/data-dichotomy-rethinking-the-way-we-treat-data-and-services/ | |
http://adrianmarriott.net/logosroot/papers/LifeBeyondTxns.pdf | |
http://robertgreiner.com/2014/08/cap-theorem-revisited/ | |
http://the-paper-trail.org/blog/consistency-and-availability-in-amazons-dynamo/ | |
https://blog.parse.ly/post/1691/lucene/ |
NewerOlder