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
(define-source :hbase [table constraints] | |
:input-format TableInputFormat | |
:map-reader hbase-table-reader-latest | |
:configure (fn [job] | |
(configure-hbase job table constraints))) |
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
(define-shuffle :clojure [] | |
:map-writer wrap/clojure-writer | |
:reduce-reader wrap/clojure-reduce-reader) | |
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
(define-sink :null [] | |
:reduce-writer wrap/clojure-writer | |
:output-format NullOutputFormat | |
:output-key Text | |
:output-value Text) | |
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
;; Pseudocode example for guards in flows | |
(def *guard-time* [:days 7]) | |
(defmacro with-resource-time-guard | |
[[name timespec inhibit?] &body ] | |
`(let [resource# (get-resource name)] | |
(cond (and ~inhibit? (resource-value resource#)) | |
(resource-value resource#) | |
(or (resource-expired? resource# ~timespec) |
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
;; hadoop -jar compass.jar -step count-users | |
;; hadoop -jar compass.jar -flow count-user-flow | |
(defn map-count-users [k fmap] | |
(ctx/increment-counter "Compass" "rows") | |
(ctx/increment-counter "Compass" (format "src=%s" (:src (:userinfo fmap)))) | |
[]) | |
(defn count-users-total [job] | |
(job-counter-value job "Compass" "rows")) |
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
;; | |
;; Flume HBase User Sink | |
;; | |
(gen-class | |
:name compass.flume.UserSink | |
:extends "com.cloudera.flume.core.EventSink$Base" | |
:prefix "sink-" | |
:main false | |
:constructors {[String] [] |
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
;; This is a relatively simple election mechanism for a set of | |
;; processes or datomic peers where a processing step requires a | |
;; global master. The elector entity is used to connect a set of peer | |
;; entities labeled as :election/master. Using the algorithm, | |
;; there will only ever be one :election/master in the :election/peer | |
;; group defined on the elector. | |
;; | |
;; The user API is simple a guarded transaction which calls a txn-fn | |
;; if the entity is the current master. If not it holds an election | |
;; if the timeout has expired. |
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 experiment.infra.election | |
(:use [datomic.api :only [q] :as d]) | |
(:require [experiment.system :as sys] | |
[experiment.infra.data :as data] | |
[experiment.infra.protocols :as p])) | |
;; | |
;; Reserve - Simple peer coordination mechanism | |
;; | |
;; Reservations support multiple peers trying to distribution operations |
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
{:user {:plugins [[lein-ritz "0.7.0"]] | |
:dependencies [[nrepl-inspect "0.3.0"] | |
[ritz/ritz-nrepl-middleware "0.7.0"]] | |
:repl-options | |
{:nrepl-middleware | |
[inspector.middleware/wrap-inspect | |
ritz.nrepl.middleware.javadoc/wrap-javadoc | |
ritz.nrepl.middleware.apropos/wrap-apropos]}}} |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
config.vm.box = "Ubuntu64vb" | |
config.vm.boot_mode = :gui | |
config.vm.network :bridged | |
end | |
OlderNewer