-
Notifications
You must be signed in to change notification settings - Fork 751
[GOBBLIN-2225] Use random id for Workunit if recovery helper is not initialised #4134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GOBBLIN-2225] Use random id for Workunit if recovery helper is not initialised #4134
Conversation
2580b54
to
1d3aef3
Compare
@Override | ||
public Guid guid() throws IOException { | ||
return Guid.fromStrings(toString()); | ||
return id; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not fully backward compatible, given guid usage in DistcpSplitter
and RecoveryHelper
which are used in CopyDataPublisher
and FIleAwareInputStreamWriter
, lets make this change atleast backward compatible by adding a new function which accepts boolean createGuidFromUuid
and pass this as yes from the caller where we are anticipating this to be called and in case no default to original way
@thisisArjit Add Jira ticket to description and title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a unique identifier to the CopyEntity class to improve performance by avoiding expensive serialization operations when computing entity IDs. Instead of computing the GUID from a serialized JSON string, each CopyEntity now has a pre-generated UUID-based identifier.
- Replace GUID computation from JSON serialization with pre-generated UUID
- Add debug logging guard to prevent unnecessary string concatenation
- Import UUID class for unique ID generation
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -54,6 +55,8 @@ public class CopyEntity implements HasGuid { | |||
|
|||
public static final Gson GSON = GsonInterfaceAdapter.getGson(Object.class); | |||
|
|||
private final Guid id = new Guid(UUID.randomUUID().toString().getBytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UUID is converted to string then to bytes, which is inefficient. Consider using UUID.randomUUID().toString().getBytes(StandardCharsets.UTF_8)
to specify the charset explicitly, or better yet, use UUID.randomUUID().toString()
directly if the Guid constructor accepts strings.
Copilot uses AI. Check for mistakes.
5f0bb3e
to
21489bb
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4134 +/- ##
============================================
+ Coverage 42.81% 51.64% +8.82%
- Complexity 2480 7660 +5180
============================================
Files 513 1397 +884
Lines 21744 52892 +31148
Branches 2478 5807 +3329
============================================
+ Hits 9309 27314 +18005
- Misses 11481 23265 +11784
- Partials 954 2313 +1359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ed8f859
to
ce77ad6
Compare
…son string
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
Tests
Commits