{"record":{"id":"5ab5f1a4d981e6a7","repo":"apache/hadoop","slug":"doesn-t-support-getallstoragepolicies-5ab5f1","errorCode":null,"errorMessage":"{} doesn't support getAllStoragePolicies","messagePattern":"(.+?) doesn't support getAllStoragePolicies","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java","lineNumber":3428,"sourceCode":"   *         (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\n  /**\n   * Retrieve all the storage policies supported by this file system.\n   *\n   * @return all storage policies supported by this filesystem.\n   * @throws IOException IO failure\n   * @throws UnsupportedOperationException if the operation is unsupported\n   *         (default outcome).\n   */\n  public Collection<? extends BlockStoragePolicySpi> getAllStoragePolicies()\n      throws IOException {\n    throw new UnsupportedOperationException(getClass().getSimpleName()\n        + \" doesn't support getAllStoragePolicies\");\n  }\n\n  /**\n   * Get the root directory of Trash for current user when the path specified\n   * is deleted.\n   *\n   * @param path the trash root of the path to be determined.\n   * @return the default implementation returns {@code /user/$USER/.Trash}\n   */\n  public Path getTrashRoot(Path path) {\n    return this.makeQualified(new Path(getHomeDirectory().toUri().getPath(),\n        TRASH_PREFIX));\n  }\n\n  /**\n   * Get all the trash roots for current user or all users.\n   *","sourceCodeStart":3410,"sourceCodeEnd":3446,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L3410-L3446","documentation":"Error \"{} doesn't support getAllStoragePolicies\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java:3428 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call getAllStoragePolicies only on a DistributedFileSystem instance.","Cast/check the FileSystem type before invoking this HDFS-specific API."],"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"}