Sha256: 3369d362d3a0b5f365809b18798c299553991f1a082f325862cd55232fa42c69

Contents?: true

Size: 514 Bytes

Versions: 5

Compression:

Stored size: 514 Bytes

Contents

module Cadet
  module BatchInserter
    module CadetIndex
      class IndexProvider

        def initialize(db)
          @indexes = {}
          @lucene_index = org.neo4j.index.impl.lucene.LuceneBatchInserterIndexProviderNewImpl.new(db)
        end

        def [](label)
          @indexes[label.to_sym] ||= CadetIndex::Index.new(@lucene_index, label.to_sym)
        end
        def shutdown
          @indexes.each do |label, index|
            index.flush
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cadet-0.1.5-java lib/cadet/batch_inserter/cadet_index/index_provider.rb
cadet-0.1.4-java lib/cadet/batch_inserter/cadet_index/index_provider.rb
cadet-0.1.3-java lib/cadet/batch_inserter/cadet_index/index_provider.rb
cadet-0.1.2-java lib/cadet/batch_inserter/cadet_index/index_provider.rb
cadet-0.1.1-java lib/cadet/batch_inserter/cadet_index/index_provider.rb