{"record":{"id":"1bc1a02e73f43cc7","repo":"apache/hadoop","slug":"doesn-t-support-unsetstoragepolicy-1bc1a0","errorCode":null,"errorMessage":"{} doesn't support unsetStoragePolicy","messagePattern":"(.+?) doesn't support unsetStoragePolicy","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java","lineNumber":3399,"sourceCode":"   * @throws IOException IO failure\n   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public void setStoragePolicy(final Path src, final String policyName)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support setStoragePolicy\");\n  }\n\n  /**\n   * Unset the storage policy set for a given file or directory.\n   * @param src file or directory path.\n   * @throws IOException IO failure\n   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public void unsetStoragePolicy(final Path src) throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support unsetStoragePolicy\");\n  }\n\n  /**\n   * Query the effective storage policy ID for the given file or directory.\n   *\n   * @param src file or directory path.\n   * @return storage policy for give file.\n   * @throws IOException IO failure\n   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public BlockStoragePolicySpi getStoragePolicy(final Path src)\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support getStoragePolicy\");\n  }\n","sourceCodeStart":3381,"sourceCodeEnd":3417,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L3381-L3417","documentation":"Error \"{} doesn't support unsetStoragePolicy\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:3399 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call unsetStoragePolicy only against HDFS.","Confirm a storage policy was previously set on the path before unsetting."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}