{"record":{"id":"66e9a4688766654a","repo":"apache/hadoop","slug":"append-is-not-supported-in-pseudo-local-file-syste","errorCode":null,"errorMessage":"Append is not supported in pseudo local file system.","messagePattern":"Append 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":305,"sourceCode":"    public long getPos() throws IOException {\n      return curPos;\n    }\n\n    @Override\n    public void seek(long pos) throws IOException {\n      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 \"","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/PseudoLocalFs.java#L287-L323","documentation":"PseudoLocalFs.append() unconditionally throws UnsupportedOperationException because the file system stores nothing: file content is generated on the fly from the file name each time it is opened, so there is no persisted data to append to. Only create(Path) (a validation no-op returning null), open(), and metadata queries are supported. Any append semantics are impossible by design.","triggerScenarios":"Calling FileSystem.append(Path) or append(Path, int, Progressable) on a PseudoLocalFs instance; frameworks that recover or extend output files (e.g. output-format recovery paths, FSDataOutputStream.append wrappers) invoked against pseudo:/// paths.","commonSituations":"Using pseudo:// URIs as output locations in gridmix jobs or custom tools; routing a generic file-copy/append utility at the pseudo local file system; writing test harnesses that assume every FileSystem implementation supports append.","solutions":["Do not append to pseudo-local files; write new files with the desired size encoded in the name via PseudoLocalFs.generateFilePath(name, newSize)","Point append operations at a real FileSystem (local fs or HDFS) that persists content","If a generic code path calls append, guard it by checking fs.getUri().getScheme().equals(\"pseudo\") and skip or substitute a real file system"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"boolean supportsAppend(FileSystem fs) {\n  return !\"pseudo\".equals(fs.getUri().getScheme());\n}","typeGuard":null,"tryCatchPattern":"try {\n  fs.append(path, bufferSize, progress);\n} catch (UnsupportedOperationException e) {\n  // PseudoLocalFs is generate-on-read only; switch to a real FileSystem for append\n}","preventionTips":["Never configure pseudo:// URIs as output/append targets in gridmix jobs","Scheme-check FileSystem instances before calling mutation APIs (append/mkdirs/rename/delete/setWorkingDirectory)"],"tags":["hadoop","gridmix","pseudo-local-fs","unsupported-operation","append"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}