Sha256: 79768ae95e393892977cfd4a6fe743e679c84443e7fee6466477bd695152e11b

Contents?: true

Size: 793 Bytes

Versions: 12

Compression:

Stored size: 793 Bytes

Contents

require "scan_info"
require "scan_info_builder"

require "expression_size_estimator"

module Groonga
  class Expression
    def build_scan_info(op, size)
      begin
        builder = ScanInfoBuilder.new(self, op, size)
        builder.build
      rescue => error
        Context.instance.record_error(:invalid_argument, error)
        nil
      end
    end

    def estimate_size(table)
      begin
        estimator = ExpressionSizeEstimator.new(self, table)
        estimator.estimate
      rescue GroongaError => groonga_error
        context.set_groonga_error(groonga_error)
        table.size
      rescue => error
        context.record_error(:unknown_error, error)
        table.size
      end
    end

    private
    def context
      @context ||= Context.instance
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rroonga-5.0.8-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.8-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.5-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.5-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.4-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.4-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.3-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.3-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.2-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.2-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.1-x86-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb
rroonga-5.0.1-x64-mingw32 vendor/local/lib/groonga/scripts/ruby/expression.rb