elasticgraph-datastore_core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/elastic_graph/datastore_core/config.rb +265 -37
- data/lib/elastic_graph/datastore_core/configuration/cluster_definition.rb +8 -20
- data/lib/elastic_graph/datastore_core/configuration/index_definition.rb +1 -1
- data/lib/elastic_graph/datastore_core.rb +1 -1
- metadata +16 -17
- data/lib/elastic_graph/datastore_core/configuration/client_faraday_adapter.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82cda2b331f4a1eb7111a446031627802fe44b0460cb3ebb15ede1db975ac53
|
4
|
+
data.tar.gz: 65797d36a520d041e8095ba734ddf6a6c19ad39c2caabdacc3765c840bbc162b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b78b03e874a0177ecaf152a9cea09bb5ac791ba5fb1aafb5d8228a9c5b588df744235ade212eb1ee705f578434387855042c64b67ba910bdd20ff629cf547a42
|
7
|
+
data.tar.gz: 9c88f94fe2acd6c20503b8f67037968219393dd2bb41677debf788f1b6cb8e27f53c17b6fbb60ef67c2e57817b7901ab551046af7bab1c61dd29dfff1cb645ed
|
@@ -6,7 +6,7 @@
|
|
6
6
|
#
|
7
7
|
# frozen_string_literal: true
|
8
8
|
|
9
|
-
require "elastic_graph/
|
9
|
+
require "elastic_graph/support/config"
|
10
10
|
require "elastic_graph/datastore_core/configuration/cluster_definition"
|
11
11
|
require "elastic_graph/datastore_core/configuration/index_definition"
|
12
12
|
require "elastic_graph/errors"
|
@@ -14,45 +14,273 @@ require "elastic_graph/errors"
|
|
14
14
|
module ElasticGraph
|
15
15
|
class DatastoreCore
|
16
16
|
# Defines the configuration related to datastores.
|
17
|
-
class Config < ::
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
17
|
+
class Config < Support::Config.define(:client_faraday_adapter, :clusters, :index_definitions, :log_traffic, :max_client_retries)
|
18
|
+
all_json_schema_types = ["array", "string", "number", "boolean", "object", "null"]
|
19
|
+
|
20
|
+
json_schema at: "datastore",
|
21
|
+
optional: false,
|
22
|
+
description: "Configuration for datastore connections and index definitions used by all parts of ElasticGraph.",
|
23
|
+
properties: {
|
24
|
+
client_faraday_adapter: {
|
25
|
+
type: "object",
|
26
|
+
description: "Configuration of the faraday adapter to use with the datastore client.",
|
27
|
+
properties: {
|
28
|
+
name: {
|
29
|
+
type: ["string", "null"],
|
30
|
+
minLength: 1,
|
31
|
+
description: "The faraday adapter to use with the datastore client, such as `httpx` or `typhoeus`.",
|
32
|
+
examples: ["net_http", "httpx", "typhoeus", nil],
|
33
|
+
default: nil
|
34
|
+
},
|
35
|
+
require: {
|
36
|
+
type: ["string", "null"],
|
37
|
+
minLength: 1,
|
38
|
+
description: "A Ruby library to require which provides the named adapter (optional).",
|
39
|
+
examples: ["httpx/adapters/faraday"],
|
40
|
+
default: nil
|
41
|
+
}
|
42
|
+
},
|
43
|
+
default: {"name" => nil, "require" => nil},
|
44
|
+
examples: [
|
45
|
+
{"name" => "net_http"},
|
46
|
+
{"name" => "httpx", "require" => "httpx/adapters/faraday"}
|
47
|
+
]
|
48
|
+
},
|
49
|
+
|
50
|
+
clusters: {
|
51
|
+
type: "object",
|
52
|
+
description: "Map of datastore cluster definitions, keyed by cluster name. The names will be referenced within " \
|
53
|
+
"`index_definitions` by `query_cluster` and `index_into_clusters` to identify datastore clusters.",
|
54
|
+
patternProperties: {
|
55
|
+
/.+/.source => {
|
56
|
+
type: "object",
|
57
|
+
description: "Configuration for a specific datastore cluster.",
|
58
|
+
examples: [{
|
59
|
+
url: "http://localhost:9200",
|
60
|
+
backend: "elasticsearch",
|
61
|
+
settings: {"cluster.max_shards_per_node" => 2000}
|
62
|
+
}],
|
63
|
+
properties: {
|
64
|
+
url: {
|
65
|
+
type: "string",
|
66
|
+
minLength: 1,
|
67
|
+
description: "The URL of the datastore cluster.",
|
68
|
+
examples: ["http://localhost:9200", "https://my-cluster.example.com:9200"]
|
69
|
+
},
|
70
|
+
backend: {
|
71
|
+
enum: ["elasticsearch", "opensearch"],
|
72
|
+
description: "Determines whether `elasticgraph-elasticsearch` or `elasticgraph-opensearch` is used for the datastore client.",
|
73
|
+
examples: ["elasticsearch", "opensearch"]
|
74
|
+
},
|
75
|
+
settings: {
|
76
|
+
type: "object",
|
77
|
+
description: "Datastore settings in flattened (i.e. dot-separated) name form.",
|
78
|
+
patternProperties: {/.+/.source => {"type" => all_json_schema_types}},
|
79
|
+
examples: [{"cluster.max_shards_per_node" => 2000}],
|
80
|
+
default: {} # : untyped
|
81
|
+
}
|
82
|
+
},
|
83
|
+
required: ["url", "backend"]
|
84
|
+
}
|
85
|
+
},
|
86
|
+
examples: [{
|
87
|
+
"main" => {
|
88
|
+
url: "http://localhost:9200",
|
89
|
+
backend: "elasticsearch",
|
90
|
+
settings: {"cluster.max_shards_per_node" => 2000}
|
91
|
+
}
|
92
|
+
}]
|
93
|
+
},
|
94
|
+
|
95
|
+
index_definitions: {
|
96
|
+
type: "object",
|
97
|
+
description: "Map of index definition names to `IndexDefinition` objects containing customizations for the named index definitions for this environment.",
|
98
|
+
patternProperties: {
|
99
|
+
/.+/.source => {
|
100
|
+
type: "object",
|
101
|
+
description: "Configuration for a specific index definition.",
|
102
|
+
examples: [example_index_def = {
|
103
|
+
"query_cluster" => "main",
|
104
|
+
"index_into_clusters" => ["main"],
|
105
|
+
"ignore_routing_values" => ["ABC1234567"], # : untyped
|
106
|
+
"setting_overrides" => {
|
107
|
+
"number_of_shards" => 256
|
108
|
+
},
|
109
|
+
"setting_overrides_by_timestamp" => {
|
110
|
+
"2022-01-01T00:00:00Z" => {
|
111
|
+
"number_of_shards" => 64
|
112
|
+
},
|
113
|
+
"2023-01-01T00:00:00Z" => {
|
114
|
+
"number_of_shards" => 96
|
115
|
+
},
|
116
|
+
"2024-01-01T00:00:00Z" => {
|
117
|
+
"number_of_shards" => 128
|
118
|
+
}
|
119
|
+
},
|
120
|
+
"custom_timestamp_ranges" => [
|
121
|
+
{
|
122
|
+
"index_name_suffix" => "before_2022",
|
123
|
+
"lt" => "2022-01-01T00:00:00Z",
|
124
|
+
"setting_overrides" => {"number_of_shards" => 32}
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"index_name_suffix" => "after_2026",
|
128
|
+
"gte" => "2027-01-01T00:00:00Z",
|
129
|
+
"setting_overrides" => {"number_of_shards" => 32}
|
130
|
+
}
|
131
|
+
]
|
132
|
+
}],
|
133
|
+
properties: {
|
134
|
+
query_cluster: {
|
135
|
+
type: "string",
|
136
|
+
description: "Named search cluster to be used for queries on this index. The value must match be a key in the `clusters` map.",
|
137
|
+
examples: ["main", "search_cluster"]
|
138
|
+
},
|
139
|
+
index_into_clusters: {
|
140
|
+
type: "array",
|
141
|
+
items: {type: "string", minLength: 1},
|
142
|
+
description: "Named search clusters to index data into. The values must match keys in the `clusters` map.",
|
143
|
+
examples: [["main"], ["cluster1", "cluster2"]]
|
144
|
+
},
|
145
|
+
ignore_routing_values: {
|
146
|
+
type: "array",
|
147
|
+
items: {"type" => "string"},
|
148
|
+
description: "Shard routing values for which the data should be spread across all shards instead of concentrating it " \
|
149
|
+
"on a single shard. This is intended to be used when a handful of known routing value contain such a large portion " \
|
150
|
+
"of the dataset that it extremely lopsided shards would result. Spreading the data across all shards may perform " \
|
151
|
+
"better.",
|
152
|
+
default: [], # : untyped
|
153
|
+
examples: [
|
154
|
+
[], # : untyped
|
155
|
+
["mega_tenant1", "mega_tenant2"]
|
156
|
+
]
|
157
|
+
},
|
158
|
+
setting_overrides: {
|
159
|
+
type: "object",
|
160
|
+
description: "Overrides for index (or index template) settings. The settings specified here will override any settings " \
|
161
|
+
"specified on the Ruby schema definition. This is commonly used to configure a different `number_of_shards` in each " \
|
162
|
+
"environment. An `index.` prefix will be added to the names of all settings before submitting them to the datastore.",
|
163
|
+
patternProperties: {/.+/.source => {"type" => all_json_schema_types}},
|
164
|
+
default: {}, # :untyped
|
165
|
+
examples: [{"number_of_shards" => 5}]
|
166
|
+
},
|
167
|
+
setting_overrides_by_timestamp: {
|
168
|
+
type: "object",
|
169
|
+
description: "Overrides for index template settings for specific dates, allowing variation of settings for different " \
|
170
|
+
"rollover indices. This is commonly used to configure a different `number_of_shards` for each year or month when " \
|
171
|
+
"using yearly or monthly rollover.",
|
172
|
+
propertyNames: {type: "string", format: "date-time"},
|
173
|
+
additionalProperties: {type: "object", patternProperties: {/.+/.source => {"type" => all_json_schema_types}}},
|
174
|
+
default: {}, # : untyped
|
175
|
+
examples: [{"2025-01-01T00:00:00Z" => {"number_of_shards" => 10}}]
|
176
|
+
},
|
177
|
+
custom_timestamp_ranges: {
|
178
|
+
type: "array",
|
179
|
+
description: "Array of custom timestamp ranges that allow different index settings for specific time periods.",
|
180
|
+
items: {
|
181
|
+
type: "object",
|
182
|
+
properties: {
|
183
|
+
index_name_suffix: {
|
184
|
+
type: "string",
|
185
|
+
description: "Suffix to append to the index name for this custom range.",
|
186
|
+
examples: ["before_2020", "after_2027"]
|
187
|
+
},
|
188
|
+
setting_overrides: {
|
189
|
+
type: "object",
|
190
|
+
description: "Setting overrides for this custom timestamp range.",
|
191
|
+
patternProperties: {/.+/.source => {"type" => all_json_schema_types}},
|
192
|
+
examples: [{"number_of_shards" => 17}, {"number_of_replicas" => 2}]
|
193
|
+
},
|
194
|
+
lt: {
|
195
|
+
type: ["string", "null"],
|
196
|
+
format: "date-time",
|
197
|
+
description: "Less than timestamp boundary (ISO 8601 format).",
|
198
|
+
examples: ["2015-01-01T00:00:00Z", "2020-12-31T23:59:59Z"],
|
199
|
+
default: nil
|
200
|
+
},
|
201
|
+
lte: {
|
202
|
+
type: ["string", "null"],
|
203
|
+
format: "date-time",
|
204
|
+
description: "Less than or equal timestamp boundary (ISO 8601 format).",
|
205
|
+
examples: ["2015-01-01T00:00:00Z", "2020-12-31T23:59:59Z"],
|
206
|
+
default: nil
|
207
|
+
},
|
208
|
+
gt: {
|
209
|
+
type: ["string", "null"],
|
210
|
+
format: "date-time",
|
211
|
+
description: "Greater than timestamp boundary (ISO 8601 format).",
|
212
|
+
examples: ["2015-01-01T00:00:00Z", "2020-01-01T00:00:00Z"],
|
213
|
+
default: nil
|
214
|
+
},
|
215
|
+
gte: {
|
216
|
+
type: ["string", "null"],
|
217
|
+
format: "date-time",
|
218
|
+
description: "Greater than or equal timestamp boundary (ISO 8601 format).",
|
219
|
+
examples: ["2015-01-01T00:00:00Z", "2020-01-01T00:00:00Z"],
|
220
|
+
default: nil
|
221
|
+
}
|
222
|
+
},
|
223
|
+
required: ["index_name_suffix", "setting_overrides"],
|
224
|
+
anyOf: [
|
225
|
+
{required: ["lt"]},
|
226
|
+
{required: ["lte"]},
|
227
|
+
{required: ["gt"]},
|
228
|
+
{required: ["gte"]}
|
229
|
+
]
|
230
|
+
},
|
231
|
+
default: [], # : untyped
|
232
|
+
examples: [[{
|
233
|
+
"index_name_suffix" => "before_2015",
|
234
|
+
"lt" => "2015-01-01T00:00:00Z",
|
235
|
+
"setting_overrides" => {"number_of_shards" => 17}
|
236
|
+
}]]
|
237
|
+
}
|
238
|
+
},
|
239
|
+
required: ["query_cluster", "index_into_clusters"]
|
240
|
+
}
|
241
|
+
},
|
242
|
+
examples: [{"widgets" => example_index_def}]
|
243
|
+
},
|
244
|
+
|
245
|
+
log_traffic: {
|
246
|
+
type: "boolean",
|
247
|
+
description: "Determines if we log requests/responses to/from the datastore.",
|
248
|
+
default: false,
|
249
|
+
examples: [false, true]
|
250
|
+
},
|
251
|
+
|
252
|
+
max_client_retries: {
|
253
|
+
type: "integer",
|
254
|
+
description: "Passed down to the datastore client. Controls the number of times ElasticGraph attempts a call against the " \
|
255
|
+
"datastore before failing. Retrying a handful of times is generally advantageous, since some sporadic failures are expected " \
|
256
|
+
"during the course of operation, and better to retry than fail the entire call.",
|
257
|
+
default: 3,
|
258
|
+
minimum: 0,
|
259
|
+
examples: [3, 5, 10]
|
260
|
+
}
|
261
|
+
},
|
262
|
+
required: ["clusters", "index_definitions"]
|
263
|
+
|
264
|
+
private
|
265
|
+
|
266
|
+
def convert_values(clusters:, index_definitions:, client_faraday_adapter:, **values)
|
267
|
+
clusters = Configuration::ClusterDefinition.definitions_by_name_hash_from(clusters)
|
268
|
+
index_definitions = Configuration::IndexDefinition.definitions_by_name_hash_from(index_definitions)
|
269
|
+
client_faraday_adapter = Configuration::ClientFaradayAdapter.new(
|
270
|
+
name: client_faraday_adapter.fetch("name")&.to_sym,
|
271
|
+
require: client_faraday_adapter.fetch("require")
|
52
272
|
)
|
273
|
+
|
274
|
+
values.merge({
|
275
|
+
client_faraday_adapter: client_faraday_adapter,
|
276
|
+
clusters: clusters,
|
277
|
+
index_definitions: index_definitions
|
278
|
+
})
|
53
279
|
end
|
280
|
+
end
|
54
281
|
|
55
|
-
|
282
|
+
module Configuration
|
283
|
+
ClientFaradayAdapter = ::Data.define(:name, :require)
|
56
284
|
end
|
57
285
|
end
|
58
286
|
end
|
@@ -12,25 +12,15 @@ module ElasticGraph
|
|
12
12
|
class DatastoreCore
|
13
13
|
module Configuration
|
14
14
|
class ClusterDefinition < ::Data.define(:url, :backend_client_class, :settings)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
raise Errors::ConfigError, "Unknown `datastore.clusters` config settings: #{extra_keys.join(", ")}"
|
20
|
-
end
|
15
|
+
BACKEND_CLIENT_CLASSES = {
|
16
|
+
"elasticsearch" => "ElasticGraph::Elasticsearch::Client",
|
17
|
+
"opensearch" => "ElasticGraph::OpenSearch::Client"
|
18
|
+
}
|
21
19
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
require "elastic_graph/elasticsearch/client"
|
27
|
-
Elasticsearch::Client
|
28
|
-
when "opensearch"
|
29
|
-
require "elastic_graph/opensearch/client"
|
30
|
-
OpenSearch::Client
|
31
|
-
else
|
32
|
-
raise Errors::ConfigError, "Unknown `datastore.clusters` backend: `#{backend_name}`. Valid backends are `elasticsearch` and `opensearch`."
|
33
|
-
end
|
20
|
+
def self.from_hash(hash)
|
21
|
+
backend_name = hash.fetch("backend")
|
22
|
+
require "elastic_graph/#{backend_name}/client"
|
23
|
+
backend_client_class = ::Object.const_get(BACKEND_CLIENT_CLASSES.fetch(backend_name))
|
34
24
|
|
35
25
|
new(
|
36
26
|
url: hash.fetch("url"),
|
@@ -44,8 +34,6 @@ module ElasticGraph
|
|
44
34
|
from_hash(cluster_def_hash)
|
45
35
|
end
|
46
36
|
end
|
47
|
-
|
48
|
-
EXPECTED_KEYS = members.map(&:to_s) - ["backend_client_class"] + ["backend"]
|
49
37
|
end
|
50
38
|
end
|
51
39
|
end
|
@@ -22,7 +22,7 @@ module ElasticGraph
|
|
22
22
|
|
23
23
|
def self.from_parsed_yaml(parsed_yaml, &client_customization_block)
|
24
24
|
new(
|
25
|
-
config: DatastoreCore::Config.from_parsed_yaml(parsed_yaml),
|
25
|
+
config: DatastoreCore::Config.from_parsed_yaml!(parsed_yaml),
|
26
26
|
logger: Support::Logger.from_parsed_yaml(parsed_yaml),
|
27
27
|
schema_artifacts: SchemaArtifacts.from_parsed_yaml(parsed_yaml),
|
28
28
|
client_customization_block: client_customization_block
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elasticgraph-datastore_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Myron Marston
|
@@ -17,84 +17,84 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 1.0.
|
20
|
+
version: 1.0.1
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 1.0.
|
27
|
+
version: 1.0.1
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: elasticgraph-support
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '='
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: 1.0.
|
34
|
+
version: 1.0.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - '='
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: 1.0.
|
41
|
+
version: 1.0.1
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: elasticgraph-admin
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 1.0.
|
48
|
+
version: 1.0.1
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.0.
|
55
|
+
version: 1.0.1
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: elasticgraph-elasticsearch
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 1.0.
|
62
|
+
version: 1.0.1
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - '='
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 1.0.
|
69
|
+
version: 1.0.1
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: elasticgraph-opensearch
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - '='
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.0.
|
76
|
+
version: 1.0.1
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - '='
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 1.0.
|
83
|
+
version: 1.0.1
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: elasticgraph-schema_definition
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - '='
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 1.0.
|
90
|
+
version: 1.0.1
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - '='
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 1.0.
|
97
|
+
version: 1.0.1
|
98
98
|
email:
|
99
99
|
- myron@squareup.com
|
100
100
|
executables: []
|
@@ -105,7 +105,6 @@ files:
|
|
105
105
|
- README.md
|
106
106
|
- lib/elastic_graph/datastore_core.rb
|
107
107
|
- lib/elastic_graph/datastore_core/config.rb
|
108
|
-
- lib/elastic_graph/datastore_core/configuration/client_faraday_adapter.rb
|
109
108
|
- lib/elastic_graph/datastore_core/configuration/cluster_definition.rb
|
110
109
|
- lib/elastic_graph/datastore_core/configuration/index_definition.rb
|
111
110
|
- lib/elastic_graph/datastore_core/index_config_normalizer.rb
|
@@ -119,10 +118,10 @@ licenses:
|
|
119
118
|
- MIT
|
120
119
|
metadata:
|
121
120
|
bug_tracker_uri: https://github.com/block/elasticgraph/issues
|
122
|
-
changelog_uri: https://github.com/block/elasticgraph/releases/tag/v1.0.
|
123
|
-
documentation_uri: https://block.github.io/elasticgraph/api-docs/v1.0.
|
121
|
+
changelog_uri: https://github.com/block/elasticgraph/releases/tag/v1.0.1
|
122
|
+
documentation_uri: https://block.github.io/elasticgraph/api-docs/v1.0.1/
|
124
123
|
homepage_uri: https://block.github.io/elasticgraph/
|
125
|
-
source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.
|
124
|
+
source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.1/elasticgraph-datastore_core
|
126
125
|
gem_category: core
|
127
126
|
rdoc_options: []
|
128
127
|
require_paths:
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# Copyright 2024 - 2025 Block, Inc.
|
2
|
-
#
|
3
|
-
# Use of this source code is governed by an MIT-style
|
4
|
-
# license that can be found in the LICENSE file or at
|
5
|
-
# https://opensource.org/licenses/MIT.
|
6
|
-
#
|
7
|
-
# frozen_string_literal: true
|
8
|
-
|
9
|
-
module ElasticGraph
|
10
|
-
class DatastoreCore
|
11
|
-
module Configuration
|
12
|
-
class ClientFaradayAdapter < ::Data.define(
|
13
|
-
# The faraday adapter to use with the datastore client, such as `httpx` or `typhoeus`.
|
14
|
-
# For more info, see:
|
15
|
-
# https://github.com/elastic/elasticsearch-ruby/commit/a7bbdbf2a96168c1b33dca46ee160d2d4d75ada0
|
16
|
-
:name,
|
17
|
-
# A Ruby library to require which provides the named adapter (optional).
|
18
|
-
:require
|
19
|
-
)
|
20
|
-
def self.from_parsed_yaml(parsed_yaml)
|
21
|
-
parsed_yaml = parsed_yaml.fetch("client_faraday_adapter") || {}
|
22
|
-
extra_keys = parsed_yaml.keys - EXPECTED_KEYS
|
23
|
-
|
24
|
-
unless extra_keys.empty?
|
25
|
-
raise Errors::ConfigError, "Unknown `datastore.client_faraday_adapter` config settings: #{extra_keys.join(", ")}"
|
26
|
-
end
|
27
|
-
|
28
|
-
new(
|
29
|
-
name: parsed_yaml["name"]&.to_sym,
|
30
|
-
require: parsed_yaml["require"]
|
31
|
-
)
|
32
|
-
end
|
33
|
-
|
34
|
-
EXPECTED_KEYS = members.map(&:to_s)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|