Liking cljdoc? Tell your friends :D

puppetlabs.puppetdb.scf.hash


catalog-resource-identity-formatclj

(catalog-resource-identity-format resource)

Narrow resource to only contain the needed key/values for computing the hash of the given resource.

Narrow `resource` to only contain the needed key/values for computing the hash of
the given resource.
sourceraw docstring

catalog-similarity-formatclj

(catalog-similarity-format certname resources edges)

Creates catalog map for the given certname, resources and edges with a stable ordering that can be used to create a hash consistently.

Creates catalog map for the given `certname`, `resources` and `edges` with a
stable ordering that can be used to create a hash consistently.
sourceraw docstring

catalog-similarity-hashclj

(catalog-similarity-hash {:keys [certname resources edges] :as _catalog})

Compute a hash for the given catalog's content

This hash is useful for situations where you'd like to determine whether or not two catalogs contain the same things (edges, resources, etc).

Note that this hash cannot be used to uniquely identify a catalog within a population! This is because we're only examing a subset of a catalog's attributes. For example, two otherwise identical catalogs with different :version's would have the same similarity hash, but don't represent the same catalog across time.

Compute a hash for the given catalog's content

This hash is useful for situations where you'd like to determine
whether or not two catalogs contain the same things (edges,
resources, etc).

Note that this hash *cannot* be used to uniquely identify a catalog
within a population! This is because we're only examing a subset of
a catalog's attributes. For example, two otherwise identical
catalogs with different :version's would have the same similarity
hash, but don't represent the same catalog across time.
sourceraw docstring

edge-comparatorclj

(edge-comparator {lhs-source :source :as lhs} {rhs-source :source :as rhs})

Function used for comparing two edges by their source/target resources, suitable for the clojure sort function.

Function used for comparing two edges by their source/target resources, suitable
for the clojure sort function.
sourceraw docstring

fact-identity-hashclj

(fact-identity-hash fact-data)

Compute a hash for a fact's content

This hash is useful for situations where you'd like to determine whether or not two sets of facts are identical, excluding timestamps and producer.

Compute a hash for a fact's content

This hash is useful for situations where you'd like to determine
whether or not two sets of facts are identical, excluding timestamps
and producer.
sourceraw docstring

generic-identity-hashclj

(generic-identity-hash data)

Convert a data structure into a serialized format then grab a sha1 hash for it so that can be used for quick comparisons for storage duplication tests.

Convert a data structure into a serialized format then grab a sha1 hash for
it so that can be used for quick comparisons for storage duplication tests.
sourceraw docstring

generic-identity-sha1-bytesclj

(generic-identity-sha1-bytes data)

Returns a SHA1 fingerprint for the provided data structure as a 20 byte array.

Returns a SHA1 fingerprint for the provided data structure as a 20
byte array.
sourceraw docstring

generic-identity-stringclj

(generic-identity-string data)

Serialize a data structure into a format that can be hashed for uniqueness comparisons. See generic-identity-hash for a usage that generates a hash instead.

Serialize a data structure into a format that can be hashed for uniqueness
comparisons. See `generic-identity-hash` for a usage that generates a hash
instead.
sourceraw docstring

package-identity-hashclj

(package-identity-hash package)

Inputs: [package :- package-tuple] Returns: hashed-package-tuple

Inputs: [package :- package-tuple]
Returns: hashed-package-tuple
sourceraw docstring

package-similarity-hashclj

(package-similarity-hash packages)

Inputs: [packages :- [hashed-package-tuple]] Returns: s/Str

Creates a stable ordering of packages and computes a hash over that structure

Inputs: [packages :- [hashed-package-tuple]]
Returns: s/Str

Creates a stable ordering of `packages` and computes a hash over
that structure
sourceraw docstring

report-identity-hashclj

(report-identity-hash {:keys [certname puppet_version report_format
                              configuration_version start_time end_time
                              producer_timestamp transaction_uuid]
                       :as _report})

Compute a hash for a report's content

This hash is useful for situations where you'd like to determine whether or not two reports contain the same things (certname, configuration version, timestamps, events).

Compute a hash for a report's content

This hash is useful for situations where you'd like to determine
whether or not two reports contain the same things (certname,
configuration version, timestamps, events).
sourceraw docstring

resource-comparatorclj

(resource-comparator {lhs-title :title :as lhs} {rhs-title :title :as rhs})

Compares two resources by the title and type. Useful in calls to sort to get a stable ordering of resources.

Compares two resources by the title and type.  Useful in calls to sort to
get a stable ordering of resources.
sourceraw docstring

resource-event-identity-pkeyclj

(resource-event-identity-pkey {:keys [report_id resource_type resource_title
                                      property timestamp status old_value
                                      new_value message file line name]
                               :as _event})

Compute a hash for a resource-event's content, used as a primary key

This is similar to resource-event-identity-string but it also includes the report id.

Compute a hash for a resource-event's content, used as a primary key

This is similar to resource-event-identity-string but it also includes the report id.
sourceraw docstring

resource-event-identity-stringclj

(resource-event-identity-string {:keys [resource_type resource_title property
                                        timestamp status old_value new_value
                                        message file line]
                                 :as _resource_event})

Compute a string suitable for hashing a resource event

This hash is useful for situations where you'd like to determine whether or not two resource events are identical (resource type, resource title, property, values, status, timestamp, etc.)

Compute a string suitable for hashing a resource event

This hash is useful for situations where you'd like to determine
whether or not two resource events are identical (resource type, resource title,
property, values, status, timestamp, etc.)
sourceraw docstring

resource-identity-hashclj

(resource-identity-hash {:keys [type title parameters] :as resource})

Compute a hash for a given resource that will uniquely identify it for storage deduplication only.

See resource-identity-hash*. This variant takes a full resource as a parameter, whereas resource-identity-hash* takes specific attribute of the resource as parameters.

Compute a hash for a given resource that will uniquely identify it
_for storage deduplication only_.

See `resource-identity-hash*`. This variant takes a full resource as
a parameter, whereas `resource-identity-hash*` takes specific
attribute of the resource as parameters.
sourceraw docstring

resource-identity-hash*clj

(resource-identity-hash* type title parameters)

Compute a hash for a given resource that will uniquely identify it for storage deduplication only.

A resource is represented by a map that itself contains maps and sets in addition to scalar values. We want two resources with the same attributes to be equal for the purpose of deduping, therefore we need to make sure that when generating a hash for a resource we look at a stably-sorted view of the resource. Thus, we need to sort both the resource as a whole as well as any nested collections it contains.

This differs from catalog-resource-identity-string in that it doesn't consider resource metadata. This function is used to determine whether a resource needs to be stored or is already present in the database.

See resource-identity-hash. This variant takes specific attribute of the resource as parameters, whereas resource-identity-hash takes a full resource as a parameter. By taking only the minimum required parameters, this function becomes amenable to more efficient memoization.

Compute a hash for a given resource that will uniquely identify it
_for storage deduplication only_.

A resource is represented by a map that itself contains maps and
sets in addition to scalar values. We want two resources with the
same attributes to be equal for the purpose of deduping, therefore
we need to make sure that when generating a hash for a resource we
look at a stably-sorted view of the resource. Thus, we need to sort
both the resource as a whole as well as any nested collections it
contains.

This differs from `catalog-resource-identity-string` in that it
doesn't consider resource metadata. This function is used to
determine whether a resource needs to be stored or is already
present in the database.

See `resource-identity-hash`. This variant takes specific attribute
of the resource as parameters, whereas `resource-identity-hash`
takes a full resource as a parameter. By taking only the minimum
required parameters, this function becomes amenable to more efficient
memoization.
sourceraw docstring

sha1-bytes?clj

Returns true if x is a 20 byte array.

Returns true if x is a 20 byte array.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close