{"record":{"id":"58bdbe2a5f408d0d","repo":"apache/hadoop","slug":"mkdirs-is-not-supported-in-pseudo-local-file-syste","errorCode":null,"errorMessage":"Mkdirs is not supported in pseudo local file system.","messagePattern":"Mkdirs is not supported in pseudo local file system\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java","lineNumber":311,"sourceCode":"      throw new UnsupportedOperationException();\n    }\n\n    @Override\n    public boolean seekToNewSource(long targetPos) throws IOException {\n      throw new UnsupportedOperationException();\n    }\n  }\n\n  @Override\n  public FSDataOutputStream append(Path path, int bufferSize,\n      Progressable progress) throws IOException {\n    throw new UnsupportedOperationException(\"Append is not supported\"\n        + \" in pseudo local file system.\");\n  }\n\n  @Override\n  public boolean mkdirs(Path f, FsPermission permission) throws IOException {\n    throw new UnsupportedOperationException(\"Mkdirs is not supported\"\n        + \" in pseudo local file system.\");\n  }\n\n  @Override\n  public boolean rename(Path src, Path dst) throws IOException {\n    throw new UnsupportedOperationException(\"Rename is not supported\"\n        + \" in pseudo local file system.\");\n  }\n\n  @Override\n  public boolean delete(Path path, boolean recursive) {\n    throw new UnsupportedOperationException(\"File deletion is not supported \"\n        + \"in pseudo local file system.\");\n  }\n\n  @Override\n  public void setWorkingDirectory(Path newDir) {\n    throw new UnsupportedOperationException(\"SetWorkingDirectory \"","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java#L293-L329","documentation":"PseudoLocalFs.mkdirs() unconditionally throws UnsupportedOperationException. The pseudo local file system has no directory hierarchy: only the root '/' exists and all files live directly under it, so directory creation is meaningless. File 'creation' is just name-format validation; content appears only when a reader opens the file.","triggerScenarios":"Calling FileSystem.mkdirs(Path) or mkdirs(Path, FsPermission) on PseudoLocalFs; utilities that pre-create parent directories before writing files (distcp with -p, FileContext.mkdir, most output committers) when given pseudo:/// destinations.","commonSituations":"Using pseudo:// paths as map/reduce output directories in gridmix jobs; feeding pseudo-local paths into copy tools that replicate source directory structure; generic code that calls mkdirs for every parent in a path.","solutions":["Remove pseudo:/// paths from any code path that creates directories; the pseudo FS only serves generated input files","Use a real FileSystem (file:// or hdfs://) for outputs and directory structures","Guard with a scheme check (fs.getUri().getScheme()) and skip mkdirs for 'pseudo'"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (\"pseudo\".equals(fs.getUri().getScheme())) {\n  // PseudoLocalFs: only root '/' exists; skip directory creation\n}","typeGuard":null,"tryCatchPattern":"try {\n  fs.mkdirs(dir, perm);\n} catch (UnsupportedOperationException e) {\n  // pseudo-local FS has no directories; ignore only if dir is pseudo:///\n}","preventionTips":["Route outputs and directory-creating tools (distcp -p, committers) to real file systems","Treat PseudoLocalFs as a read-only generated-input source only"],"tags":["hadoop","gridmix","pseudo-local-fs","unsupported-operation","mkdirs"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}