apache/hadoop · warning · UnsupportedOperationException

Not implemented

Error message

Not implemented

What it means

RouterClientProtocol.getBatchedListing() is declared in ClientProtocol but the Router throws UnsupportedOperationException('Not implemented') unconditionally. The Router implements listing via getListing() (iterating namespaces and merging results) but the batched listing extension is not routed, so any client that negotiates/uses batched listings against an RBF endpoint fails.

Source

Thrown at hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:969

    }

    if (!namenodeListingExists && nnListing.size() == 0 && children == null) {
      // NN returns a null object if the directory cannot be found and has no
      // listing. If we didn't retrieve any NN listing data, and there are no
      // mount points here, return null.
      return null;
    }

    // Generate combined listing
    HdfsFileStatus[] combinedData = new HdfsFileStatus[nnListing.size()];
    combinedData = nnListing.values().toArray(combinedData);
    return new DirectoryListing(combinedData, remainingEntries);
  }

  @Override
  public BatchedDirectoryListing getBatchedListing(String[] srcs,
      byte[] startAfter, boolean needLocation) throws IOException {
    throw new UnsupportedOperationException("Not implemented");
  }

  @Override
  public HdfsFileStatus getFileInfo(String src) throws IOException {
    rpcServer.checkOperation(NameNode.OperationCategory.READ);

    HdfsFileStatus ret = null;
    IOException noLocationException = null;
    try {
      final List<RemoteLocation> locations = rpcServer.getLocationsForPath(src, false, false);
      RemoteMethod method = new RemoteMethod("getFileInfo",
          new Class<?>[] {String.class}, new RemoteParam());

      // If it's a directory, we check in all locations
      if (rpcServer.isPathAll(src)) {
        ret = getFileInfoAll(locations, method);
      } else {
        // Check for file information sequentially

View on GitHub (pinned to 2add963021)

Solutions

  1. Disable batched listing on the client so it falls back to getListing (e.g. keep client/RPC features compatible or use a client version matching the Router)
  2. Upgrade the Router (hadoop-hdfs-rbf) to a version implementing getBatchedListing, if available
  3. Point clients needing batched listings directly at a real NameNode namespace instead of the Router
Defensive patterns

Strategy: fallback

Validate before calling

// Feature-probe before using batched listing via Router
try {
  clientProtocol.getBatchedListing(new String[]{"/"}, HdfsFileStatus.EMPTY_NAME, false);
} catch (UnsupportedOperationException e) {
  useBatched = false; // fall back to getListing()
}

Try / catch

try {
  BatchedDirectoryListing b = clientProtocol.getBatchedListing(srcs, startAfter, needLocation);
} catch (UnsupportedOperationException e) {
  // Router does not implement batched listing: fall back to getListing()
  DirectoryListing d = clientProtocol.getListing(src, startAfter, needLocation);
}

Prevention

When it happens

Trigger: A client (newer HDFS client or library using ClientProtocol#getBatchedListing) calling the Router's RPC port with batched directory listing enabled; experimental clients/libHDFS builds that prefer BatchedDirectoryListing over getListing.

Common situations: Newer Hadoop client version talking to an older Router that predates or skipped the batched-listing feature; third-party tooling using raw ClientProtocol proxies against RBF.

Related errors


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/3f50c0fb7f9c5f22. Report an issue: GitHub.