Liking cljdoc? Tell your friends :D

puppetlabs.services.jruby.jruby-puppet-core


cleanup-fnclj

(cleanup-fn instance)

Inputs: [instance]

Inputs: [instance]
sourceraw docstring

config->puppet-configclj

(config->puppet-config config)

Inputs: [config :- jruby-puppet-schemas/JRubyPuppetConfig] Returns: HashMap

Given the raw jruby-puppet configuration section, return a HashMap with the configuration necessary for ruby Puppet.

Inputs: [config :- jruby-puppet-schemas/JRubyPuppetConfig]
Returns: HashMap

Given the raw jruby-puppet configuration section, return a
HashMap with the configuration necessary for ruby Puppet.
sourceraw docstring

create-jruby-configclj

(create-jruby-config jruby-puppet-config
                     jruby-config
                     agent-shutdown-fn
                     profiler
                     metrics-service)

Inputs: [jruby-puppet-config :- jruby-puppet-schemas/JRubyPuppetConfig jruby-config :- #:schema{Keyword schema/Any} agent-shutdown-fn :- IFn profiler :- (schema/maybe PuppetProfiler) metrics-service] Returns: jruby-schemas/JRubyConfig

Handles creating a valid JRubyConfig map for use in the jruby-puppet-service. This method:

  • Creates the appropriate lifecycle functions
  • overrides the default ruby-load-path to include the ruby code directory from this project
Inputs: [jruby-puppet-config :- jruby-puppet-schemas/JRubyPuppetConfig jruby-config :- #:schema{Keyword schema/Any} agent-shutdown-fn :- IFn profiler :- (schema/maybe PuppetProfiler) metrics-service]
Returns: jruby-schemas/JRubyConfig

Handles creating a valid JRubyConfig map for use in the jruby-puppet-service.
This method:
* Creates the appropriate lifecycle functions
* overrides the default ruby-load-path to include the ruby code directory from
  this project
sourceraw docstring

default-http-connect-timeoutclj

The default number of milliseconds that the client will wait for a connection to be established. Currently set to 2 minutes.

The default number of milliseconds that the client will wait for a connection
to be established. Currently set to 2 minutes.
sourceraw docstring

default-http-metrics-enabledclj

The default for whether or not to enable http client metrics. Currently set to true.

The default for whether or not to enable http client metrics. Currently set to true.
sourceraw docstring

default-http-socket-timeoutclj

The default number of milliseconds that the client will allow for no data to be available on the socket. Currently set to 20 minutes.

The default number of milliseconds that the client will allow for no data to
be available on the socket. Currently set to 20 minutes.
sourceraw docstring

default-server-code-dirclj

source

default-server-conf-dirclj

source

default-server-log-dirclj

source

default-server-run-dirclj

source

default-server-var-dirclj

source

default-vendored-gems-dirclj

source

ensure-environmentclj

(ensure-environment environment-cache env-name)

Inputs: [environment-cache :- (schema/atom EnvironmentCache) env-name :- schema/Str] Returns: EnvironmentCache

Ensure the given environment exists within the EnvironmentCache.

Inputs: [environment-cache :- (schema/atom EnvironmentCache) env-name :- schema/Str]
Returns: EnvironmentCache

Ensure the given environment exists within the EnvironmentCache.
sourceraw docstring

environment-cache-entryclj

(environment-cache-entry)

Inputs: [] Returns: EnvironmentCacheEntry

Creates an initial EnvironmentCacheEntry

Inputs: []
Returns: EnvironmentCacheEntry

Creates an initial EnvironmentCacheEntry
sourceraw docstring

environment-class-info-cache-updated-with-tagclj

(environment-class-info-cache-updated-with-tag environment-cache
                                               env-name
                                               tag
                                               prior-content-version)

Inputs: [environment-cache :- EnvironmentCache env-name :- schema/Str tag :- (schema/maybe schema/Str) prior-content-version :- schema/Int] Returns: EnvironmentCache

DEPRECATED: see maybe-update-environment-info-service-cache

Updates the class info service tag in the given EnvironmentCache for the named environment, if the prior-content-version and the version currently in the cache are the same. If the two content versions are not the same, eg the cache has been invalidated, or otherwise moved since the action that computed the tag started, then the update will silently fail. Returns the given EnvironmentCache regardless of update status.

Inputs: [environment-cache :- EnvironmentCache env-name :- schema/Str tag :- (schema/maybe schema/Str) prior-content-version :- schema/Int]
Returns: EnvironmentCache

DEPRECATED: see `maybe-update-environment-info-service-cache`

Updates the class info service tag in the given EnvironmentCache for the
named environment, **if** the prior-content-version and the version currently
in the cache are the same. If the two content versions are not the same, eg
the cache has been invalidated, or otherwise moved since the action that
computed the tag started, then the update will silently fail. Returns the
given EnvironmentCache regardless of update status.
sourceraw docstring

EnvironmentCacheclj

Maps each environment to its cache entry

Maps each environment to its cache entry
sourceraw docstring

EnvironmentCacheEntryclj

Represents an environment with each cacheable info service as a key. The value for each info service is a map that contains a:

:tag Representing the latest value computed for that info service (this is the sanitized Etag used in subsequent HTTP cache checks).

:version Representing the version of the environment's content at a given tag. This is incremented whenever the environment cache is invalidated or new information is retrieved from the environment. New tag values are only accepted if they have a content-version parameter that matches the currently stored version, signifying that the cache was not invalidated while the tag was being computed.

Represents an environment with each cacheable info service as a key.
The value for each info service is a map that contains a:

  `:tag` Representing the latest value computed for that info service
         (this is the sanitized Etag used in subsequent HTTP cache checks).

  `:version` Representing the version of the environment's content at a
             given tag. This is incremented whenever the environment cache
             is invalidated or new information is retrieved from the
             environment. New tag values are only accepted if they have a
             content-version parameter that matches the **currently** stored
             version, signifying that the cache was not invalidated while
             the tag was being computed.
sourceraw docstring

extract-http-configclj

(extract-http-config config)

Inputs: [config :- (schema/maybe #:schema{Keyword schema/Any})]

The config is allowed to be nil because the http-client section isn't required in puppetserver's tk config

Inputs: [config :- (schema/maybe #:schema{Keyword schema/Any})]

The config is allowed to be nil because the http-client section isn't
required in puppetserver's tk config
sourceraw docstring

extract-jruby-configclj

(extract-jruby-config config)

Inputs: [config :- #:schema{Keyword schema/Any}]

Inputs: [config :- #:schema{Keyword schema/Any}]
sourceraw docstring

extract-puppet-configclj

(extract-puppet-config config)

Inputs: [config :- #:schema{Keyword schema/Any}]

Inputs: [config :- #:schema{Keyword schema/Any}]
sourceraw docstring

get-cached-content-versionclj

(get-cached-content-version environment-cache env-name info-service)

Inputs: [environment-cache :- (schema/atom EnvironmentCache) env-name :- schema/Str info-service :- schema/Keyword] Returns: schema/Int

Get the current version for a specific service's content within an environment, initializes environment if it did not already exist.

Inputs: [environment-cache :- (schema/atom EnvironmentCache) env-name :- schema/Str info-service :- schema/Keyword]
Returns: schema/Int

Get the current version for a specific service's content within an
environment, initializes environment if it did not already exist.
sourceraw docstring

get-environment-class-info-cache-generation-id!clj

(get-environment-class-info-cache-generation-id! environment-cache env-name)

Inputs: [environment-cache :- (schema/atom EnvironmentCache) env-name :- schema/Str] Returns: schema/Int

DEPRECATED: see get-info-service-version for replacement.

Get the current cache generation id for a specific environment's info cache. If no entry for the environment had existed at the point this function was called this function would, as a side effect, populate a new entry for that environment into the cache.

Inputs: [environment-cache :- (schema/atom EnvironmentCache) env-name :- schema/Str]
Returns: schema/Int

DEPRECATED: see `get-info-service-version` for replacement.

Get the current cache generation id for a specific environment's info cache.
If no entry for the environment had existed at the point this function was
called this function would, as a side effect, populate a new entry for that
environment into the cache.
sourceraw docstring

get-initialize-pool-instance-fnclj

(get-initialize-pool-instance-fn config profiler metrics-service multithreaded)

Inputs: [config :- jruby-puppet-schemas/JRubyPuppetConfig profiler :- (schema/maybe PuppetProfiler) metrics-service multithreaded :- schema/Bool] Returns: IFn

Inputs: [config :- jruby-puppet-schemas/JRubyPuppetConfig profiler :- (schema/maybe PuppetProfiler) metrics-service multithreaded :- schema/Bool]
Returns: IFn
sourceraw docstring

initialize-and-create-jruby-configclj

(initialize-and-create-jruby-config raw-config)
(initialize-and-create-jruby-config raw-config
                                    profiler
                                    agent-shutdown-fn
                                    metrics-service)

Inputs: ([raw-config :- {:jruby-puppet #:schema{Keyword schema/Any}, (schema/optional-key :http-client) #:schema{Keyword schema/Any}, schema/Keyword schema/Any}] [raw-config :- #:schema{Keyword schema/Any} profiler :- (schema/maybe PuppetProfiler) agent-shutdown-fn :- IFn metrics-service]) Returns: jruby-schemas/JRubyConfig

Handles the initialization of the jruby-puppet config (from the puppetserver.conf file), for the purpose of converting it to the structure required by the jruby-utils library (puppetlabs.services.jruby-pool-manager.jruby-schemas/JRubyConfig). This function will use data from the :jruby-puppet and :http-client sections of puppetserver.conf, from raw-config. If values are not provided, everything in :http-client :jruby-puppet will be given default values, except for :ruby-load-path and :gem-home, which are required.

The 1-arity function takes only a config and supplies a default of nil for the profiler and an empty fn for the agent-shutdown-fn. This arity is intended for uses where a jruby-config is required but will not be used to create a pool, such as the cli ruby subcommands.

The 5-arity function takes a profiler object and the metrics service. The profiler is placed into the puppetserver config through the :initialize-pool-instance lifecycle function. If the http-client -> metrics-enabled setting is set to true, then the metrics service is used to get a metrics registry for the :puppetserver domain, and the server id - these are also placed into the puppetserver config. The agent-shutdown-fn is run when a jruby-instance is terminated.

Inputs: ([raw-config :- {:jruby-puppet #:schema{Keyword schema/Any}, (schema/optional-key :http-client) #:schema{Keyword schema/Any}, schema/Keyword schema/Any}] [raw-config :- #:schema{Keyword schema/Any} profiler :- (schema/maybe PuppetProfiler) agent-shutdown-fn :- IFn metrics-service])
Returns: jruby-schemas/JRubyConfig

Handles the initialization of the jruby-puppet config (from the puppetserver.conf file),
for the purpose of converting it to the structure required by the jruby-utils
library (puppetlabs.services.jruby-pool-manager.jruby-schemas/JRubyConfig).
This function will use data from the :jruby-puppet and :http-client sections
of puppetserver.conf, from raw-config. If values are not provided, everything in
:http-client :jruby-puppet will be given default values, except for
:ruby-load-path and :gem-home, which are required.

The 1-arity function takes only a config and supplies a default of nil for the profiler
and an empty fn for the agent-shutdown-fn. This arity is intended for uses where a
jruby-config is required but will not be used to create a pool, such as the cli ruby
subcommands.

The 5-arity function takes a profiler object and the metrics service. The profiler is placed into
the puppetserver config through the :initialize-pool-instance lifecycle function. If the
`http-client -> metrics-enabled` setting is set to true, then the metrics service is used to get a
metrics registry for the `:puppetserver` domain, and the server id - these are also placed into
the puppetserver config. The agent-shutdown-fn is run when a jruby-instance is terminated.
sourceraw docstring

initialize-gem-pathclj

(initialize-gem-path {:keys [gem-home gem-path] :as jruby-config})

Inputs: [{:keys [gem-home gem-path], :as jruby-config} :- #:schema{Keyword schema/Any}]

Inputs: [{:keys [gem-home gem-path], :as jruby-config} :- #:schema{Keyword schema/Any}]
sourceraw docstring

initialize-puppet-configclj

(initialize-puppet-config http-config jruby-puppet-config multithreaded)

Inputs: [http-config :- #:schema{Keyword schema/Any} jruby-puppet-config :- #:schema{Keyword schema/Any} multithreaded :- schema/Bool] Returns: jruby-puppet-schemas/JRubyPuppetConfig

Inputs: [http-config :- #:schema{Keyword schema/Any} jruby-puppet-config :- #:schema{Keyword schema/Any} multithreaded :- schema/Bool]
Returns: jruby-puppet-schemas/JRubyPuppetConfig
sourceraw docstring

invalidate-environmentclj

(invalidate-environment environment-cache env-name)

Inputs: [environment-cache :- EnvironmentCache env-name :- schema/Str] Returns: EnvironmentCache

Return the EnvironmentCache with named environment invalidated.

Inputs: [environment-cache :- EnvironmentCache env-name :- schema/Str]
Returns: EnvironmentCache

Return the EnvironmentCache with named environment invalidated.
sourceraw docstring

invalidate-environment-cache-entryclj

(invalidate-environment-cache-entry maybe-environment-cache-entry)

Inputs: [maybe-environment-cache-entry :- (schema/maybe EnvironmentCacheEntry)] Returns: EnvironmentCacheEntry

Sets all info service tags to nil and increments their content versions

Inputs: [maybe-environment-cache-entry :- (schema/maybe EnvironmentCacheEntry)]
Returns: EnvironmentCacheEntry

Sets all info service tags to nil and increments their content versions
sourceraw docstring

managed-load-pathclj

(managed-load-path ruby-load-path)

Inputs: [ruby-load-path :- [schema/Str]] Returns: [schema/Str]

Return a list of ruby LOAD_PATH directories built from the user-configurable ruby-load-path setting of the jruby-puppet configuration.

Inputs: [ruby-load-path :- [schema/Str]]
Returns: [schema/Str]

Return a list of ruby LOAD_PATH directories built from the
user-configurable ruby-load-path setting of the jruby-puppet configuration.
sourceraw docstring

mark-all-environments-expired!clj

(mark-all-environments-expired! context environment-cache)

Inputs: [context :- jruby-schemas/PoolContext environment-cache :- (schema/atom EnvironmentCache)]

Mark all cached environments expired, in all JRuby instances.

Inputs: [context :- jruby-schemas/PoolContext environment-cache :- (schema/atom EnvironmentCache)]

Mark all cached environments expired, in all JRuby instances.
sourceraw docstring

mark-environment-expired!clj

(mark-environment-expired! context env-name environment-cache)

Inputs: [context :- jruby-schemas/PoolContext env-name :- schema/Str environment-cache :- (schema/atom EnvironmentCache)]

Mark the specified environment expired in the clojure managed cache and, using the Environment Expiration Service, in each JRuby instance.

Inputs: [context :- jruby-schemas/PoolContext env-name :- schema/Str environment-cache :- (schema/atom EnvironmentCache)]

Mark the specified environment expired in the clojure managed cache and,
using the Environment Expiration Service, in each JRuby instance.
sourceraw docstring

maybe-update-environment-info-service-cacheclj

(maybe-update-environment-info-service-cache environment-cache
                                             env-name
                                             svc-id
                                             tag
                                             prior-content-version)

Inputs: [environment-cache :- EnvironmentCache env-name :- schema/Str svc-id :- schema/Keyword tag :- (schema/maybe schema/Str) prior-content-version :- schema/Int] Returns: EnvironmentCache

Updates the requested info service tag in the given EnvironmentCache for the named environment, if the prior-content-version and the version currently in the cache are the same. If the two content versions are not the same, eg the cache has been invalidated, or otherwise moved since the action that computed the tag started, then the update will silently fail. Returns the given EnvironmentCache regardless of update status.

Inputs: [environment-cache :- EnvironmentCache env-name :- schema/Str svc-id :- schema/Keyword tag :- (schema/maybe schema/Str) prior-content-version :- schema/Int]
Returns: EnvironmentCache

Updates the requested info service tag in the given EnvironmentCache for
the named environment, **if** the prior-content-version and the version
currently in the cache are the same. If the two content versions are not the
same, eg the cache has been invalidated, or otherwise moved since the action
that computed the tag started, then the update will silently fail. Returns
the given EnvironmentCache regardless of update status.
sourceraw docstring

MetricsInfoclj

source

multithreaded?clj

(multithreaded? config)

Inputs: [config :- #:schema{Keyword schema/Any}]

Inputs: [config :- #:schema{Keyword schema/Any}]
sourceraw docstring

ruby-code-dirclj

The name of the directory containing the ruby code in this project.

This directory is relative to src/ruby and works from source because the src/ruby directory is defined as a resource in project.clj which places the directory on the classpath which in turn makes the directory available on the JRuby load path. Similarly, this works from the uberjar because this directory is placed into the root of the jar structure which is on the classpath.

See also: https://www.javadoc.io/doc/org.jruby/jruby-core/latest/org/jruby/runtime/load/LoadService.html

The name of the directory containing the ruby code in this project.

This directory is relative to `src/ruby` and works from source because the
`src/ruby` directory is defined as a resource in `project.clj` which places
the directory on the classpath which in turn makes the directory available on
the JRuby load path.  Similarly, this works from the uberjar because this
directory is placed into the root of the jar structure which is on the
classpath.

See also:  https://www.javadoc.io/doc/org.jruby/jruby-core/latest/org/jruby/runtime/load/LoadService.html
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