/** * @throws IllegalStateException if not loadable. */ public GraphHopperStorage load() { GraphHopperStorage gs = build(); if (!gs.loadExisting()) { throw new IllegalStateException("Cannot load graph " + location); } return gs; } }
/** * Default graph is a {@link GraphHopperStorage} with an in memory directory and disabled storing on flush. */ public GraphHopperStorage create() { return build().create(byteCapacity); }
@Test public void testNoCreateCalled() throws IOException { GraphHopperStorage gs = new GraphBuilder(encodingManager).build(); try { ((BaseGraph) gs.getGraph(Graph.class)).ensureNodeIndex(123); assertFalse("AssertionError should be raised", true); } catch (AssertionError err) { assertTrue(true); } catch (Exception ex) { assertFalse("AssertionError should be raised, but was " + ex.toString(), true); } finally { gs.close(); } }
@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; } }
/** * Default graph is a GraphStorage with an in memory directory and disabled storing on flush. */ public GraphHopperStorage create() { return build().create(byteCapacity); }
/** * Default graph is a GraphStorage with an in memory directory and disabled storing on flush. */ public GraphHopperStorage create() { return build().create(byteCapacity); }
/** * @throws IllegalStateException if not loadable. */ public GraphHopperStorage load() { GraphHopperStorage gs = build(); if (!gs.loadExisting()) { throw new IllegalStateException("Cannot load graph " + location); } return gs; } }
/** * Default graph is a {@link GraphHopperStorage} with an in memory directory and disabled storing on flush. */ public GraphHopperStorage create() { return build().create(byteCapacity); }
/** * @throws IllegalStateException if not loadable. */ public GraphHopperStorage load() { GraphHopperStorage gs = build(); if (!gs.loadExisting()) { throw new IllegalStateException("Cannot load graph " + location); } return gs; } }
/** * @throws IllegalStateException if not loadable. */ public GraphHopperStorage load() { GraphHopperStorage gs = build(); if (!gs.loadExisting()) { throw new IllegalStateException("Cannot load graph " + location); } return gs; } }