{"record":{"id":"a6f0a220f906ad4a","repo":"apache/hadoop","slug":"doesn-t-support-setstoragepolicy-a6f0a2","errorCode":null,"errorMessage":"{} doesn't support setStoragePolicy","messagePattern":"(.+?) doesn't support setStoragePolicy","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java","lineNumber":3370,"sourceCode":"   *\n   * @param path Path to remove extended attribute\n   * @param name xattr name\n   * @throws IOException IO failure\n   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public void removeXAttr(Path path, String name) throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support removeXAttr\");\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 If an I/O error occurred.\n   */\n  public void satisfyStoragePolicy(final Path path) throws IOException {\n    throw new UnsupportedOperationException(\n        getClass().getSimpleName() + \" doesn't support setStoragePolicy\");\n  }\n\n  /**\n   * Set the storage policy for a given file or directory.\n   *\n   * @param src 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 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\");","sourceCodeStart":3352,"sourceCodeEnd":3388,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L3352-L3388","documentation":"Error \"{} doesn't support setStoragePolicy\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:3370 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set storage policies only on HDFS paths; other filesystems do not support them.","Verify the path is on HDFS and the named storage policy exists."],"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-23T01:17:44.959Z"}