@Override public GraphHopperStorage createGHStorage(String location, boolean enabled3D) { // reduce segment size in order to test the case where multiple segments come into the game GraphHopperStorage gs = newGHStorage(new RAMDirectory(location), enabled3D); gs.setSegmentSize(defaultSize / 2); gs.create(defaultSize); return gs; }
ghStorage.setSegmentSize(defaultSegmentSize);
@Override public GraphHopperStorage createGHStorage(String location, boolean is3D) { GraphHopperStorage gs = new GraphBuilder(encodingManager).set3D(is3D).setLocation(location).setMmap(true).build(); gs.setSegmentSize(defaultSize / 2); gs.create(defaultSize); return gs; } }
@Test public void testCopyTo() { graph = createGHStorage(); initExampleGraph(graph); GraphHopperStorage gs = newRAMGHStorage(); gs.setSegmentSize(8000); gs.create(10); try { graph.copyTo(gs); checkExampleGraph(gs); } catch (Exception ex) { ex.printStackTrace(); assertTrue(ex.toString(), false); } try { Helper.close((Closeable) graph); graph = createGHStorage(); gs.copyTo(graph); checkExampleGraph(graph); } catch (Exception ex) { ex.printStackTrace(); assertTrue(ex.toString(), false); } Helper.close((Closeable) graph); }
@Test public void testEnsureCapacity() throws IOException { graph = newGHStorage(new MMapDirectory(defaultGraphLoc), false); graph.setSegmentSize(128); graph.create(100); // 100 is the minimum size
ghStorage.setSegmentSize(defaultSegmentSize);
ghStorage.setSegmentSize(defaultSegmentSize);
ghStorage.setSegmentSize(defaultSegmentSize);