Class: LogStash::PluginMixins::Jdbc::PreparedStatementHandler
- Inherits:
-
StatementHandler
- Object
- StatementHandler
- LogStash::PluginMixins::Jdbc::PreparedStatementHandler
- Defined in:
- lib/logstash/plugin_mixins/jdbc/statement_handler.rb
Instance Attribute Summary collapse
-
#bind_values_array ⇒ Object
readonly
Returns the value of attribute bind_values_array.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#prepared ⇒ Object
readonly
Returns the value of attribute prepared.
-
#statement_prepared ⇒ Object
readonly
Returns the value of attribute statement_prepared.
Attributes inherited from StatementHandler
Instance Method Summary collapse
-
#initialize(plugin) ⇒ PreparedStatementHandler
constructor
A new instance of PreparedStatementHandler.
-
#perform_query(db, sql_last_value) {|row| ... } ⇒ Object
Performs the query, ignoring our pagination settings, yielding once per row of data.
Methods inherited from StatementHandler
Constructor Details
#initialize(plugin) ⇒ PreparedStatementHandler
Returns a new instance of PreparedStatementHandler.
129 130 131 132 133 134 135 |
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 129 def initialize(plugin) super(plugin) @name = plugin.prepared_statement_name.to_sym @bind_values_array = plugin.prepared_statement_bind_values @parameters = plugin.parameters @statement_prepared = Concurrent::AtomicBoolean.new(false) end |
Instance Attribute Details
#bind_values_array ⇒ Object (readonly)
Returns the value of attribute bind_values_array.
127 128 129 |
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 127 def bind_values_array @bind_values_array end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
127 128 129 |
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 127 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
127 128 129 |
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 127 def parameters @parameters end |
#prepared ⇒ Object (readonly)
Returns the value of attribute prepared.
127 128 129 |
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 127 def prepared @prepared end |
#statement_prepared ⇒ Object (readonly)
Returns the value of attribute statement_prepared.
127 128 129 |
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 127 def statement_prepared @statement_prepared end |
Instance Method Details
#perform_query(db, sql_last_value) {|row| ... } ⇒ Object
Performs the query, ignoring our pagination settings, yielding once per row of data
141 142 143 144 145 146 |
# File 'lib/logstash/plugin_mixins/jdbc/statement_handler.rb', line 141 def perform_query(db, sql_last_value) query = build_query(db, sql_last_value) query.each do |row| yield row end end |