apache / apache/beam

IOChannelUtils.getFactory should throw an unchecked exception rather than IOException

Open
#17,992 0 comments 0 reactions 0 assignees View on GitHub
bug core java P3
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

In [this PR](https://github.com/apache/incubator-beam/pull/300#discussion-diff-63109718), we've add a new method, `IOChannelUtils.hasFactory`, which provides a convenient way to verify that a factory exists before calling getFactory. As such, the IOException thrown by getFactory is extra cruft for consumers using the new pattern.

We should update additional consumers to check hasFactory first, and then migrate getFactory to throw a RuntimeException

Imported from Jira [BEAM-281](https://issues.apache.org/jira/browse/BEAM-281). Original Jira may contain additional context.
Reported by: swegner.

Contributor guide

Open the contributing guide

Research direction

Start by locating IOChannelUtils.hasFactory and IOChannelUtils.getFactory, then identify the additional consumers that call getFactory without the new check. Review the imported Jira context if needed. Done means consumers check hasFactory first and getFactory no longer exposes IOException, with the affected behavior covered by the repository's existing validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.