JR Internals
In this section you can find informations about jr internals. This section won’t explain all the decisions/internals of jr, but we’ll try to explain everything we think is relevant to understand it.
Architecture
Plugins
jr uses hashicorp plugin framework to implement producers. Stdout and File plugins are “local”, meaning it’s a local call. Other plugins are on GRPC on localhost so they are not part of the JR binary.
If you need one of those, it must be deployed in the plugins
directory.
---
title: Producer plugins
---
classDiagram
direction LR
JR ..> ProducerPlugin : GRPC
JR --> stdout : local call
JR --> File : local call
namespace plugins {
class Kafka
class MongoDB
class Python
class Others
}
note for JR "JR delegates to a producer plugin\n via GRPC (on localhost)"
ProducerPlugin <-- Kafka
ProducerPlugin <-- MongoDB
ProducerPlugin <-- Python
ProducerPlugin <-- Others
class JR{
+produce(K, V, H)
}
Ticker
UTicker is a dynamic ticker. You can change teh tick with several prebuilt functions or write your own
---
title: UTicker
---
classDiagram
note "Dynamic ticking"
class UTicker {
- frequency time.Duration
- immediateStart bool
- nextTick func() time.Duration
- ticker *time.Ticker
- counter uint64
+ C chan time.Time
- run()
- calculateNextTick()
- tick()
+ Stop()
+ Reset(d time.Duration)
}