(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.
(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:
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 projectThe 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.
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.
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.
(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.
(environment-cache-entry)Inputs: [] Returns: EnvironmentCacheEntry
Creates an initial EnvironmentCacheEntry
Inputs: [] Returns: EnvironmentCacheEntry Creates an initial EnvironmentCacheEntry
(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.
Maps each environment to its cache entry
Maps each environment to its cache entry
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.(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(extract-jruby-config config)Inputs: [config :- #:schema{Keyword schema/Any}]
Inputs: [config :- #:schema{Keyword schema/Any}]
(extract-puppet-config config)Inputs: [config :- #:schema{Keyword schema/Any}]
Inputs: [config :- #:schema{Keyword schema/Any}]
(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.
(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.
(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
(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.(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}]
(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(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.
(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
(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.
(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.
(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.
(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.
(multithreaded? config)Inputs: [config :- #:schema{Keyword schema/Any}]
Inputs: [config :- #:schema{Keyword schema/Any}]
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
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 |