Skip to content

Add replacement for datawave.ingest.util.ThreadUtil - #3816

Open
lbschanno wants to merge 2 commits into
integrationfrom
task/threadUtilMethod
Open

Add replacement for datawave.ingest.util.ThreadUtil#3816
lbschanno wants to merge 2 commits into
integrationfrom
task/threadUtilMethod

Conversation

@lbschanno

Copy link
Copy Markdown
Collaborator

Add the class datawave.concurrent.ThreadUtils to the common-utils module. This class is intended to be a replacement for datawave.ingest.util.ThreadUtil, placed in a more commonly accessible location.

The following changes have also been made:

  • Mark the class datawave.ingest.util.ThreadUtil and its methods as deprecated, with links to their replacements.
  • Make ThreadUtils.waitForThreads() accept a Consumer log delegate instead of an org.apache.log4j.Logger instance. This makes it far easier for callers to decide how they want to receive and handle status update messages.
  • Add the method ThreadUtils.blockUntil() to provide the ability to block the current thread until either the supplied condition is true, or a timeout is met.
  • Add comprehensive unit tests for all methods in ThreadUtils.

ThreadUtils.blockUntil() is used in several pending PRs. This PR is to faciliate easier review and smaller change sets in the pending PRs.

Add the class datawave.concurrent.ThreadUtils to the common-utils
module. This class is intended to be a replacement for
datawave.ingest.util.ThreadUtil, placed in a more commonly accessible
location.

The following changes have also been made:
- Mark the class datawave.ingest.util.ThreadUtil and its methods as
  deprecated, with links to their replacements.
- Make ThreadUtils.waitForThreads() accept a Consumer<String> log
  delegate instead of an org.apache.log4j.Logger instance. This makes it
  far easier for callers to decide how they want to receive and handle
  status update messages.
- Add the method ThreadUtils.blockUntil() to provide the ability to
  block the current thread until either the supplied condition is true,
  or a timeout is met.
- Add comprehensive unit tests for all methods in ThreadUtils.
@lbschanno
lbschanno requested review from apmoriarty and avgAGB August 10, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant