class Aerospike::UnsupportedParticleTypeValidator

Public Class Methods

new(*particle_types) click to toggle source
# File lib/aerospike/command/unsupported_particle_type_validator.rb, line 20
def initialize(*particle_types)
  @unsupported_types = particle_types.to_set
end

Public Instance Methods

call(*commands) click to toggle source
# File lib/aerospike/command/unsupported_particle_type_validator.rb, line 24
def call(*commands)
  used = commands.flat_map(&:write_bins).map(&:type)
  unsupported = @unsupported_types.intersection(used)
  unless unsupported.empty?
    fail Aerospike::Exceptions::Aerospike.new(Aerospike::ResultCode::TYPE_NOT_SUPPORTED, "Particle type(s) not supported by cluster: #{@unsupported_types.to_a}")
  end
end