{"record":{"id":"08aa7553a85bf46f","repo":"apache/hadoop","slug":"mergefs-not-implemented-yet","errorCode":null,"errorMessage":"mergefs not implemented yet","messagePattern":"mergefs not implemented yet","errorType":"exception","errorClass":"UnsupportedFileSystemException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java","lineNumber":283,"sourceCode":"                  +\" for uri \" + uri + \"with exception: \" + ex.toString());\n            }\n            return null;\n          }\n        };\n      }\n\n      @Override\n      protected AbstractFileSystem getTargetFileSystem(\n          final INodeDir<AbstractFileSystem> dir) throws URISyntaxException {\n        return new InternalDirOfViewFs(dir, creationTime, ugi, getUri(), this,\n            config);\n      }\n\n      @Override\n      protected AbstractFileSystem getTargetFileSystem(final String settings,\n          final URI[] mergeFsURIList)\n          throws URISyntaxException, UnsupportedFileSystemException {\n        throw new UnsupportedFileSystemException(\"mergefs not implemented yet\");\n        // return MergeFs.createMergeFs(mergeFsURIList, config);\n      }\n    };\n    renameStrategy = ViewFileSystem.RenameStrategy.valueOf(\n        conf.get(Constants.CONFIG_VIEWFS_RENAME_STRATEGY,\n            ViewFileSystem.RenameStrategy.SAME_MOUNTPOINT.toString()));\n  }\n\n  @Override\n  @Deprecated\n  public FsServerDefaults getServerDefaults() throws IOException {\n    return LocalConfigKeys.getServerDefaults();\n  }\n\n  @Override\n  public FsServerDefaults getServerDefaults(final Path f) throws IOException {\n    InodeTree.ResolveResult<AbstractFileSystem> res;\n    try {","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java#L265-L301","documentation":"When a mount table declares a merged link (fs.viewfs.mounttable.<n>.linkMerge.<path>=uri1,uri2,...), InodeTree asks the FS for a merged target FileSystem. ViewFs (the FileContext/AbstractFileSystem implementation) answers with UnsupportedFileSystemException(\"mergefs not implemented yet\") from getTargetFileSystem(String, URI[]) — the MergeFs branch is commented out, so merge links are simply unimplemented in ViewFs.","triggerScenarios":"Configuring fs.viewfs.mounttable.<n>.linkMerge./data=hdfs://nn1:8020/data,hdfs://nn2:8020/data and then creating a FileContext on viewfs://<n> (initialization builds the InodeTree and hits the throw immediately); configs copied from systems expecting union mounts.","commonSituations":"Operators migrating off union/federated layouts assuming linkMerge works everywhere (only linkMergeSlash and specific composite FSs like Nfly via linkNfly are implemented); stale documentation or cluster templates carrying linkMerge entries.","solutions":["Remove the linkMerge entry and mount each child path individually (link.<path>)","Use linkNfly (read-only N-fly replication) or linkMergeSlash if one of those semantics fits","For a true union namespace, use Router-Based Federation (HDFS RBF) instead of viewfs linkMerge"],"exampleFix":"<!-- before (core-site.xml) -->\n<property><name>fs.viewfs.mounttable.c1.linkMerge./data</name>\n  <value>hdfs://nn1:8020/data,hdfs://nn2:8020/data</value></property>\n\n<!-- after: individual mounts -->\n<property><name>fs.viewfs.mounttable.c1.link./data/nn1</name>\n  <value>hdfs://nn1:8020/data</value></property>\n<property><name>fs.viewfs.mounttable.c1.link./data/nn2</name>\n  <value>hdfs://nn2:8020/data</value></property>","handlingStrategy":"validation","validationCode":"static void assertNoMergeLinks(Configuration conf) {\n  for (Map.Entry<String, String> e : conf) {\n    if (e.getKey().contains(\".linkMerge.\")) {\n      throw new IllegalStateException(\"ViewFs does not implement linkMerge: \" + e.getKey());\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  fc = FileContext.getFileContext(new URI(\"viewfs://c1\"), conf);\n} catch (UnsupportedFileSystemException e) {\n  if (e.getMessage().contains(\"mergefs\")) log.error(\"remove linkMerge entries from the mount table\");\n}","preventionTips":["Config-lint mount tables for linkMerge before rolling out FileContext/viewfs clients","Document supported link types (link, linkFallback, linkMergeSlash, linkNfly) in cluster templates"],"tags":["viewfs","mount-table","link-merge","unsupported-operation","hadoop-common"],"backgroundTag":"unsupported-mount-type","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}