{"record":{"id":"2b7e0357ec59512c","repo":"apache/hadoop","slug":"doesn-t-support-satisfystoragepolicy","errorCode":null,"errorMessage":"{} doesn't support satisfyStoragePolicy","messagePattern":"(.+?) doesn't support satisfyStoragePolicy","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java","lineNumber":1521,"sourceCode":"   * {@link FileContext#deleteSnapshot(Path, String)}.\n   *\n   * @param snapshotDir snapshot dir.\n   * @param snapshotName snapshot name.\n   * @throws IOException raised on errors performing I/O.\n   */\n  public void deleteSnapshot(final Path snapshotDir, final String snapshotName)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support deleteSnapshot\");\n  }\n\n  /**\n   * Set the source path to satisfy storage policy.\n   * @param path The source path referring to either a directory or a file.\n   * @throws IOException raised on errors performing I/O.\n   */\n  public void satisfyStoragePolicy(final Path path) throws IOException {\n    throw new UnsupportedOperationException(\n        getClass().getSimpleName() + \" doesn't support satisfyStoragePolicy\");\n  }\n\n  /**\n   * Set the storage policy for a given file or directory.\n   *\n   * @param path file or directory path.\n   * @param policyName the name of the target storage policy. The list\n   *                   of supported Storage policies can be retrieved\n   *                   via {@link #getAllStoragePolicies}.\n   * @throws IOException raised on errors performing I/O.\n   */\n  public void setStoragePolicy(final Path path, final String policyName)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support setStoragePolicy\");\n  }\n","sourceCodeStart":1503,"sourceCodeEnd":1539,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/AbstractFileSystem.java#L1503-L1539","documentation":"satisfyStoragePolicy asks a filesystem to physically move blocks to match their assigned storage policy (HDFS Mover functionality). AbstractFileSystem.satisfyStoragePolicy(Path) is a default stub that throws UnsupportedOperationException with the subclass name. Only HDFS implements it, so the error means the path is not on HDFS.","triggerScenarios":"FileContext.satisfyStoragePolicy(path) (or HDFS policy-satisfaction tooling driven through the generic API) on local, viewfs-to-object-store, or ftp paths; tiering scripts that call satisfy right after setStoragePolicy but pointed at a non-HDFS mount.","commonSituations":"Cold-data tiering automation reused across clusters; dev/test runs where fs.defaultFS=file://; a mount-table entry for an s3a target receiving HDFS storage-policy commands.","solutions":["Verify the path is hdfs:// and use HdfsAdmin.satisfyStoragePolicy (or `hdfs dfsadmin -fs hdfs://... satisfyStoragePolicy <path>`) for the supported path.","Guard the call by URI scheme when the same code runs over mixed filesystems.","Catch UnsupportedOperationException and skip policy satisfaction where it cannot apply.","On HDFS, confirm a policy is actually set (setStoragePolicy) before requesting satisfaction."],"exampleFix":"// before\nfc.satisfyStoragePolicy(path); // throws on file://\n\n// after\nif (\"hdfs\".equals(path.toUri().getScheme())) {\n  fc.satisfyStoragePolicy(path);\n}","handlingStrategy":"validation","validationCode":"static boolean policyOpsSupported(Path p) {\n  return \"hdfs\".equals(p.toUri().getScheme());\n}","typeGuard":null,"tryCatchPattern":"try {\n  fc.satisfyStoragePolicy(path);\n} catch (UnsupportedOperationException e) {\n  LOG.debug(\"policy satisfaction n/a on {}\", path);\n}","preventionTips":["Drive HDFS Mover-style operations through HdfsAdmin, not generic FileContext code","Verify scheme before mixing tiering calls into portable pipelines"],"tags":["hadoop","filesystem","storage-policy","hdfs","unsupportedoperationexception"],"backgroundTag":"storage-policy-unsupported","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}