{"record":{"id":"06d810d22f8464ba","repo":"apache/hadoop","slug":"code-is-not-implemented","errorCode":null,"errorMessage":"Code is not implemented","messagePattern":"Code is not implemented","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/FSRegistryOperationsService.java","lineNumber":240,"sourceCode":"      throws PathNotFoundException, PathIsNotEmptyDirectoryException,\n      InvalidPathnameException, IOException {\n    Path dirPath = makePath(path);\n    if (!fs.exists(dirPath)) {\n      throw new PathNotFoundException(path);\n    }\n\n    // If recursive == true, or dir is empty, delete.\n    if (recursive || list(path).isEmpty()) {\n      fs.delete(makePath(path), true);\n      return;\n    }\n\n    throw new PathIsNotEmptyDirectoryException(path);\n  }\n\n  @Override\n  public boolean addWriteAccessor(String id, String pass) throws IOException {\n    throw new NotImplementedException(\"Code is not implemented\");\n  }\n\n  @Override\n  public void clearWriteAccessors() {\n    throw new NotImplementedException(\"Code is not implemented\");\n  }\n\n}\n","sourceCodeStart":222,"sourceCodeEnd":249,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/client/impl/FSRegistryOperationsService.java#L222-L249","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Guard the call so write-accessor APIs only execute on the ZK-backed implementation.","Use the ZooKeeper-backed RegistryOperationsService (via RegistryOperationsFactory) when write accessors are required.","Drop the addWriteAccessor call if the accessor feature is not actually needed by your flow."],"exampleFix":"// before\nregistryOperations.addWriteAccessor(id, pass); // FSRegistryOperationsService -> NotImplementedException\n\n// after: only the ZK-backed implementation supports write accessors\nif (!(registryOperations instanceof FSRegistryOperationsService)) {\n  registryOperations.addWriteAccessor(id, pass);\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"// Java: capability check before write-accessor APIs\nprivate static boolean supportsWriteAccessors(RegistryOperations ops) {\n  return !(ops instanceof FSRegistryOperationsService);\n}\n// usage: if (supportsWriteAccessors(ops)) ops.addWriteAccessor(id, pass);","tryCatchPattern":"try {\n  registryOperations.addWriteAccessor(id, pass);\n} catch (NotImplementedException e) {\n  // FS-backed registry has no accessor support: safe to ignore if accessors are optional\n}","preventionTips":["Feature-detect the backend once at startup and store a 'supportsWriteAccessors' flag instead of scattering instanceof checks.","Keep security-related registry calls (accessors) isolated to code paths that only run with the ZK backend.","Document which RegistryOperations methods the FS backend stubs (addWriteAccessor, clearWriteAccessors) in project docs."],"tags":["registry","not-implemented","unsupported-api","filesystem-backend","hadoop-registry"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}