the-other-tim-brown opened a new pull request, #13577:
URL: https://github.com/apache/hudi/pull/13577
### Change Logs
**Move Instant Time Generation to TransactionManager**
Why: The transaction manager will serve as the central point for controlling
the timeline updates to ensure they are safe.
Benefits:
- We're able to remove the duplicated code around retries for locking.
- LockManager was not properly shutdown in previously cached instances of
TimeGenerator, causing resource leaks. Now the lifecycle is handled by the
TransactionManager
- We can maintain in-memory state for whether the lock is already held,
reducing reliance on `skipLock` booleans that can be error prone
- Eventually we can move the TimeGenerator to be a package private interface
to prevent direct and potential misuse of the library
**Completing an instant on the timeline now takes in an instant time**
Why: Previously we were generating the instant time in the active timeline
but the TransactionManager will be controlling instant time generation going
forward.
Benefits:
- We no longer require the time generator and lock configs to be part of the
meta client. This was increasing the overhead of task serialization in spark
tasks.
- Allows us to remove more instances of `skipLock` style args which can be
error prone
**New Helper Methods**
- `TransactionManager#executeStateChangeWithInstant` provides a cleaner way
for users to consume an instant time and perform some action that will update
the state of the table.
- `TransactionManager#generateInstantTime` generates an instant time only if
the lock is already required or the writer config indicates that no lock is
required.
### Impact
- Provides useful methods for interacting with the timeline while also
decreasing the risk of developer mistakes when writing new code.
### Risk level (write none, low medium or high below)
Medium
### Documentation Update
_Describe any necessary documentation update if there is any new feature,
config, or user-facing change. If not, put "none"._
- _The config description must be updated if new configs are added or the
default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website.
Please create a Jira ticket, attach the
ticket number here and follow the
[instruction](https://hudi.apache.org/contribute/developer-setup#website) to
make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's
guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]