Class: Esse::ClusterEngine
- Inherits:
-
Object
- Object
- Esse::ClusterEngine
- Defined in:
- lib/esse/cluster_engine.rb
Constant Summary collapse
- OPENSEARCH_FORK_VERSION =
'7.10.2'
Instance Attribute Summary collapse
-
#distribution ⇒ Object
readonly
Returns the value of attribute distribution.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #elasticsearch? ⇒ Boolean
- #engine_version ⇒ Object
-
#initialize(distribution:, version:) ⇒ ClusterEngine
constructor
A new instance of ClusterEngine.
- #mapping_default_type ⇒ Object
- #mapping_single_type? ⇒ Boolean
- #opensearch? ⇒ Boolean
Constructor Details
#initialize(distribution:, version:) ⇒ ClusterEngine
Returns a new instance of ClusterEngine.
9 10 11 12 |
# File 'lib/esse/cluster_engine.rb', line 9 def initialize(distribution:, version:) @distribution = distribution @version = version end |
Instance Attribute Details
#distribution ⇒ Object (readonly)
Returns the value of attribute distribution.
7 8 9 |
# File 'lib/esse/cluster_engine.rb', line 7 def distribution @distribution end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
7 8 9 |
# File 'lib/esse/cluster_engine.rb', line 7 def version @version end |
Instance Method Details
#elasticsearch? ⇒ Boolean
24 25 26 |
# File 'lib/esse/cluster_engine.rb', line 24 def elasticsearch? distribution == 'elasticsearch' end |
#engine_version ⇒ Object
14 15 16 17 18 |
# File 'lib/esse/cluster_engine.rb', line 14 def engine_version return @version unless opensearch? OPENSEARCH_FORK_VERSION end |
#mapping_default_type ⇒ Object
36 37 38 39 40 |
# File 'lib/esse/cluster_engine.rb', line 36 def mapping_default_type return unless engine_version.to_i == 6 engine_version >= '6.4' ? :_doc : :doc end |
#mapping_single_type? ⇒ Boolean
29 30 31 |
# File 'lib/esse/cluster_engine.rb', line 29 def mapping_single_type? engine_version >= '6' end |
#opensearch? ⇒ Boolean
20 21 22 |
# File 'lib/esse/cluster_engine.rb', line 20 def opensearch? distribution == 'opensearch' end |