Package org.neo4j.graphdb

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


    GraphDatabaseService database = new GraphDatabaseFactory().newEmbeddedDatabase(databasePath);
    try {
      ShapefileImporter importer = new ShapefileImporter(database);
      importer.importFile("shp/highway.shp", "highway", Charset.forName("UTF-8"));
    } finally {
      database.shutdown();
    }
    // END SNIPPET: importShapefile

    checkIndexAndFeatureCount("highway");
  }
View Full Code Here


          shpExporter.exportLayer(wayLayer.getName());
                tx.success();
            }
      // END SNIPPET: exportShapefileFromOSM
    } finally {
      database.shutdown();
    }
  }

  public void testExportShapefileFromQuery() throws Exception {
    super.shutdownDatabase(true);
View Full Code Here

      // END SNIPPET: exportShapefileFromQuery

          doGeometryTestsOnResults(bbox, results);
            }
    } finally {
      database.shutdown();
    }
  }

  private void doGeometryTestsOnResults(Envelope bbox, List<SpatialDatabaseRecord> results) {
    System.out.println("Found " + results.size() + " geometries in " + bbox);
View Full Code Here

    GraphDatabaseService database = new GraphDatabaseFactory().newEmbeddedDatabase(neoPath);
    try {
          ShapefileImporter importer = new ShapefileImporter(database, new NullListener(), commitInterval);
          importer.importFile(shpPath, layerName);
      } finally {
      database.shutdown();
    }
  }

 
  // Public methods
View Full Code Here

  private void importShapefileDatabase(String shpPath, String dbPath, String layerName) throws ShapefileException, FileNotFoundException, IOException {
    GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dbPath).setConfig(Neo4jTestCase.LARGE_CONFIG ).newGraphDatabase();
        ShapefileImporter importer = new ShapefileImporter(graphDb, new ConsoleListener(), 10000, true);
        importer.setFilterEnvelope(makeFilterEnvelope());
        importer.importFile(shpPath, layerName, Charset.forName("UTF-8"));
        graphDb.shutdown();
  }

  private Envelope makeFilterEnvelope() {
    Envelope filterEnvelope = new Envelope();
    filterEnvelope.expandToInclude(new Coordinate(-71.00, 42.10));
View Full Code Here

      }
    }
    GraphDatabaseService graphDb = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dbPath).setConfig(Neo4jTestCase.LARGE_CONFIG ).newGraphDatabase();
    importer.reIndex(graphDb, 10000, false, false);
    TestOSMImport.checkOSMLayer(graphDb, layerName);
    graphDb.shutdown();
  }

  private class Performance {
    long start;
    long duration;
View Full Code Here

    for(Performance perf: performances.values()) {
      System.out.println(perf.name + "\t" + perf.duration() + "\t" + perf.count + "\t" + perf.overlaps(results));
    }

    // Finished
    graphDb.shutdown();
  }
 
  private void printResults(Collection<Node> results) {
    System.out.println("\tFound " + results.size() + " results:");
    int count = 0;
View Full Code Here

      }

    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
      db.shutdown();
    }
  }
}
View Full Code Here

    public void moduleShouldNotBeInitializedWhenNoConfigProvided() throws InterruptedException {
        GraphDatabaseService database = new TestGraphDatabaseFactory().newImpermanentDatabase();

        assertTrue(TEST_RUNTIME_MODULES.isEmpty());

        database.shutdown();

        assertTrue(TEST_RUNTIME_MODULES.isEmpty());
    }

    @Test
View Full Code Here

                .setConfig(TestModuleBootstrapper.MODULE_ENABLED, TestModuleBootstrapper.MODULE_ENABLED.getDefaultValue())
                .newGraphDatabase();

        assertTrue(TEST_RUNTIME_MODULES.isEmpty());

        database.shutdown();

        assertTrue(TEST_RUNTIME_MODULES.isEmpty());
    }

    @Test(expected = InvalidSettingException.class)
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.