/** {@inheritDoc} */ @Override public NodeLocation getNodeLocation(long nodeId) { if (nodeLocationsReader == null) { nodeLocations.complete(); nodeLocationsReader = nodeLocations.createReader(); } try { return nodeLocationsReader.get(nodeId).getNodeLocation(); } catch (NoSuchIndexElementException e) { return new NodeLocation(); } }
/** {@inheritDoc} */ @Override public void close() { if (nodeLocationsReader != null) { nodeLocationsReader.close(); } nodeLocations.close(); }
/** {@inheritDoc} */ @Override public void addLocation(long nodeId, NodeLocation nodeLocation) { nodeLocations.add(nodeId, new CompactPersistentNodeLocation(nodeLocation)); }