(cmdref->cmd q cmdref)Returns the command associated with cmdref, or nil if the file is missing (i.e. it's been deleted).
Returns the command associated with cmdref, or nil if the file is missing (i.e. it's been deleted).
Represents an incoming command, before it has been enqueued. One key difference between this and the command ref (and a ref is what you'll typically have) is that the certname in a ref may not be the actual certname, it may be the mangled version which acts as a hashable proxy for the original.
Represents an incoming command, before it has been enqueued. One key difference between this and the command ref (and a ref is what you'll typically have) is that the certname in a ref may not be the actual certname, it may be the mangled version which acts as a hashable proxy for the original.
(create-command-req command
version
certname
producer-ts
compression
callback
command-stream)Inputs: [command :- s/Str version :- s/Int certname :- s/Str producer-ts :- (s/maybe s/Str) compression :- compression-file-extension-schema callback :- (s/=> s/Any s/Any) command-stream :- java.io.InputStream] Returns: command-req-schema
Validating constructor function for command requests
Inputs: [command :- s/Str version :- s/Int certname :- s/Str producer-ts :- (s/maybe s/Str) compression :- compression-file-extension-schema callback :- (s/=> s/Any s/Any) command-stream :- java.io.InputStream] Returns: command-req-schema Validating constructor function for command requests
(create-or-open-stockpile queue-dir maybe-send-cmd-event! cmd-event-ch)Opens an existing stockpile queue if one is present otherwise
creates a new stockpile queue at queue-dir
Opens an existing stockpile queue if one is present otherwise creates a new stockpile queue at `queue-dir`
(embeddable-certid certname max-utf8-bytes)Returns a certid, either the original certname or a hashable proxy for the original, that is safe to use as part of a filename on all of our the supported filesystems, and whose UTF-8 representation is no longer than max-utf8-bytes.
Returns a certid, either the original certname or a hashable proxy for the original, that is safe to use as part of a filename on all of our the supported filesystems, and whose UTF-8 representation is no longer than max-utf8-bytes.
(encode-command-time received-ts producer-ts)This takes the two time fields in the command header and encodes it
in a way that is more compact. These times need to be included in
the stockpile metadata string, so they should be as short as
possible. This will return a string that is received-ts as a long,
followed by a + or - and the difference between received-ts and
producer-ts as a long.
This takes the two time fields in the command header and encodes it in a way that is more compact. These times need to be included in the stockpile metadata string, so they should be as short as possible. This will return a string that is `received-ts` as a long, followed by a + or - and the difference between `received-ts` and `producer-ts` as a long.
(make-cmd-event cmdref kind)Given a cmdref and kind return a cmd-event-map which is suitable to be put on the cmd-event-chan. Valid :kind values are: ::command/ingested and ::command/processed.
Given a cmdref and kind return a cmd-event-map which is suitable to be put on the cmd-event-chan. Valid :kind values are: ::command/ingested and ::command/processed.
Maximum number of bytes allowed for our queue metadata, allowing room for stockpile's ID- prefix, where the ID is a long.
Maximum number of bytes allowed for our queue metadata, allowing room for stockpile's ID- prefix, where the ID is a long.
(message-loader q message-id-ceiling maybe-send-cmd-event! cmd-event-ch)Returns a function that will enqueue existing stockpile messages to
command-chan. Messages with ids less than message-id-ceiling
will be loaded to guard against duplicate processing of commands
when new commands are enqueued before all existing commands have
been enqueued. Note that there is no guarantee on the enqueuing
order of commands read from stockpile's reduce function
Returns a function that will enqueue existing stockpile messages to `command-chan`. Messages with ids less than `message-id-ceiling` will be loaded to guard against duplicate processing of commands when new commands are enqueued before all existing commands have been enqueued. Note that there is no guarantee on the enqueuing order of commands read from stockpile's reduce function
(metadata-parser)(metadata-parser metadata-command->puppetdb-command)Given an (optional) map between the command names that appear in metadata
strings and the command names used in the rest of PuppetDB, return a function
that parses a queue metadata string. If no map is provided, then the map
metadata-command->puppetdb-command defined in this namespace is used.
Note that the certname in this result will not be the same as the original
certname if the certname is long or contains filesystem special characters.
Given an (optional) map between the command names that appear in metadata strings and the command names used in the rest of PuppetDB, return a function that parses a queue metadata string. If no map is provided, then the map `metadata-command->puppetdb-command` defined in this namespace is used. Note that the certname in this result will not be the same as the original certname if the certname is long or contains filesystem special characters.
(metadata-serializer)(metadata-serializer puppetdb-command->metadata-command)Given an (optional) map between the command names used in the rest of
PuppetDB and the command names to use in metadata strings, return a function
that serializes command metadata to a string. If no map is provided, then the
map puppetdb-command->metadata-command defined in this namespace is used.
Note that the certname in the string will not be the same as the original
certname if the certname is long or contains filesystem special characters.
Given an (optional) map between the command names used in the rest of PuppetDB and the command names to use in metadata strings, return a function that serializes command metadata to a string. If no map is provided, then the map `puppetdb-command->metadata-command` defined in this namespace is used. Note that the certname in the string will not be the same as the original certname if the certname is long or contains filesystem special characters.
(sanitize-certname certname)Replace any underscores and filename forbidden characters found in certname
with dashes.
Replace any underscores and filename forbidden characters found in `certname` with dashes.
(sorted-command-buffer n)(sorted-command-buffer n delete-update-fn ignore-update-fn)(store-command q command-req)Inputs: [q command-req :- command-req-schema]
Inputs: [q command-req :- command-req-schema]
(store-in-stockpile q received command-req)Inputs: [q received :- pls/Timestamp command-req :- command-req-schema]
Inputs: [q received :- pls/Timestamp command-req :- command-req-schema]
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |