seaweedfs/seaweedfs · error · UnsupportedOperationException
Not implemented by the {getSimpleName} FileSystem implementa
Error message
Not implemented by the {getSimpleName} FileSystem implementation What it means
UnsupportedOperationException thrown unconditionally by SeaweedFileSystem.concat() (seaweed.hdfs.SeaweedFileSystem:338): the Hadoop FileSystem concat operation (append source files onto a target and delete sources atomically) is simply not implemented by this filesystem. Any caller of concat on a seaweedfs:// URI gets this immediately — it is deterministic, not environmental.
Source
Thrown at other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystem.java:338
seaweedFileSystemStore.setPermission(path, permission);
}
Path qualify(Path path) {
return path.makeQualified(uri, workingDirectory);
}
/**
* Concat existing files together.
*
* @param trg the path to the target destination.
* @param psrcs the paths to the sources to use for the concatenation.
* @throws IOException IO failure
* @throws UnsupportedOperationException if the operation is unsupported
* (default).
*/
@Override
public void concat(final Path trg, final Path[] psrcs) throws IOException {
throw new UnsupportedOperationException("Not implemented by the " +
getClass().getSimpleName() + " FileSystem implementation");
}
/**
* Truncate the file in the indicated path to the indicated size.
* <ul>
* <li>Fails if path is a directory.</li>
* <li>Fails if path does not exist.</li>
* <li>Fails if path is not closed.</li>
* <li>Fails if new size is greater than current size.</li>
* </ul>
*
* @param f The path to the file to be truncated
* @param newLength The size the file is to be truncated to
* @return <code>true</code> if the file has been truncated to the desired
* <code>newLength</code> and is immediately available to be reused for
* write operations such as <code>append</code>, or
* <code>false</code> if a background process of adjusting the length ofView on GitHub (pinned to 1c926e8fac)
Solutions
- Replace concat with copy-based merging: open each source via fs.open, copy bytes into an append/create stream on the target, then fs.delete the sources.
- If performance matters, do the merge with filesystem-level parallelism or keep files unmerged and merge on read.
- Longer term: request/implement concat support in the SeaweedFS filer client rather than subclassing to fake it.
Example fix
// before
fs.concat(new Path("/out/merged"), srcPaths); // UnsupportedOperationException
// after — manual merge, then delete sources
try (FSDataOutputStream out = fs.create(new Path("/out/merged"), true)) {
for (Path src : srcPaths) {
try (FSDataInputStream in = fs.open(src)) {
org.apache.hadoop.io.IOUtils.copyBytes(in, out, 1 << 16, false);
}
}
}
for (Path src : srcPaths) fs.delete(src, false); Defensive patterns
Strategy: fallback
Validate before calling
boolean supportsConcat(FileSystem fs) {
return !(fs instanceof seaweed.hdfs.SeaweedFileSystem)
&& !"seaweedfs".equals(fs.getUri().getScheme());
} Type guard
boolean canConcat = !(fs instanceof seaweed.hdfs.SeaweedFileSystem);
Try / catch
try {
fs.concat(trg, srcs);
} catch (UnsupportedOperationException e) {
// NOTE: UOE is a RuntimeException — a bare catch(IOException) will NOT stop it
mergeByCopy(fs, trg, srcs);
} Prevention
- Assume concat is optional in the Hadoop FileSystem contract; always have a copy-based merge fallback.
- Capability-check via instanceof/scheme before calling concat on mixed-storage pipelines.
- Remember UnsupportedOperationException is unchecked: it bypasses catch(IOException) blocks and can kill mappers/reducers mid-task.
When it happens
Trigger: Calling fs.concat(trg, psrcs) on a SeaweedFileSystem; higher-level utilities that invoke concat, e.g. FileUtil.concat, distcp/HDFS shell 'hdfs dfs -concat' style flows, or frameworks that merge small part-files via concat (some HBase/MapReduce rollup and file-compaction utilities).
Common situations: Porting HDFS-native pipelines (which rely on cheap concat) to SeaweedFS; data compaction jobs that expect the target's blocks to be reused; tooling upgrades that started calling concat where it previously copied.
Related errors
- Filesystem does not support symlinks!
- Failed to create file: {path}
- Not a directory: {parent}
- Failed to append to file: {path}
- Path is a file: {path}
AI-assisted analysis of seaweedfs/seaweedfs@1c926e8fac (2026-08-15).
Data as JSON: /api/errors/7a5db2ad8a63fe2b.
Report an issue: GitHub.