Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[SPARK-30964][Core][WebUI] Accelerate InMemoryStore with a new index #27716
[SPARK-30964][Core][WebUI] Accelerate InMemoryStore with a new index #27716
Changes from 8 commits
4f93ffc
c6c2c82
b0bb448
8969a4d
d50c801
9cb44c3
da463e9
753a14a
2ec82df
091fb7e
e02acc0
491e9eb
c0d3755
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
since there is no document, I still have problems understanding it.
The basic idea is: if the
index
is natural index, we can just look it up in O(1). For other index, we have to do linear scan, extract keys and find matches.The extension here: if the
index
is parent of natural index, get the children natural indexes and do O(1) lookup.However, seems the basic idea is missing? Shall we avoid linear scan if
index
is natural index?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.
Yes and no.
I am aware of the natural index is not handled properly here. But all the method calls of this method doesn't pass the natural index in.
There is a simpler API to use in
KVStore
So I think this is minor and I prefer to do it in another PR, since this one is complicated.
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.
we should probably unify the
delete
method, but it's not related to this PR.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.
Yes, I will do it in another PR.
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.
When a parent key in
parentToChildrenMap
points to emptyNaturalKeys
, we can also remove it?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.
Yes, nothing will change if the NaturalKeys
v
doesn't containkey
.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.
Oh, I meant after
v.remove(asKey(key))
, ifv
is empty, can we remove the (parent key, empty NaturalKeys) fromparentToChildrenMap
?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.
Well,
parentToChildrenMap
is a concurrent map and checking emptiness costs time.The method here is to delete one entry. I think we can make it simple and keep it this way.
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.
Is it possible that
naturalParentIndexName
doesn't equal toti.getParentIndexName(index)
? Isn'tString index = KVIndex.NATURAL_INDEX_NAME
?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.
It is possible. I have explained in https://github.com/apache/spark/pull/27716/files#r385846069.