Sha256: a3b2f09cc1f6d6121035753d0f848b58f85b6b0cca63dfa7550baec455905aec

Contents?: true

Size: 930 Bytes

Versions: 84

Compression:

Stored size: 930 Bytes

Contents

require 'neo4j-enterprise'

Neo4j::Session.register_db(:ha_db) do |*args|
  Neo4j::Embedded::EmbeddedHaSession.new(*args)
end

module Neo4j
  module Embedded
    class EmbeddedHaSession < EmbeddedSession
      def start
        fail Error, 'Embedded HA Neo4j db is already running' if running?
        puts "Start embedded HA Neo4j db at #{db_location}"
        factory    = Java::OrgNeo4jGraphdbFactory::HighlyAvailableGraphDatabaseFactory.new
        db_service = factory.newHighlyAvailableDatabaseBuilder(db_location)

        case
        when properties_file
          db_service.loadPropertiesFromFile(properties_file)
        when properties_map
          db_service.setConfig(properties_map)
        else
          fail Error, 'Need properties for HA configuration'
        end

        @graph_db = db_service.newGraphDatabase
        Neo4j::Session._notify_listeners(:session_available, self)
      end
    end
  end
end

Version data entries

84 entries across 84 versions & 1 rubygems

Version Path
neo4j-core-5.1.7 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-6.0.0.alpha.1 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.6 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.5 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.4 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.3 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.2 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.1 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.0 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.0.rc.3 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.0.rc.2 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.1.0.rc.1 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.10 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.9 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.8 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.7 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.6 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.5 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.4 lib/neo4j-embedded/embedded_ha_session.rb
neo4j-core-5.0.3 lib/neo4j-embedded/embedded_ha_session.rb