deimos-ruby 1.17.1 → 1.18.0
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/.rubocop.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/README.md +19 -0
- data/docs/CONFIGURATION.md +8 -3
- data/lib/deimos/config/configuration.rb +19 -7
- data/lib/deimos/schema_backends/mock.rb +1 -1
- data/lib/deimos/utils/db_poller/base.rb +139 -0
- data/lib/deimos/utils/db_poller/state_based.rb +57 -0
- data/lib/deimos/utils/db_poller/time_based.rb +82 -0
- data/lib/deimos/utils/db_poller.rb +22 -170
- data/lib/deimos/version.rb +1 -1
- data/rbs_collection.lock.yaml +43 -19
- data/sig/defs.rbs +234 -173
- data/spec/utils/db_poller_spec.rb +48 -35
- metadata +5 -2
data/rbs_collection.lock.yaml
CHANGED
@@ -11,7 +11,7 @@ gems:
|
|
11
11
|
source:
|
12
12
|
type: git
|
13
13
|
name: ruby/gem_rbs_collection
|
14
|
-
revision:
|
14
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
15
15
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
16
16
|
repo_dir: gems
|
17
17
|
- name: actionview
|
@@ -19,7 +19,7 @@ gems:
|
|
19
19
|
source:
|
20
20
|
type: git
|
21
21
|
name: ruby/gem_rbs_collection
|
22
|
-
revision:
|
22
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
23
23
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
24
24
|
repo_dir: gems
|
25
25
|
- name: activejob
|
@@ -27,7 +27,7 @@ gems:
|
|
27
27
|
source:
|
28
28
|
type: git
|
29
29
|
name: ruby/gem_rbs_collection
|
30
|
-
revision:
|
30
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
31
31
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
32
32
|
repo_dir: gems
|
33
33
|
- name: activemodel
|
@@ -35,7 +35,7 @@ gems:
|
|
35
35
|
source:
|
36
36
|
type: git
|
37
37
|
name: ruby/gem_rbs_collection
|
38
|
-
revision:
|
38
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
39
39
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
40
40
|
repo_dir: gems
|
41
41
|
- name: activerecord
|
@@ -43,7 +43,7 @@ gems:
|
|
43
43
|
source:
|
44
44
|
type: git
|
45
45
|
name: ruby/gem_rbs_collection
|
46
|
-
revision:
|
46
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
47
47
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
48
48
|
repo_dir: gems
|
49
49
|
- name: activestorage
|
@@ -51,7 +51,7 @@ gems:
|
|
51
51
|
source:
|
52
52
|
type: git
|
53
53
|
name: ruby/gem_rbs_collection
|
54
|
-
revision:
|
54
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
55
55
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
56
56
|
repo_dir: gems
|
57
57
|
- name: activesupport
|
@@ -59,7 +59,7 @@ gems:
|
|
59
59
|
source:
|
60
60
|
type: git
|
61
61
|
name: ruby/gem_rbs_collection
|
62
|
-
revision:
|
62
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
63
63
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
64
64
|
repo_dir: gems
|
65
65
|
- name: ast
|
@@ -67,19 +67,23 @@ gems:
|
|
67
67
|
source:
|
68
68
|
type: git
|
69
69
|
name: ruby/gem_rbs_collection
|
70
|
-
revision:
|
70
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
71
71
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
72
72
|
repo_dir: gems
|
73
|
-
- name:
|
74
|
-
version:
|
73
|
+
- name: dogstatsd-ruby
|
74
|
+
version: '5.5'
|
75
75
|
source:
|
76
|
-
type:
|
76
|
+
type: git
|
77
|
+
name: ruby/gem_rbs_collection
|
78
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
79
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
80
|
+
repo_dir: gems
|
77
81
|
- name: i18n
|
78
82
|
version: '1.10'
|
79
83
|
source:
|
80
84
|
type: git
|
81
85
|
name: ruby/gem_rbs_collection
|
82
|
-
revision:
|
86
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
83
87
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
84
88
|
repo_dir: gems
|
85
89
|
- name: listen
|
@@ -87,7 +91,15 @@ gems:
|
|
87
91
|
source:
|
88
92
|
type: git
|
89
93
|
name: ruby/gem_rbs_collection
|
90
|
-
revision:
|
94
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
95
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
96
|
+
repo_dir: gems
|
97
|
+
- name: mail
|
98
|
+
version: '2.8'
|
99
|
+
source:
|
100
|
+
type: git
|
101
|
+
name: ruby/gem_rbs_collection
|
102
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
91
103
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
92
104
|
repo_dir: gems
|
93
105
|
- name: minitest
|
@@ -99,7 +111,7 @@ gems:
|
|
99
111
|
source:
|
100
112
|
type: git
|
101
113
|
name: ruby/gem_rbs_collection
|
102
|
-
revision:
|
114
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
103
115
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
104
116
|
repo_dir: gems
|
105
117
|
- name: parallel
|
@@ -107,7 +119,7 @@ gems:
|
|
107
119
|
source:
|
108
120
|
type: git
|
109
121
|
name: ruby/gem_rbs_collection
|
110
|
-
revision:
|
122
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
111
123
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
112
124
|
repo_dir: gems
|
113
125
|
- name: phobos
|
@@ -115,11 +127,11 @@ gems:
|
|
115
127
|
source:
|
116
128
|
type: rubygems
|
117
129
|
- name: rack
|
118
|
-
version: 2.2
|
130
|
+
version: '2.2'
|
119
131
|
source:
|
120
132
|
type: git
|
121
133
|
name: ruby/gem_rbs_collection
|
122
|
-
revision:
|
134
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
123
135
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
124
136
|
repo_dir: gems
|
125
137
|
- name: railties
|
@@ -127,7 +139,7 @@ gems:
|
|
127
139
|
source:
|
128
140
|
type: git
|
129
141
|
name: ruby/gem_rbs_collection
|
130
|
-
revision:
|
142
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
131
143
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
132
144
|
repo_dir: gems
|
133
145
|
- name: rainbow
|
@@ -135,9 +147,13 @@ gems:
|
|
135
147
|
source:
|
136
148
|
type: git
|
137
149
|
name: ruby/gem_rbs_collection
|
138
|
-
revision:
|
150
|
+
revision: ec15faa1e16b3f4596eb80eabc902bd2589028cf
|
139
151
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
140
152
|
repo_dir: gems
|
153
|
+
- name: steep
|
154
|
+
version: 1.1.1
|
155
|
+
source:
|
156
|
+
type: rubygems
|
141
157
|
- name: tempfile
|
142
158
|
version: '0'
|
143
159
|
source:
|
@@ -170,6 +186,14 @@ gems:
|
|
170
186
|
version: '0'
|
171
187
|
source:
|
172
188
|
type: stdlib
|
189
|
+
- name: cgi
|
190
|
+
version: '0'
|
191
|
+
source:
|
192
|
+
type: stdlib
|
193
|
+
- name: uri
|
194
|
+
version: '0'
|
195
|
+
source:
|
196
|
+
type: stdlib
|
173
197
|
- name: tsort
|
174
198
|
version: '0'
|
175
199
|
source:
|
data/sig/defs.rbs
CHANGED
@@ -663,52 +663,147 @@ module Deimos
|
|
663
663
|
def self.send_produce_error: (ActiveSupport::Notifications::Event event) -> void
|
664
664
|
end
|
665
665
|
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
666
|
+
# Record that keeps track of which topics are being worked on by DbProducers.
|
667
|
+
class KafkaTopicInfo < ActiveRecord::Base
|
668
|
+
# Lock a topic for the given ID. Returns whether the lock was successful.
|
669
|
+
#
|
670
|
+
# _@param_ `topic`
|
671
|
+
#
|
672
|
+
# _@param_ `lock_id`
|
673
|
+
def self.lock: (String topic, String lock_id) -> bool
|
670
674
|
|
671
|
-
|
672
|
-
|
675
|
+
# This is called once a producer is finished working on a topic, i.e.
|
676
|
+
# there are no more messages to fetch. It unlocks the topic and
|
677
|
+
# moves on to the next one.
|
678
|
+
#
|
679
|
+
# _@param_ `topic`
|
680
|
+
#
|
681
|
+
# _@param_ `lock_id`
|
682
|
+
def self.clear_lock: (String topic, String lock_id) -> void
|
673
683
|
|
674
|
-
|
675
|
-
|
684
|
+
# Update all topics that aren't currently locked and have no messages
|
685
|
+
# waiting. It's OK if some messages get inserted in the middle of this
|
686
|
+
# because the point is that at least within a few milliseconds of each
|
687
|
+
# other, it wasn't locked and had no messages, meaning the topic
|
688
|
+
# was in a good state.
|
689
|
+
# realized had messages in them, meaning all other topics were empty.
|
690
|
+
#
|
691
|
+
# _@param_ `except_topics` — the list of topics we've just
|
692
|
+
def self.ping_empty_topics: (::Array[String] except_topics) -> void
|
676
693
|
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
694
|
+
# The producer calls this if it gets an error sending messages. This
|
695
|
+
# essentially locks down this topic for 1 minute (for all producers)
|
696
|
+
# and allows the caller to continue to the next topic.
|
697
|
+
#
|
698
|
+
# _@param_ `topic`
|
699
|
+
#
|
700
|
+
# _@param_ `lock_id`
|
701
|
+
def self.register_error: (String topic, String lock_id) -> void
|
702
|
+
|
703
|
+
# Update the locked_at timestamp to indicate that the producer is still
|
704
|
+
# working on those messages and to continue.
|
705
|
+
#
|
706
|
+
# _@param_ `topic`
|
707
|
+
#
|
708
|
+
# _@param_ `lock_id`
|
709
|
+
def self.heartbeat: (String topic, String lock_id) -> void
|
710
|
+
end
|
683
711
|
|
684
|
-
|
685
|
-
|
712
|
+
module SchemaClass
|
713
|
+
# Base Class for Schema Classes generated from Avro.
|
714
|
+
class Base
|
715
|
+
# _@param_ `_args`
|
716
|
+
def initialize: (*::Array[Object] _args) -> void
|
686
717
|
|
687
|
-
#
|
688
|
-
|
718
|
+
# Converts the object to a hash which can be used for debugging or comparing objects.
|
719
|
+
#
|
720
|
+
# _@param_ `_opts`
|
721
|
+
#
|
722
|
+
# _@return_ — a hash representation of the payload
|
723
|
+
def as_json: (?::Hash[untyped, untyped] _opts) -> ::Hash[untyped, untyped]
|
689
724
|
|
690
|
-
#
|
691
|
-
#
|
692
|
-
|
725
|
+
# _@param_ `key`
|
726
|
+
#
|
727
|
+
# _@param_ `val`
|
728
|
+
def []=: ((String | Symbol) key, Object val) -> void
|
693
729
|
|
694
|
-
# _@param_ `
|
695
|
-
def
|
730
|
+
# _@param_ `other`
|
731
|
+
def ==: (SchemaClass::Base other) -> bool
|
696
732
|
|
697
|
-
|
698
|
-
def process_updates: () -> void
|
733
|
+
def inspect: () -> String
|
699
734
|
|
700
|
-
#
|
735
|
+
# Initializes this class from a given value
|
701
736
|
#
|
702
|
-
# _@param_ `
|
703
|
-
def
|
737
|
+
# _@param_ `value`
|
738
|
+
def self.initialize_from_value: (Object value) -> SchemaClass::Base
|
704
739
|
|
705
|
-
|
706
|
-
|
740
|
+
def hash: () -> Integer
|
741
|
+
end
|
742
|
+
|
743
|
+
# Base Class for Enum Classes generated from Avro.
|
744
|
+
class Enum < Deimos::SchemaClass::Base
|
745
|
+
# _@param_ `other`
|
746
|
+
def ==: (Deimos::SchemaClass::Enum other) -> bool
|
707
747
|
|
708
|
-
|
709
|
-
|
748
|
+
def to_s: () -> String
|
749
|
+
|
750
|
+
# _@param_ `value`
|
751
|
+
def initialize: (String value) -> void
|
752
|
+
|
753
|
+
# Returns all the valid symbols for this enum.
|
754
|
+
def symbols: () -> ::Array[String]
|
755
|
+
|
756
|
+
def as_json: (?::Hash[untyped, untyped] _opts) -> String
|
757
|
+
|
758
|
+
def self.initialize_from_value: (Object value) -> SchemaClass::Enum
|
759
|
+
|
760
|
+
attr_accessor value: String
|
710
761
|
end
|
711
762
|
|
763
|
+
# Base Class of Record Classes generated from Avro.
|
764
|
+
class Record < Deimos::SchemaClass::Base
|
765
|
+
# Converts the object attributes to a hash which can be used for Kafka
|
766
|
+
#
|
767
|
+
# _@return_ — the payload as a hash.
|
768
|
+
def to_h: () -> ::Hash[untyped, untyped]
|
769
|
+
|
770
|
+
# Merge a hash or an identical schema object with this one and return a new object.
|
771
|
+
#
|
772
|
+
# _@param_ `other_hash`
|
773
|
+
def merge: ((::Hash[untyped, untyped] | SchemaClass::Base) other_hash) -> SchemaClass::Base
|
774
|
+
|
775
|
+
# Element access method as if this Object were a hash
|
776
|
+
#
|
777
|
+
# _@param_ `key`
|
778
|
+
#
|
779
|
+
# _@return_ — The value of the attribute if exists, nil otherwise
|
780
|
+
def []: ((String | Symbol) key) -> Object
|
781
|
+
|
782
|
+
def with_indifferent_access: () -> SchemaClass::Record
|
783
|
+
|
784
|
+
# Returns the schema name of the inheriting class.
|
785
|
+
def schema: () -> String
|
786
|
+
|
787
|
+
# Returns the namespace for the schema of the inheriting class.
|
788
|
+
def namespace: () -> String
|
789
|
+
|
790
|
+
# Returns the full schema name of the inheriting class.
|
791
|
+
def full_schema: () -> String
|
792
|
+
|
793
|
+
# Returns the schema validator from the schema backend
|
794
|
+
def validator: () -> Deimos::SchemaBackends::Base
|
795
|
+
|
796
|
+
# _@return_ — an array of fields names in the schema.
|
797
|
+
def schema_fields: () -> ::Array[String]
|
798
|
+
|
799
|
+
def self.initialize_from_value: (Object value) -> SchemaClass::Record
|
800
|
+
|
801
|
+
# Returns the value of attribute tombstone_key.
|
802
|
+
attr_accessor tombstone_key: untyped
|
803
|
+
end
|
804
|
+
end
|
805
|
+
|
806
|
+
module Utils
|
712
807
|
# Class which continually polls the kafka_messages table
|
713
808
|
# in the database and sends Kafka messages.
|
714
809
|
class DbProducer
|
@@ -862,6 +957,112 @@ module Deimos
|
|
862
957
|
def self.use?: (::Hash[untyped, untyped] config) -> bool
|
863
958
|
end
|
864
959
|
|
960
|
+
# Class which continually polls the database and sends Kafka messages.
|
961
|
+
module DbPoller
|
962
|
+
class PollStatus < Struct
|
963
|
+
def current_batch: () -> Integer
|
964
|
+
|
965
|
+
def report: () -> String
|
966
|
+
|
967
|
+
# Returns the value of attribute batches_processed
|
968
|
+
attr_accessor batches_processed: Object
|
969
|
+
|
970
|
+
# Returns the value of attribute batches_errored
|
971
|
+
attr_accessor batches_errored: Object
|
972
|
+
|
973
|
+
# Returns the value of attribute messages_processed
|
974
|
+
attr_accessor messages_processed: Object
|
975
|
+
end
|
976
|
+
|
977
|
+
class Base
|
978
|
+
BATCH_SIZE: Integer
|
979
|
+
|
980
|
+
# _@param_ `config_name`
|
981
|
+
def self.class_for_config: (Symbol config_name) -> singleton(Deimos::Utils::DbPoller)
|
982
|
+
|
983
|
+
# Begin the DB Poller process.
|
984
|
+
def self.start!: () -> void
|
985
|
+
|
986
|
+
# _@param_ `config`
|
987
|
+
def initialize: (FigTree::ConfigStruct config) -> void
|
988
|
+
|
989
|
+
# Start the poll:
|
990
|
+
# 1) Grab the current PollInfo from the database indicating the last
|
991
|
+
# time we ran
|
992
|
+
# 2) On a loop, process all the recent updates between the last time
|
993
|
+
# we ran and now.
|
994
|
+
def start: () -> void
|
995
|
+
|
996
|
+
# Grab the PollInfo or create if it doesn't exist.
|
997
|
+
def retrieve_poll_info: () -> void
|
998
|
+
|
999
|
+
def create_poll_info: () -> Deimos::PollInfo
|
1000
|
+
|
1001
|
+
# Indicate whether this current loop should process updates. Most loops
|
1002
|
+
# will busy-wait (sleeping 0.1 seconds) until it's ready.
|
1003
|
+
def should_run?: () -> bool
|
1004
|
+
|
1005
|
+
# Stop the poll.
|
1006
|
+
def stop: () -> void
|
1007
|
+
|
1008
|
+
# Send messages for updated data.
|
1009
|
+
def process_updates: () -> void
|
1010
|
+
|
1011
|
+
# _@param_ `batch`
|
1012
|
+
#
|
1013
|
+
# _@param_ `status`
|
1014
|
+
def process_batch_with_span: (::Array[ActiveRecord::Base] batch, PollStatus status) -> bool
|
1015
|
+
|
1016
|
+
# _@param_ `batch`
|
1017
|
+
def process_batch: (::Array[ActiveRecord::Base] batch) -> void
|
1018
|
+
|
1019
|
+
# Needed for Executor so it can identify the worker
|
1020
|
+
attr_reader id: Integer
|
1021
|
+
|
1022
|
+
attr_reader config: ::Hash[untyped, untyped]
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
class TimeBased < Deimos::Utils::DbPoller::Base
|
1026
|
+
BATCH_SIZE: Integer
|
1027
|
+
|
1028
|
+
# :nodoc:
|
1029
|
+
def create_poll_info: () -> Deimos::PollInfo
|
1030
|
+
|
1031
|
+
# _@param_ `batch`
|
1032
|
+
#
|
1033
|
+
# _@param_ `status`
|
1034
|
+
def process_and_touch_info: (::Array[ActiveRecord::Base] batch, Deimos::Utils::DbPoller::PollStatus status) -> untyped
|
1035
|
+
|
1036
|
+
# Send messages for updated data.
|
1037
|
+
def process_updates: () -> void
|
1038
|
+
|
1039
|
+
# _@param_ `time_from`
|
1040
|
+
#
|
1041
|
+
# _@param_ `time_to`
|
1042
|
+
def fetch_results: (ActiveSupport::TimeWithZone time_from, ActiveSupport::TimeWithZone time_to) -> ActiveRecord::Relation
|
1043
|
+
|
1044
|
+
# _@param_ `record`
|
1045
|
+
def last_updated: (ActiveRecord::Base record) -> ActiveSupport::TimeWithZone
|
1046
|
+
|
1047
|
+
# _@param_ `batch`
|
1048
|
+
def touch_info: (::Array[ActiveRecord::Base] batch) -> void
|
1049
|
+
end
|
1050
|
+
|
1051
|
+
class StateBased < Deimos::Utils::DbPoller::Base
|
1052
|
+
BATCH_SIZE: Integer
|
1053
|
+
|
1054
|
+
# Send messages for updated data.
|
1055
|
+
def process_updates: () -> void
|
1056
|
+
|
1057
|
+
def fetch_results: () -> ActiveRecord::Relation
|
1058
|
+
|
1059
|
+
# _@param_ `batch`
|
1060
|
+
#
|
1061
|
+
# _@param_ `success`
|
1062
|
+
def finalize_batch: (::Array[ActiveRecord::Base] batch, bool success) -> void
|
1063
|
+
end
|
1064
|
+
end
|
1065
|
+
|
865
1066
|
# Utility class to retry a given block if a a deadlock is encountered.
|
866
1067
|
# Supports Postgres and MySQL deadlocks and lock wait timeouts.
|
867
1068
|
class DeadlockRetry
|
@@ -1010,146 +1211,6 @@ module Deimos
|
|
1010
1211
|
end
|
1011
1212
|
end
|
1012
1213
|
|
1013
|
-
# Record that keeps track of which topics are being worked on by DbProducers.
|
1014
|
-
class KafkaTopicInfo < ActiveRecord::Base
|
1015
|
-
# Lock a topic for the given ID. Returns whether the lock was successful.
|
1016
|
-
#
|
1017
|
-
# _@param_ `topic`
|
1018
|
-
#
|
1019
|
-
# _@param_ `lock_id`
|
1020
|
-
def self.lock: (String topic, String lock_id) -> bool
|
1021
|
-
|
1022
|
-
# This is called once a producer is finished working on a topic, i.e.
|
1023
|
-
# there are no more messages to fetch. It unlocks the topic and
|
1024
|
-
# moves on to the next one.
|
1025
|
-
#
|
1026
|
-
# _@param_ `topic`
|
1027
|
-
#
|
1028
|
-
# _@param_ `lock_id`
|
1029
|
-
def self.clear_lock: (String topic, String lock_id) -> void
|
1030
|
-
|
1031
|
-
# Update all topics that aren't currently locked and have no messages
|
1032
|
-
# waiting. It's OK if some messages get inserted in the middle of this
|
1033
|
-
# because the point is that at least within a few milliseconds of each
|
1034
|
-
# other, it wasn't locked and had no messages, meaning the topic
|
1035
|
-
# was in a good state.
|
1036
|
-
# realized had messages in them, meaning all other topics were empty.
|
1037
|
-
#
|
1038
|
-
# _@param_ `except_topics` — the list of topics we've just
|
1039
|
-
def self.ping_empty_topics: (::Array[String] except_topics) -> void
|
1040
|
-
|
1041
|
-
# The producer calls this if it gets an error sending messages. This
|
1042
|
-
# essentially locks down this topic for 1 minute (for all producers)
|
1043
|
-
# and allows the caller to continue to the next topic.
|
1044
|
-
#
|
1045
|
-
# _@param_ `topic`
|
1046
|
-
#
|
1047
|
-
# _@param_ `lock_id`
|
1048
|
-
def self.register_error: (String topic, String lock_id) -> void
|
1049
|
-
|
1050
|
-
# Update the locked_at timestamp to indicate that the producer is still
|
1051
|
-
# working on those messages and to continue.
|
1052
|
-
#
|
1053
|
-
# _@param_ `topic`
|
1054
|
-
#
|
1055
|
-
# _@param_ `lock_id`
|
1056
|
-
def self.heartbeat: (String topic, String lock_id) -> void
|
1057
|
-
end
|
1058
|
-
|
1059
|
-
module SchemaClass
|
1060
|
-
# Base Class for Schema Classes generated from Avro.
|
1061
|
-
class Base
|
1062
|
-
# _@param_ `_args`
|
1063
|
-
def initialize: (*::Array[Object] _args) -> void
|
1064
|
-
|
1065
|
-
# Converts the object to a hash which can be used for debugging or comparing objects.
|
1066
|
-
#
|
1067
|
-
# _@param_ `_opts`
|
1068
|
-
#
|
1069
|
-
# _@return_ — a hash representation of the payload
|
1070
|
-
def as_json: (?::Hash[untyped, untyped] _opts) -> ::Hash[untyped, untyped]
|
1071
|
-
|
1072
|
-
# _@param_ `key`
|
1073
|
-
#
|
1074
|
-
# _@param_ `val`
|
1075
|
-
def []=: ((String | Symbol) key, Object val) -> void
|
1076
|
-
|
1077
|
-
# _@param_ `other`
|
1078
|
-
def ==: (SchemaClass::Base other) -> bool
|
1079
|
-
|
1080
|
-
def inspect: () -> String
|
1081
|
-
|
1082
|
-
# Initializes this class from a given value
|
1083
|
-
#
|
1084
|
-
# _@param_ `value`
|
1085
|
-
def self.initialize_from_value: (Object value) -> SchemaClass::Base
|
1086
|
-
|
1087
|
-
def hash: () -> Integer
|
1088
|
-
end
|
1089
|
-
|
1090
|
-
# Base Class for Enum Classes generated from Avro.
|
1091
|
-
class Enum < Deimos::SchemaClass::Base
|
1092
|
-
# _@param_ `other`
|
1093
|
-
def ==: (Deimos::SchemaClass::Enum other) -> bool
|
1094
|
-
|
1095
|
-
def to_s: () -> String
|
1096
|
-
|
1097
|
-
# _@param_ `value`
|
1098
|
-
def initialize: (String value) -> void
|
1099
|
-
|
1100
|
-
# Returns all the valid symbols for this enum.
|
1101
|
-
def symbols: () -> ::Array[String]
|
1102
|
-
|
1103
|
-
def as_json: (?::Hash[untyped, untyped] _opts) -> String
|
1104
|
-
|
1105
|
-
def self.initialize_from_value: (Object value) -> SchemaClass::Enum
|
1106
|
-
|
1107
|
-
attr_accessor value: String
|
1108
|
-
end
|
1109
|
-
|
1110
|
-
# Base Class of Record Classes generated from Avro.
|
1111
|
-
class Record < Deimos::SchemaClass::Base
|
1112
|
-
# Converts the object attributes to a hash which can be used for Kafka
|
1113
|
-
#
|
1114
|
-
# _@return_ — the payload as a hash.
|
1115
|
-
def to_h: () -> ::Hash[untyped, untyped]
|
1116
|
-
|
1117
|
-
# Merge a hash or an identical schema object with this one and return a new object.
|
1118
|
-
#
|
1119
|
-
# _@param_ `other_hash`
|
1120
|
-
def merge: ((::Hash[untyped, untyped] | SchemaClass::Base) other_hash) -> SchemaClass::Base
|
1121
|
-
|
1122
|
-
# Element access method as if this Object were a hash
|
1123
|
-
#
|
1124
|
-
# _@param_ `key`
|
1125
|
-
#
|
1126
|
-
# _@return_ — The value of the attribute if exists, nil otherwise
|
1127
|
-
def []: ((String | Symbol) key) -> Object
|
1128
|
-
|
1129
|
-
def with_indifferent_access: () -> SchemaClass::Record
|
1130
|
-
|
1131
|
-
# Returns the schema name of the inheriting class.
|
1132
|
-
def schema: () -> String
|
1133
|
-
|
1134
|
-
# Returns the namespace for the schema of the inheriting class.
|
1135
|
-
def namespace: () -> String
|
1136
|
-
|
1137
|
-
# Returns the full schema name of the inheriting class.
|
1138
|
-
def full_schema: () -> String
|
1139
|
-
|
1140
|
-
# Returns the schema validator from the schema backend
|
1141
|
-
def validator: () -> Deimos::SchemaBackends::Base
|
1142
|
-
|
1143
|
-
# _@return_ — an array of fields names in the schema.
|
1144
|
-
def schema_fields: () -> ::Array[String]
|
1145
|
-
|
1146
|
-
def self.initialize_from_value: (Object value) -> SchemaClass::Record
|
1147
|
-
|
1148
|
-
# Returns the value of attribute tombstone_key.
|
1149
|
-
attr_accessor tombstone_key: untyped
|
1150
|
-
end
|
1151
|
-
end
|
1152
|
-
|
1153
1214
|
# Module to handle phobos.yml as well as outputting the configuration to save
|
1154
1215
|
# to Phobos itself.
|
1155
1216
|
module PhobosConfig
|
@@ -1321,7 +1382,7 @@ module Deimos
|
|
1321
1382
|
|
1322
1383
|
def schema_fields: () -> ::Array[SchemaField]
|
1323
1384
|
|
1324
|
-
def coerce_field: (
|
1385
|
+
def coerce_field: (untyped _field, Object value) -> Object
|
1325
1386
|
|
1326
1387
|
def encode_key: ((String | Symbol) key_id, (String | ::Hash[untyped, untyped]) key) -> String
|
1327
1388
|
|