Skip to content

fixes #768 fix race condition in generation of table map#973

Merged
keith-turner merged 1 commit intoapache:1.9from
keith-turner:accumulo-768
Feb 23, 2019
Merged

fixes #768 fix race condition in generation of table map#973
keith-turner merged 1 commit intoapache:1.9from
keith-turner:accumulo-768

Conversation

@keith-turner
Copy link
Copy Markdown
Contributor

No description provided.


public boolean isCurrent(ZooCache zc) {
return this.zooCache == zc && this.updateCount == zc.getUpdateCount();
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This method is nice. Would it be better to use equals comparison?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In this case I wanted to make sure it was the exact same zoocache instance

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah right, gotcha.

if (!map.isCurrent(zc)) {
instanceToMapCache.invalidate(instance.getInstanceID());
map = getTableMap(instance, zc);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need to synchronize on the TableMap cache? Or does guava handle that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Guava handles that

@keith-turner keith-turner merged commit 89cfb66 into apache:1.9 Feb 23, 2019
@keith-turner keith-turner deleted the accumulo-768 branch February 23, 2019 23:17
@ctubbsii ctubbsii added this to the 1.9.3 milestone Jul 12, 2024
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.

3 participants