This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 206
/
types.cljc
66 lines (45 loc) · 2.43 KB
/
types.cljc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
(ns onyx.types)
(defrecord Route [flow exclusions post-transformation action pred-failure])
(def message-id ^:const (byte 0))
(def barrier-id ^:const (byte 1))
(def heartbeat-id ^:const (byte 2))
(def ready-id ^:const (byte 3))
(def ready-reply-id ^:const (byte 4))
(def max-control-message-size 500)
(defn message [replica-version short-id payload]
{:type message-id :replica-version replica-version :short-id short-id :payload payload})
(defn barrier [replica-version epoch short-id]
{:type barrier-id :replica-version replica-version :epoch epoch :short-id short-id})
(defn ready [replica-version src-peer-id short-id]
{:type ready-id :replica-version replica-version :src-peer-id src-peer-id :short-id short-id})
(defn ready-reply [replica-version src-peer-id dst-peer-id session-id short-id]
{:type ready-reply-id :replica-version replica-version :src-peer-id src-peer-id
:dst-peer-id dst-peer-id :session-id session-id :short-id short-id})
(defn heartbeat [replica-version epoch src-peer-id dst-peer-id session-id short-id]
{:type heartbeat-id :replica-version replica-version :epoch epoch
:src-peer-id src-peer-id :dst-peer-id dst-peer-id :session-id session-id
:short-id short-id})
(defrecord Result [root leaves])
(defrecord TriggerState
[window-id refinement on sync fire-all-extents? state pred watermark-percentage doc
period threshold sync-fn id idx init-state create-state-update apply-state-update
pre-evictor post-evictor state-context-trigger? state-context-window?])
(defrecord StateEvent
[event-type task-event segment grouped? group-key lower-bound upper-bound
log-type trigger-update aggregation-update window next-state])
(defn new-state-event
[event-type task-event replica-version epoch]
{:event-type event-type :task-event task-event
:replica-version replica-version :epoch epoch})
(defn checkpointed-state-event [task-event replica-version epoch checkpointed]
(assoc (new-state-event :checkpointed task-event replica-version epoch)
:checkpointed checkpointed))
#?(:clj (defmethod clojure.core/print-method StateEvent
[system ^java.io.Writer writer]
(.write writer "#<onyx.types.StateEvent>")))
(defrecord Link [link timestamp])
(defrecord MonitorEvent [event])
(defrecord MonitorEventLatency [event latency])
(defrecord MonitorEventBytes [event bytes])
(defrecord MonitorTaskEventCount [event count])
(defrecord MonitorEventLatencyBytes [event latency bytes])