void setSegmentSize(int bytes) { checkInit(); nodes.setSegmentSize(bytes); edges.setSegmentSize(bytes); wayGeometry.setSegmentSize(bytes); nameIndex.setSegmentSize(bytes); extStorage.setSegmentSize(bytes); }
@Override public boolean loadExisting() { baseGraph.checkInit(); if (properties.loadExisting()) { properties.checkVersions(false); // check encoding for compatibility String flagEncodersStr = properties.get("graph.flag_encoders"); if (!flagEncodersStr.isEmpty() && !encodingManager.toDetailsString().equalsIgnoreCase(flagEncodersStr)) { throw new IllegalStateException("Encoding does not match:" + "\nGraphhopper config: " + encodingManager.toDetailsString() + "\nGraph: " + flagEncodersStr + "\nChange configuration to match the graph or delete " + dir.getLocation()); } String byteOrder = properties.get("graph.byte_order"); if (!byteOrder.equalsIgnoreCase("" + dir.getByteOrder())) throw new IllegalStateException("Configured graph.byte_order (" + dir.getByteOrder() + ") is not equal to loaded " + byteOrder + ""); String bytesForFlags = properties.get("graph.bytes_for_flags"); if (!bytesForFlags.equalsIgnoreCase("" + encodingManager.getBytesForFlags())) throw new IllegalStateException("Configured graph.bytes_for_flags (" + encodingManager.getBytesForFlags() + ") is not equal to loaded " + bytesForFlags); String dim = properties.get("graph.dimension"); baseGraph.loadExisting(dim); checkIfConfiguredAndLoadedWeightingsCompatible(); for (CHGraphImpl cg : chGraphs) { if (!cg.loadExisting()) throw new IllegalStateException("Cannot load " + cg); } return true; } return false; }
/** * After configuring this storage you need to create it explicitly. */ @Override public GraphHopperStorage create(long byteCount) { baseGraph.checkInit(); if (encodingManager == null) throw new IllegalStateException("EncodingManager can only be null if you call loadExisting"); dir.create(); long initSize = Math.max(byteCount, 100); properties.create(100); properties.put("graph.bytes_for_flags", encodingManager.getBytesForFlags()); properties.put("graph.flag_encoders", encodingManager.toDetailsString()); properties.put("graph.byte_order", dir.getByteOrder()); properties.put("graph.dimension", baseGraph.nodeAccess.getDimension()); properties.putCurrentVersions(); baseGraph.create(initSize); for (CHGraphImpl cg : chGraphs) { cg.create(byteCount); } properties.put("graph.ch.weightings", getCHWeightings().toString()); return this; }
void setSegmentSize(int bytes) { checkInit(); nodes.setSegmentSize(bytes); edges.setSegmentSize(bytes); wayGeometry.setSegmentSize(bytes); nameIndex.setSegmentSize(bytes); extStorage.setSegmentSize(bytes); }
void setSegmentSize( int bytes ) { checkInit(); nodes.setSegmentSize(bytes); edges.setSegmentSize(bytes); wayGeometry.setSegmentSize(bytes); nameIndex.setSegmentSize(bytes); extStorage.setSegmentSize(bytes); }
void setSegmentSize(int bytes) { checkInit(); nodes.setSegmentSize(bytes); edges.setSegmentSize(bytes); wayGeometry.setSegmentSize(bytes); nameIndex.setSegmentSize(bytes); extStorage.setSegmentSize(bytes); }
@Override public boolean loadExisting() { baseGraph.checkInit(); if (properties.loadExisting()) { properties.checkVersions(false);
@Override public boolean loadExisting() baseGraph.checkInit(); if (properties.loadExisting())
@Override public boolean loadExisting() { baseGraph.checkInit(); if (properties.loadExisting()) { properties.checkVersions(false); // check encoding for compatibility String flagEncodersStr = properties.get("graph.flag_encoders"); if (!flagEncodersStr.isEmpty() && !encodingManager.toDetailsString().equalsIgnoreCase(flagEncodersStr)) { throw new IllegalStateException("Encoding does not match:" + "\nGraphhopper config: " + encodingManager.toDetailsString() + "\nGraph: " + flagEncodersStr + "\nChange configuration to match the graph or delete " + dir.getLocation()); } String byteOrder = properties.get("graph.byte_order"); if (!byteOrder.equalsIgnoreCase("" + dir.getByteOrder())) throw new IllegalStateException("Configured graph.byte_order (" + dir.getByteOrder() + ") is not equal to loaded " + byteOrder + ""); String bytesForFlags = properties.get("graph.bytes_for_flags"); if (!bytesForFlags.equalsIgnoreCase("" + encodingManager.getBytesForFlags())) throw new IllegalStateException("Configured graph.bytes_for_flags (" + encodingManager.getBytesForFlags() + ") is not equal to loaded " + bytesForFlags); String dim = properties.get("graph.dimension"); baseGraph.loadExisting(dim); checkIfConfiguredAndLoadedWeightingsCompatible(); for (CHGraphImpl cg : chGraphs) { if (!cg.loadExisting()) throw new IllegalStateException("Cannot load " + cg); } return true; } return false; }
/** * After configuring this storage you need to create it explicitly. */ @Override public GraphHopperStorage create(long byteCount) { baseGraph.checkInit(); if (encodingManager == null) throw new IllegalStateException("EncodingManager can only be null if you call loadExisting"); dir.create(); long initSize = Math.max(byteCount, 100); properties.create(100); properties.put("graph.bytes_for_flags", encodingManager.getBytesForFlags()); properties.put("graph.flag_encoders", encodingManager.toDetailsString()); properties.put("graph.byte_order", dir.getByteOrder()); properties.put("graph.dimension", baseGraph.nodeAccess.getDimension()); properties.putCurrentVersions(); baseGraph.create(initSize); for (CHGraphImpl cg : chGraphs) { cg.create(byteCount); } properties.put("graph.ch.weightings", getCHWeightings().toString()); return this; }
/** * After configuring this storage you need to create it explicitly. */ @Override public GraphHopperStorage create(long byteCount) { baseGraph.checkInit(); if (encodingManager == null) throw new IllegalStateException("EncodingManager can only be null if you call loadExisting"); dir.create(); long initSize = Math.max(byteCount, 100); properties.create(100); properties.put("graph.bytes_for_flags", encodingManager.getBytesForFlags()); properties.put("graph.flag_encoders", encodingManager.toDetailsString()); properties.put("graph.byte_order", dir.getByteOrder()); properties.put("graph.dimension", baseGraph.nodeAccess.getDimension()); properties.putCurrentVersions(); baseGraph.create(initSize); for (CHGraphImpl cg : chGraphs) { cg.create(byteCount); } properties.put("graph.ch.weightings", getCHWeightings().toString()); return this; }
/** * After configuring this storage you need to create it explicitly. */ @Override public GraphHopperStorage create( long byteCount ) { baseGraph.checkInit(); if (encodingManager == null) throw new IllegalStateException("EncodingManager can only be null if you call loadExisting"); dir.create(); long initSize = Math.max(byteCount, 100); properties.create(100); properties.put("graph.bytes_for_flags", encodingManager.getBytesForFlags()); properties.put("graph.flag_encoders", encodingManager.toDetailsString()); properties.put("graph.byte_order", dir.getByteOrder()); properties.put("graph.dimension", baseGraph.nodeAccess.getDimension()); properties.putCurrentVersions(); baseGraph.create(initSize); for (CHGraphImpl cg : chGraphs) { cg.create(byteCount); } properties.put("graph.ch.weightings", getCHWeightings().toString()); return this; }