elasticgraph-datastore_core 1.0.1 → 1.0.3.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c82cda2b331f4a1eb7111a446031627802fe44b0460cb3ebb15ede1db975ac53
4
- data.tar.gz: 65797d36a520d041e8095ba734ddf6a6c19ad39c2caabdacc3765c840bbc162b
3
+ metadata.gz: 50cd9a0218949bf68b68f42d3d82de30734cd6ea6e35c3f7fcdb83b83d408a36
4
+ data.tar.gz: 68591cfde1aa6ff9026eba4299706ca53ade1c3b616165c7c38aaf276a8c1936
5
5
  SHA512:
6
- metadata.gz: b78b03e874a0177ecaf152a9cea09bb5ac791ba5fb1aafb5d8228a9c5b588df744235ade212eb1ee705f578434387855042c64b67ba910bdd20ff629cf547a42
7
- data.tar.gz: 9c88f94fe2acd6c20503b8f67037968219393dd2bb41677debf788f1b6cb8e27f53c17b6fbb60ef67c2e57817b7901ab551046af7bab1c61dd29dfff1cb645ed
6
+ metadata.gz: 4f8fcd9935274310aa92fe8355b817c6ffa467d9dcbfbb8bbdb2deeb319793444af58183705910a36becc789ef3d0d0d8f22621afb68e2dbd2223ba7c049a7c3
7
+ data.tar.gz: 8f7c71fa3defff209551591d9fe672dd04df461d7d3ceeaf4e4c352111db4dcb5d6a98e9939ef0f7be3684182d7609bb30d8a2e22ae5a8f658672f5ca1827142
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 - 2025 Block, Inc.
3
+ Copyright (c) 2024 - 2026 Block, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -53,32 +53,16 @@ module ElasticGraph
53
53
  end
54
54
 
55
55
  # Indicates if a search on this index definition may hit incomplete documents. An incomplete document
56
- # can occur when multiple event types flow into the same index. An index that has only one source type
57
- # can never have incomplete documents, but an index that has 2 or more sources can have incomplete
56
+ # can occur when multiple event types flow into the same index. An index that has had only one source type
57
+ # can never have incomplete documents, but an index that has had 2 or more sources can have incomplete
58
58
  # documents when the "primary" event type hasn't yet been received for a document.
59
59
  #
60
60
  # This case is notable because we need to apply automatic filtering in order to hide documents that are
61
61
  # not yet complete.
62
62
  #
63
- # Note: determining this value sometimes requires that we query the datastore for the record of all
64
- # sources that an index has ever had. This value changes very, very rarely, and we don't want to slow
65
- # down every GraphQL query by adding the extra query against the datastore, so we cache the value here.
63
+ # This flag should be set via `has_had_multiple_sources!` in the schema definition when `sourced_from` is used.
66
64
  def searches_could_hit_incomplete_docs?
67
- return @searches_could_hit_incomplete_docs if defined?(@searches_could_hit_incomplete_docs)
68
-
69
- if current_sources.size > 1
70
- # We know that incomplete docs are possible, without needing to check sources recorded in `_meta`.
71
- @searches_could_hit_incomplete_docs = true
72
- else
73
- # While our current configuration can't produce incomplete documents, some may already exist in the index
74
- # if we previously had some `sourced_from` fields (but no longer have them). Here we check for the sources
75
- # we've recorded in `_meta` to account for that.
76
- client = datastore_clients_by_name.fetch(cluster_to_query)
77
- recorded_sources = mappings_in_datastore(client).dig("_meta", "ElasticGraph", "sources") || []
78
- sources = recorded_sources.union(current_sources.to_a)
79
-
80
- @searches_could_hit_incomplete_docs = sources.size > 1
81
- end
65
+ has_had_multiple_sources
82
66
  end
83
67
 
84
68
  def cluster_to_query
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -15,11 +15,11 @@ module ElasticGraph
15
15
  module IndexDefinition
16
16
  class Index < Support::MemoizableData.define(
17
17
  :name, :route_with, :default_sort_clauses, :current_sources, :fields_by_path,
18
- :env_index_config, :defined_clusters, :datastore_clients_by_name, :env_agnostic_settings
18
+ :env_index_config, :defined_clusters, :datastore_clients_by_name, :env_agnostic_settings, :has_had_multiple_sources
19
19
  )
20
20
  # `Data.define` provides all these methods:
21
21
  # @dynamic name, route_with, default_sort_clauses, current_sources, fields_by_path, env_index_config, env_agnostic_settings
22
- # @dynamic defined_clusters, datastore_clients_by_name, initialize,
22
+ # @dynamic defined_clusters, datastore_clients_by_name, initialize, has_had_multiple_sources
23
23
 
24
24
  # `include IndexDefinition::Base` provides all these methods. Steep should be able to detect it
25
25
  # but can't for some reason so we have to declare them with `@dynamic`.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -23,11 +23,11 @@ module ElasticGraph
23
23
  class RolloverIndexTemplate < Support::MemoizableData.define(
24
24
  :name, :route_with, :default_sort_clauses, :current_sources, :fields_by_path, :env_index_config,
25
25
  :index_args, :defined_clusters, :datastore_clients_by_name, :timestamp_field_path, :frequency,
26
- :env_agnostic_settings
26
+ :env_agnostic_settings, :has_had_multiple_sources
27
27
  )
28
28
  # `Data.define` provides all these methods:
29
29
  # @dynamic name, route_with, default_sort_clauses, current_sources, fields_by_path, env_index_config, env_agnostic_settings
30
- # @dynamic index_args, defined_clusters, datastore_clients_by_name, timestamp_field_path, frequency, initialize
30
+ # @dynamic index_args, defined_clusters, datastore_clients_by_name, timestamp_field_path, frequency, initialize, has_had_multiple_sources
31
31
 
32
32
  # `include IndexDefinition::Base` provides all these methods. Steep should be able to detect it
33
33
  # but can't for some reason so we have to declare them with `@dynamic`.
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
@@ -32,7 +32,8 @@ module ElasticGraph
32
32
  fields_by_path: runtime_metadata.fields_by_path,
33
33
  env_index_config: env_index_config,
34
34
  defined_clusters: config.clusters.keys.to_set,
35
- datastore_clients_by_name: datastore_clients_by_name
35
+ datastore_clients_by_name: datastore_clients_by_name,
36
+ has_had_multiple_sources: runtime_metadata.has_had_multiple_sources
36
37
  }
37
38
 
38
39
  if (rollover = runtime_metadata.rollover)
@@ -1,4 +1,4 @@
1
- # Copyright 2024 - 2025 Block, Inc.
1
+ # Copyright 2024 - 2026 Block, Inc.
2
2
  #
3
3
  # Use of this source code is governed by an MIT-style
4
4
  # license that can be found in the LICENSE file or at
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.1
4
+ version: 1.0.3.rc1
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.1
20
+ version: 1.0.3.rc1
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.1
27
+ version: 1.0.3.rc1
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.1
34
+ version: 1.0.3.rc1
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.1
41
+ version: 1.0.3.rc1
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.1
48
+ version: 1.0.3.rc1
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.1
55
+ version: 1.0.3.rc1
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.1
62
+ version: 1.0.3.rc1
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.1
69
+ version: 1.0.3.rc1
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.1
76
+ version: 1.0.3.rc1
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.1
83
+ version: 1.0.3.rc1
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.1
90
+ version: 1.0.3.rc1
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.1
97
+ version: 1.0.3.rc1
98
98
  email:
99
99
  - myron@squareup.com
100
100
  executables: []
@@ -118,10 +118,10 @@ licenses:
118
118
  - MIT
119
119
  metadata:
120
120
  bug_tracker_uri: https://github.com/block/elasticgraph/issues
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/
121
+ changelog_uri: https://github.com/block/elasticgraph/releases/tag/v1.0.3.rc1
122
+ documentation_uri: https://block.github.io/elasticgraph/api-docs/v1.0.3.rc1/
123
123
  homepage_uri: https://block.github.io/elasticgraph/
124
- source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.1/elasticgraph-datastore_core
124
+ source_code_uri: https://github.com/block/elasticgraph/tree/v1.0.3.rc1/elasticgraph-datastore_core
125
125
  gem_category: core
126
126
  rdoc_options: []
127
127
  require_paths:
@@ -133,14 +133,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
133
  version: '3.4'
134
134
  - - "<"
135
135
  - !ruby/object:Gem::Version
136
- version: '3.5'
136
+ version: '4.1'
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
139
  - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  requirements: []
143
- rubygems_version: 3.6.9
143
+ rubygems_version: 4.0.3
144
144
  specification_version: 4
145
145
  summary: Contains the core datastore logic used by the rest of ElasticGraph.
146
146
  test_files: []