-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cleaning up getTableName() for segment metadata #4289
Cleaning up getTableName() for segment metadata #4289
Conversation
a64b460
to
33c9fab
Compare
Removing unnecessary calls to segmentMetadata.getTableName()
33c9fab
to
25628d1
Compare
Codecov Report
@@ Coverage Diff @@
## master #4289 +/- ##
============================================
- Coverage 67.29% 67.09% -0.21%
Complexity 20 20
============================================
Files 1040 1041 +1
Lines 51662 51713 +51
Branches 7238 7247 +9
============================================
- Hits 34767 34696 -71
- Misses 14507 14651 +144
+ Partials 2388 2366 -22
Continue to review full report at Codecov.
|
Can you add more descriptions? The only time when you call SegmentMetadata.getTableName() is during segment push? |
I have updated the commit message.
|
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.
Can we mark segmentMetadata.getTableName() with @ deprecated?
minor suggestions, other than that lgtm
@@ -303,35 +303,37 @@ private SuccessResponse uploadSegment(FormDataMultiPart multiPart, boolean enabl | |||
throw new UnsupportedOperationException("Unsupported upload type: " + uploadType); | |||
} | |||
|
|||
String rawTableName = segmentMetadata.getTableName(); |
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.
final?
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.
All other temporary variables in the same code block is not using final
. Do you think that we still need final
?
} | ||
|
||
String clientAddress = InetAddress.getByName(request.getRemoteAddr()).getHostName(); | ||
String segmentName = segmentMetadata.getName(); | ||
String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(segmentMetadata.getTableName()); | ||
String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(rawTableName); |
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.
final?
As we discussed offline, I will deprecate |
This is a follow up work for apache#4288 and apache#4289 1. Added deprecated annotation for segment metadata & segment zk metadata. 2. Remove all getTableName & setTableName usages from testing code - There is no usage of getTableName() for segment zk metadata except the case where we fill segment metadata from segment zk metadata for realtime segment creation. - For segment metadata, the only usage is during the segment upload - We still write segment name to both segment zk metadata and segment metadata for rollback support.
This is a follow up work for apache#4288 and apache#4289 1. Added deprecated annotation for segment zk metadata. 2. Remove all getTableName & setTableName usages from testing code - There is no usage of getTableName() for segment zk metadata except the case where we fill segment metadata from segment zk metadata for realtime segment creation. - For segment metadata, the only usage is during the segment upload - We still write segment name to both segment zk metadata and segment metadata for rollback support.
* Add deprecated annotation for segment zk metadata This is a follow up work for #4288 and #4289 1. Added deprecated annotation for segment zk metadata. 2. Remove all getTableName & setTableName usages from testing code - There is no usage of getTableName() for segment zk metadata except the case where we fill segment metadata from segment zk metadata for realtime segment creation. - For segment metadata, the only usage is during the segment upload - We still write segment name to both segment zk metadata and segment metadata for rollback support. * Addressing comments
Removing unnecessary calls to segmentMetadata.getTableName()
After this change, only 3 places will call
segmentMetadata.getTableName()
:ZKMetadataUtil.updateSegmentMetadata()
- updating segment zk metadata from segment metadata during segment uploadColumnarToStarTreeConverter
provides table name to generator config from segment metadata.