Package org.neo4j.graphdb

Examples of org.neo4j.graphdb.GraphDatabaseService.shutdown()


  public void testEmbeddedIsTheDefaultGraphDatabaseService() throws Exception {
    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    GraphDatabaseService db = graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertThat( db.getClass() ). isEqualTo( EmbeddedGraphDatabase.class );
  }

  @Test
  public void testSelectedGraphDatabaseServiceIsLoaded() throws Exception {
View Full Code Here


    Properties properties = new Properties();
    properties.put( Neo4jProperties.DATABASE_PATH, Neo4jTestHelper.dbLocation() );
    properties.put( InternalProperties.NEO4J_GRAPHDB_FACTORYCLASS, MockGraphServiceFactory.class.getName() );
    Neo4jGraphDatabaseServiceFactoryProvider graphService = new Neo4jGraphDatabaseServiceFactoryProvider();
    GraphDatabaseService db = graphService.load( properties, new ClassLoaderServiceImpl() ).create();
    db.shutdown();
    assertThat( db.getClass() ). isEqualTo( MockGraphDatabaseService.class );
  }

  @Test
  public void testPropertiesArePassed() throws Exception {
View Full Code Here

                tx.close();
            }
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        } finally {
            if (rawGraphDB != null) rawGraphDB.shutdown();
        }
    }

    private static <T extends PropertyContainer> void populateKeyIndices(final GraphDatabaseService rawGraphDB, final AutoIndexer<T> rawAutoIndexer, final Iterable<T> rawElements, final Class elementClass) {
        if (!rawAutoIndexer.isEnabled())
View Full Code Here

            if (this.edgeIndexKeys.size() > 0)
                populateKeyIndices(rawGraphDB, rawGraphDB.index().getRelationshipAutoIndexer(), graphOperations.getAllRelationships(), Edge.class);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        } finally {
            if (rawGraphDB != null) rawGraphDB.shutdown();
        }
    }

    private static <T extends PropertyContainer> void populateKeyIndices(final GraphDatabaseService rawGraphDB, final AutoIndexer<T> rawAutoIndexer, final Iterable<T> rawElements, final Class elementClass) {
        if (!rawAutoIndexer.isEnabled())
View Full Code Here

        kmlBuilder.finish();
        kmlBuilder.writeToFile(new File("siem-reap.kml"));


        //Close Neo4j
        db.shutdown();

    }

    private Node getStartNode(GraphDatabaseService db) {
        return db.index().forNodes("nodes").get(OsmEntityAttributeKey.NODE_ID.name(), START_NODE_ID).getSingle();
View Full Code Here

       * @see java.lang.Thread#run()
       */
      @Override
      public void run() {
        System.out.print("\n==> Shutdown cleanly the database...");
        graphDatabase.shutdown();
        System.out.println("OK");
      }
    });

    /* Add nodes (members in our sample) and relationships between them */
 
View Full Code Here

          }
        }
      } else {
        System.err.println("No such layer: " + args[2]);
      }
      db.shutdown();
    }
  }

}
View Full Code Here

          .count(), features.size());
      if (layer instanceof OSMLayer)
        checkOSMAPI(layer);
            tx.success();
    } finally {
      database.shutdown();
    }
  }

  private void checkOSMAPI(Layer layer) {
    HashMap<Long, Integer> waysFound = new HashMap<Long, Integer>();
View Full Code Here

    importer.importFile(batchInserter, "map.osm", false);
    batchInserter.shutdown();

    GraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabase(databasePath);
    importer.reIndex(db);
    db.shutdown();
    // END SNIPPET: importOsm
  }

  /**
   * Sample code for importing Open Street Map example.
View Full Code Here

                doGeometryTestsOnResults(bbox, results);
                tx.success();
            }
    } finally {
      database.shutdown();
    }
    // END SNIPPET: searchBBox

    checkIndexAndFeatureCount("map.osm");
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.