code: public long nextGenerationStamp(Block block, boolean fromNN) throws IOException {
      IOException last = new IOException("No DatanodeProtocol found.");
      for (int i = 0; i < numProtocol; i++) {
        try {
          if (node[i] != null) {
            return node[i].nextGenerationStamp(block, fromNN);
          }
        } catch (IOException e) {
          last = e;
          LOG.info("Server " + i + " failed at nextGenerationStamp.", e);
        }
      }
      throw last; // fail if all DatanodeProtocol object failed.
    }
docs: {@inheritDoc}