{"record":{"id":"a27696fa85a80894","repo":"apache/hadoop","slug":"rename-is-not-supported-in-pseudo-local-file-syste","errorCode":null,"errorMessage":"Rename is not supported in pseudo local file system.","messagePattern":"Rename 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":317,"sourceCode":"    }\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 \"\n        + \"is not supported in pseudo local file system.\");\n  }\n\n  @Override\n  public Path makeQualified(Path path) {\n    // skip FileSystem#checkPath() to validate some other Filesystems","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java#L299-L335","documentation":"PseudoLocalFs.rename() unconditionally throws UnsupportedOperationException. Files in the pseudo local file system have no stored state to move — their identity (name plus encoded size) fully determines their content — so renaming is not implemented. The class only supports validation-style create, open for reading, and metadata queries.","triggerScenarios":"Calling FileSystem.rename(Path, Path) against PseudoLocalFs; output-commit protocols that rename temporary files into final locations (FileOutputCommitter move logic) when the destination is pseudo:///; any commit or atomic-move utility pointed at pseudo-local paths.","commonSituations":"Configuring gridmix or custom jobs to write output to pseudo:// paths; test code that exercises commit logic against a mock/pseudo file system; copy utilities that rename as part of atomic upload.","solutions":["Never use pseudo:/// as a rename source or destination; keep outputs on a real FileSystem","If you need a differently-sized generated file, create a new pseudo-local path with the new name/size instead of renaming","Skip rename for pseudo scheme via a capability check on fs.getUri().getScheme()"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (\"pseudo\".equals(fs.getUri().getScheme())) {\n  // rename unsupported: create a new pseudo path with the new name instead\n}","typeGuard":null,"tryCatchPattern":"try {\n  fs.rename(src, dst);\n} catch (UnsupportedOperationException e) {\n  // commit/atomic-move logic must not run against pseudo:///; use a real FS\n}","preventionTips":["Keep commit and move operations off pseudo:// paths","Represent a 'renamed' pseudo file as a new generateFilePath(name, size)"],"tags":["hadoop","gridmix","pseudo-local-fs","unsupported-operation","rename"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}