apache/hadoop · error · NotImplementedException

Code is not implemented

Error message

Code is not implemented

What it means

FSRegistryOperationsService.addWriteAccessor(id, pass) unconditionally throws NotImplementedException. Write accessors are a ZooKeeper-security feature of the registry (digest credentials applied to future writes of a session); the filesystem-backed implementation has no accessor store, so the API is declared but not implemented.

Source

Thrown at hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/FSRegistryOperationsService.java:240

      throws PathNotFoundException, PathIsNotEmptyDirectoryException,
      InvalidPathnameException, IOException {
    Path dirPath = makePath(path);
    if (!fs.exists(dirPath)) {
      throw new PathNotFoundException(path);
    }

    // If recursive == true, or dir is empty, delete.
    if (recursive || list(path).isEmpty()) {
      fs.delete(makePath(path), true);
      return;
    }

    throw new PathIsNotEmptyDirectoryException(path);
  }

  @Override
  public boolean addWriteAccessor(String id, String pass) throws IOException {
    throw new NotImplementedException("Code is not implemented");
  }

  @Override
  public void clearWriteAccessors() {
    throw new NotImplementedException("Code is not implemented");
  }

}

View on GitHub (pinned to 2add963021)

Solutions

  1. Guard the call so write-accessor APIs only execute on the ZK-backed implementation.
  2. Use the ZooKeeper-backed RegistryOperationsService (via RegistryOperationsFactory) when write accessors are required.
  3. Drop the addWriteAccessor call if the accessor feature is not actually needed by your flow.

Example fix

// before
registryOperations.addWriteAccessor(id, pass); // FSRegistryOperationsService -> NotImplementedException

// after: only the ZK-backed implementation supports write accessors
if (!(registryOperations instanceof FSRegistryOperationsService)) {
  registryOperations.addWriteAccessor(id, pass);
}
Defensive patterns

Strategy: type-guard

Type guard

// Java: capability check before write-accessor APIs
private static boolean supportsWriteAccessors(RegistryOperations ops) {
  return !(ops instanceof FSRegistryOperationsService);
}
// usage: if (supportsWriteAccessors(ops)) ops.addWriteAccessor(id, pass);

Try / catch

try {
  registryOperations.addWriteAccessor(id, pass);
} catch (NotImplementedException e) {
  // FS-backed registry has no accessor support: safe to ignore if accessors are optional
}

Prevention

When it happens

Trigger: Calling addWriteAccessor on an FSRegistryOperationsService instance — generic client code written against the RegistryOperations interface invokes it unconditionally, or YARN registry code is run with the FS backend configured.

Common situations: Shared client code that must run against both the ZK-backed (production) and FS-backed (test/simple) registry backends; migrating a deployment from ZK registry to FS registry and discovering unsupported security APIs.

Related errors


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