@Override public long getCapacity() { return da.getCapacity(); } }
@Override public long getCapacity() { return dataAccess.getCapacity(); }
@Override public long getCapacity() { return turnCosts.getCapacity(); }
@Override public long getCapacity() { return index.getCapacity() / 4; }
@Override public long getCapacity() { return names.getCapacity(); }
@Override public long getCapacity() { return nodesCH.getCapacity() + shortcuts.getCapacity(); }
@Override public synchronized long getCapacity() { return da.getCapacity(); }
public long getCapacity() { return keys.getCapacity(); }
long getCapacity() { return edges.getCapacity() + nodes.getCapacity() + nameIndex.getCapacity() + wayGeometry.getCapacity() + extStorage.getCapacity(); }
@Override public long getCapacity() { return landmarkWeightDA.getCapacity() + subnetworkStorage.getCapacity(); }
String toDetailsString() { return "edges:" + nf(edgeCount) + "(" + edges.getCapacity() / Helper.MB + "MB), " + "nodes:" + nf(getNodes()) + "(" + nodes.getCapacity() / Helper.MB + "MB), " + "name:(" + nameIndex.getCapacity() / Helper.MB + "MB), " + "geo:" + nf(maxGeoRef) + "(" + wayGeometry.getCapacity() / Helper.MB + "MB), " + "bounds:" + bounds; }
@Override public synchronized boolean loadExisting() { if (!da.loadExisting()) return false; int len = (int) da.getCapacity(); byte[] bytes = new byte[len]; da.getBytes(0, bytes, len); try { loadProperties(map, new StringReader(new String(bytes, UTF_CS))); return true; } catch (IOException ex) { throw new IllegalStateException(ex); } }
/** * Check if byte capacity of DataAcess nodes object is sufficient to include node index, else * extend byte capacity */ final void ensureNodeIndex(int nodeIndex) { if (!initialized) throw new AssertionError("The graph has not yet been initialized."); if (nodeIndex < nodeCount) return; long oldNodes = nodeCount; nodeCount = nodeIndex + 1; boolean capacityIncreased = nodes.ensureCapacity((long) nodeCount * nodeEntryBytes); if (capacityIncreased) { long newBytesCapacity = nodes.getCapacity(); initNodeRefs(oldNodes * nodeEntryBytes, newBytesCapacity); } }
String toDetailsString() { return toString() + ", shortcuts:" + nf(shortcutCount) + ", nodesCH:(" + nodesCH.getCapacity() / Helper.MB + "MB)"; }
void _freeze() { long maxCapacity = ((long) getNodes()) * nodeCHEntryBytes; nodesCH.ensureCapacity(maxCapacity); long baseCapacity = baseGraph.nodes.getCapacity(); // copy normal edge refs into ch edge refs for (long pointer = N_CH_REF, basePointer = baseGraph.N_EDGE_REF; pointer < maxCapacity; pointer += nodeCHEntryBytes, basePointer += baseGraph.nodeEntryBytes) { if (basePointer >= baseCapacity) throw new IllegalStateException("Cannot copy edge refs into ch graph. " + "pointer:" + pointer + ", cap:" + maxCapacity + ", basePtr:" + basePointer + ", baseCap:" + baseCapacity); nodesCH.setInt(pointer, baseGraph.nodes.getInt(basePointer)); } }
void create(long initSize) { nodes.create(initSize); edges.create(initSize); initSize = Math.min(initSize, 2000); wayGeometry.create(initSize); nameIndex.create(initSize); extStorage.create(initSize); initStorage(); // 0 stands for no separate geoRef maxGeoRef = 4; initNodeRefs(0, nodes.getCapacity()); }
private int fillEmptyIndices(GHBitSet filledIndices) { int len = latSize * lonSize; DataAccess indexCopy = new RAMDirectory().find("temp_index_copy"); indexCopy.setSegmentSize(index.getSegmentSize()).create(index.getCapacity()); GHBitSet indicesCopy = new GHBitSetImpl(len); int initializedCounter = filledIndices.getCardinality();
@Test public void testTrimTo() { DataAccess da = createDataAccess(name); da.setSegmentSize(128); da.create(128 * 11); da.setInt(1 * 4, 10); da.setInt(27 * 4, 200); da.setInt(31 * 4, 301); da.setInt(32 * 4, 302); da.setInt(337 * 4, 4000); // now 11 segments: (337 + 1) * 4 = 1352 assertEquals(11, da.getSegments()); assertEquals(11 * 128, da.getCapacity()); // now 3 segments da.trimTo(128 * 2 + 1); assertEquals(3, da.getSegments()); // now 2 segments da.trimTo(128 * 2); assertEquals(2, da.getSegments()); assertEquals(301, da.getInt(31 * 4)); assertEquals(302, da.getInt(32 * 4)); // now only one segment da.trimTo(128 * 1); assertEquals(1, da.getSegments()); assertEquals(301, da.getInt(31 * 4)); // at least one segment da.trimTo(0); assertEquals(1, da.getSegments()); da.close(); }
@Override public long getCapacity() { return index.getCapacity() / 4; }
void create( long initSize ) { nodes.create(initSize); edges.create(initSize); wayGeometry.create(initSize); nameIndex.create(1000); extStorage.create(initSize); initStorage(); // 0 stands for no separate geoRef maxGeoRef = 4; initNodeRefs(0, nodes.getCapacity()); }