-
Notifications
You must be signed in to change notification settings - Fork 9k
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
HDFS-17632. RBF: Support listOpenFiles for routers #7075
base: trunk
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
for (Map.Entry<RemoteLocation, BatchedEntries> entry : results.entrySet()) { | ||
BatchedEntries nsEntries = entry.getValue(); | ||
hasMore |= nsEntries.hasMore(); | ||
for (int i = 0; i< nsEntries.size(); i++) { |
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.
for (int i = 0; i < nsEntries.size(); i++) {
OpenFileEntry ofe = (OpenFileEntry) nsEntries.get(i); | ||
if (ofe.getId() > minOfMax) { | ||
hasMore = true; | ||
continue; |
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.
break
?
// Get the largest inodeIds for each namespace, and the smallest inodeId of them | ||
// then ignore all entries above this id to keep a consistent prevId for the next listOpenFiles | ||
long minOfMax = Long.MAX_VALUE; | ||
for (BatchedEntries nsEntries : results.values()) { |
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 there a way to loop these BatchedEntries
once to get the result?
It seems that the efficiency of two cycles is a bit low.
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.
I went with this option because this approach doesn't require changing the current protocol for listOpenFiles
(id, types, path), otherwise client needs to be aware of the last id for each namespace. I think router getListing
uses the same logic
💔 -1 overall
This message was automatically generated. |
Description of PR
Routers don't have support for
listOpenFiles
yet. Single destination paths are straightforward. Multi destination paths are joined; entries with inodeId > min(max(entry inodeIds)) are ignored to get a consistent prevId for the iterator.How was this patch tested?
UTs.