Skip to content

refactor: Remove const_cast and const_pointer_cast#734

Open
PingLiuPing wants to merge 1 commit intofacebookincubator:mainfrom
PingLiuPing:lp_refactor_const_cast
Open

refactor: Remove const_cast and const_pointer_cast#734
PingLiuPing wants to merge 1 commit intofacebookincubator:mainfrom
PingLiuPing:lp_refactor_const_cast

Conversation

@PingLiuPing
Copy link

Fix #324.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jan 6, 2026
@meta-codesync
Copy link

meta-codesync bot commented Jan 7, 2026

@amitkdutta has imported this pull request. If you are a Meta employee, you can view this in D90277850.

@amitkdutta
Copy link
Contributor

@PingLiuPing Theres is merge conflict. Please take a look.

}

void LocalHiveConnectorMetadata::ensureInitialized() const {
std::lock_guard<std::mutex> l(mutex_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this function was removed, do we still need the mutex?

I thought this was to guard against the case where multiple threads invoke ensureInitialized(). Could you double check

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hdikeman Thanks for the comment.
I noticed that mutex_ is not only used here, it is used in many other places too such as findTable, dropTable etc.

@PingLiuPing PingLiuPing force-pushed the lp_refactor_const_cast branch 2 times, most recently from 503791f to e7f55b5 Compare January 12, 2026 11:40
@PingLiuPing PingLiuPing force-pushed the lp_refactor_const_cast branch from e7f55b5 to 7fda812 Compare January 21, 2026 13:28
@PingLiuPing PingLiuPing force-pushed the lp_refactor_const_cast branch from 7fda812 to 78d11b7 Compare January 23, 2026 15:08
@PingLiuPing
Copy link
Author

@PingLiuPing Theres is merge conflict. Please take a look.

@amitkdutta Conflicts has been resolved. Could you help to import this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor LocalHiveConnectorMetadata.cpp to remove usage of const_cast and const_pointer_cast

3 participants