Skip to content
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

Cherry Pick #1227 to Branch 3.0.x -> Fixing bug : Avoid registering subscriber class multiple times #1230

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

guljain
Copy link
Contributor

@guljain guljain commented Jul 30, 2024

No description provided.

…oogleCloudDataproc#1227)

* Fixing bug to avoid registering subscriber class multiple times

* Refactoring for Singleton pattern
@guljain
Copy link
Contributor Author

guljain commented Jul 30, 2024

/gcbrun

public static synchronized GoogleCloudStorageEventSubscriber getInstance(
@Nonnull GhfsGlobalStorageStatistics storageStatistics) {
if (INSTANCE == null) {
logger.atFiner().log("Subscriber class invoked for first time");
Copy link
Contributor

Choose a reason for hiding this comment

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

why not add it in the constructor

public static synchronized GoogleCloudStorageEventSubscriber getInstance(
@Nonnull GhfsGlobalStorageStatistics storageStatistics) {
if (INSTANCE == null) {
logger.atFiner().log("Subscriber class invoked for first time");
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename this to "Created GoogleCloudStorageEventSubscriber"?

@guljain guljain merged commit c132e82 into GoogleCloudDataproc:branch-3.0.x Jul 30, 2024
4 checks passed
arunkumarchacko pushed a commit to arunkumarchacko/hadoop-connectors that referenced this pull request Oct 3, 2024
…Avoid registering subscriber class multiple times (GoogleCloudDataproc#1230)

* 2.2.x Fixing bug : Avoid registering subscriber class multiple times (GoogleCloudDataproc#1227)

* Fixing bug to avoid registering subscriber class multiple times

* Refactoring for Singleton pattern

* cherry pick GoogleCloudDataproc#1227
arunkumarchacko added a commit that referenced this pull request Oct 9, 2024
…ubscriber class multiple times (#1230) (#1257)



Co-authored-by: Gul Jain <[email protected]>
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.

2 participants