Sha256: 62d3df5becd4ecefe61c2585ef83d25121b23cbe1df49ea3b37e75c84f77c2ee

Contents?: true

Size: 474 Bytes

Versions: 5

Compression:

Stored size: 474 Bytes

Contents

module Embulk

  # TODO pure-ruby page reader

  class Page
    def initialize(java_page, schema)
      @java_page = java_page
      @schema = schema
    end

    attr_reader :schema

    def each
      schema = @schema
      reader = Java::PageReader.new(schema.java_object)
      begin
        reader.setPage(@java_page)
        while reader.nextRecord
          yield schema.read_record(reader)
        end
      ensure
        reader.close
      end
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
embulk-0.3.1 lib/embulk/page.rb
embulk-0.3.0 lib/embulk/page.rb
embulk-0.2.1 lib/embulk/page.rb
embulk-0.2.0 lib/embulk/page.rb
embulk-0.1.0 lib/embulk/page.rb