Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: BatchRead with operations #132

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

opti
Copy link
Contributor

@opti opti commented Sep 30, 2024

This pull request:

  • fixes invalid local variable reference in BatchOperateCommand

    /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:95:in `block in write_buffer': undefined local variable or method `br' for an instance of Aerospike::BatchOperateCommand (NameError)
    
                attr.adjust_read(br.ops)
                                 ^^
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:81:in `each'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:81:in `each_with_index'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:81:in `write_buffer'
          from /aerospike-client-ruby/lib/aerospike/command/command.rb:718:in `execute'
          from /aerospike-client-ruby/lib/aerospike/client.rb:973:in `execute_command'
          from /aerospike-client-ruby/lib/aerospike/client.rb:1005:in `block (2 levels) in execute_batch_operate_commands'
  • fixes attribute reference in size calculation for the BatchRead

    /aerospike-client-ruby/lib/aerospike/batch_read.rb:91:in `block in size': undefined method `value' for an instance of Aerospike::Operation (NoMethodError)
    
          size += op.value.estimate_size
                    ^^^^^^
          from /aerospike-client-ruby/lib/aerospike/batch_read.rb:86:in `each'
          from /aerospike-client-ruby/lib/aerospike/batch_read.rb:86:in `size'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:63:in `block in write_buffer'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:53:in `each'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:53:in `write_buffer'
          from /aerospike-client-ruby/lib/aerospike/command/command.rb:718:in `execute'
          from /aerospike-client-ruby/lib/aerospike/client.rb:973:in `execute_command'
          from /aerospike-client-ruby/lib/aerospike/client.rb:1005:in `block (2 levels) in execute_batch_operate_commands'
  • fixes BatchRead with multiple records using operations (2 issues)

    /aerospike-client-ruby/lib/aerospike/batch_read.rb:71:in `==': undefined method `sort' for nil (NoMethodError)
    
          @bin_names.sort == other.bin_names.sort && @ops.sort == other.ops.sort &&
                    ^^^^^
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:57:in `block in write_buffer'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:53:in `each'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:53:in `write_buffer'
          from /aerospike-client-ruby/lib/aerospike/command/command.rb:718:in `execute'
          from /aerospike-client-ruby/lib/aerospike/client.rb:973:in `execute_command'
          from /aerospike-client-ruby/lib/aerospike/client.rb:1005:in `block (2 levels) in execute_batch_operate_commands'
    /aerospike-client-ruby/lib/aerospike/batch_read.rb:71:in `sort': comparison of Aerospike::Operation with Aerospike::Operation failed (ArgumentError)
          from /aerospike-client-ruby/lib/aerospike/batch_read.rb:71:in `=='
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:57:in `block in write_buffer'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:53:in `each'
          from /aerospike-client-ruby/lib/aerospike/command/batch_operate_command.rb:53:in `write_buffer'
          from /aerospike-client-ruby/lib/aerospike/command/command.rb:718:in `execute'
          from /aerospike-client-ruby/lib/aerospike/client.rb:973:in `execute_command'
          from /aerospike-client-ruby/lib/aerospike/client.rb:1005:in `block (2 levels) in execute_batch_operate_commands'

@khaf khaf merged commit e02d4be into aerospike:master Oct 22, 2024
@khaf
Copy link
Collaborator

khaf commented Oct 22, 2024

Merged and Released.

@opti opti deleted the batch-read-operations-fix branch October 23, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants