コード例 #1
0
  /** {@inheritDoc} */
  @Override
  public void close() {
    if (nodeLocationsReader != null) {
      nodeLocationsReader.close();
    }

    nodeLocations.close();
  }
コード例 #2
0
  /** {@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();
    }
  }