{"record":{"id":"3f73eafd1ad606f7","repo":"apache/beam","slug":"unknown-resource-hint","errorCode":null,"errorMessage":"Unknown resource hint: ","messagePattern":"Unknown resource hint: ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/resourcehints/ResourceHints.java","lineNumber":120,"sourceCode":"  /** Creates a {@link ResourceHints} instance with hints supplied in options. */\n  public static ResourceHints fromOptions(PipelineOptions options) {\n    ResourceHintsOptions resourceHintsOptions = options.as(ResourceHintsOptions.class);\n    ResourceHints result = create();\n    List<String> hints = resourceHintsOptions.getResourceHints();\n    Splitter splitter = Splitter.on('=').limit(2);\n    for (String hint : hints) {\n      List<String> parts = splitter.splitToList(hint);\n      if (parts.size() != 2) {\n        throw new IllegalArgumentException(\"Unparsable resource hint: \" + hint);\n      }\n      String nameOrUrn = parts.get(0);\n      String stringValue = parts.get(1);\n      String urn;\n      if (hintNameToUrn.containsKey(nameOrUrn)) {\n        urn = hintNameToUrn.get(nameOrUrn);\n      } else if (!nameOrUrn.startsWith(\"beam:resources:\")) {\n        // Allow unknown hints to be passed, but validate a little bit to prevent typos.\n        throw new IllegalArgumentException(\"Unknown resource hint: \" + hint);\n      } else {\n        urn = nameOrUrn;\n      }\n      ResourceHint value =\n          Preconditions.checkNotNull(parsers.getOrDefault(urn, StringHint::new)).apply(stringValue);\n      result = result.withHint(urn, value);\n    }\n    return result;\n  }\n\n  /*package*/ static class BytesHint extends ResourceHint {\n    private static Map<String, Long> suffixes =\n        ImmutableMap.<String, Long>builder()\n            .put(\"B\", 1L)\n            .put(\"KB\", 1000L)\n            .put(\"MB\", 1000_000L)\n            .put(\"GB\", 1000_000_000L)\n            .put(\"TB\", 1000_000_000_000L)","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/resourcehints/ResourceHints.java#L102-L138","documentation":"When parsing resource hints, Beam maps known hint names (e.g. 'cpu_count') to URNs. If a hint's name is not a known one and doesn't start with the reserved prefix 'beam:resources:', Beam rejects it with IllegalArgumentException('Unknown resource hint: <hint>') to catch typos.","triggerScenarios":"Supplying a hint name that isn't registered (e.g. --resourceHints=cpu_cout=2 typo) and that isn't a beam:resources: URN; the check nameOrUrn.startsWith(\"beam:resources:\") fails, so it throws.","commonSituations":"Typos in hint names; using hints from a different Beam version or runner where the name isn't registered; custom hints not prefixed with the required 'beam:resources:' URN scheme.","solutions":["Fix the hint name spelling to a registered hint (e.g. cpu_count, min_ram_mb)","Use the full URN form for custom hints: beam:resources:my_custom_hint=value","Check the Beam/runner version supports the hint name you are using","List available hints via ResourceHints known parsers/URNs to verify valid names"],"exampleFix":"// before\n--resourceHints=cpu_cout=2\n\n// after\n--resourceHints=cpu_count=2","handlingStrategy":"validation","validationCode":"Set<String> known = Set.of(\"cpu_count\", \"min_ram_mb\");\nfor (String hint : hints) {\n  String name = hint.split(\"=\", 2)[0];\n  if (!known.contains(name) && !name.startsWith(\"beam:resources:\")) {\n    throw new IllegalArgumentException(\"Unknown resource hint name: \" + name);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  ResourceHints.fromOptions(options);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Unknown resource hint:\")) {\n    // correct the name or switch to a beam:resources: URN\n  }\n}","preventionTips":["Double-check hint names against Beam docs for your version","Prefix custom hints with beam:resources:","Centralize hint definitions in constants rather than raw strings"],"tags":["java","apache-beam","resource-hints","cli-options","unknown-hint"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}