-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-27997 Enhance prefetch executor to record region prefetch infor… #5339
Conversation
…mation along with the list of hfiles prefetched
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
…mation along with the list of hfiles prefetched
🎊 +1 overall
This message was automatically generated. |
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.
Please add comments describing both regionPrefetchSizeMap
and prefetchCompleted
structures, so that one doesn't need to go over the code logic to understand why we need both.
prefetchCompleted.get(hFileName).entrySet().iterator().next(); | ||
String regionEncodedName = regionEntry.getKey(); | ||
long filePrefetchedSize = regionEntry.getValue(); | ||
if (LOG.isDebugEnabled()) { |
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.
Nit: no need for this check, since we are not doing any computation on the debug message.
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.
Remove the check.
@@ -53,7 +56,8 @@ public final class PrefetchExecutor { | |||
private static final Map<Path, Future<?>> prefetchFutures = new ConcurrentSkipListMap<>(); | |||
/** Set of files for which prefetch is completed */ | |||
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "MS_SHOULD_BE_FINAL") | |||
private static HashMap<String, Boolean> prefetchCompleted = new HashMap<>(); | |||
private static ConcurrentHashMap<String, Long> regionPrefetchSizeMap = new ConcurrentHashMap<>(); | |||
private static HashMap<String, Map<String, Long>> prefetchCompleted = new HashMap<>(); |
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.
Should use Map<String,Pair<String,Long>> prefetchCompleted
.
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.
Updated the code as per the suggestion. Replaced HashMap and ConcurrentHashMap to Map.
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.
How about using Pair<String,Long> as the map value? We don't really need a map as the value here. You can use org.apache.hadoop.hbase.util.Pair
here, I believe it would be clearer to understand the structure.
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.
Good catch Wellington, Thanks for pointing it out. Made the change in the updated patch.
@@ -53,7 +56,8 @@ public final class PrefetchExecutor { | |||
private static final Map<Path, Future<?>> prefetchFutures = new ConcurrentSkipListMap<>(); | |||
/** Set of files for which prefetch is completed */ | |||
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "MS_SHOULD_BE_FINAL") | |||
private static HashMap<String, Boolean> prefetchCompleted = new HashMap<>(); | |||
private static ConcurrentHashMap<String, Long> regionPrefetchSizeMap = new ConcurrentHashMap<>(); |
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.
OOP good practices: "Program to interfaces"Map<String, Long> regionPrefetchSizeMap = new ConcurrentHashMap<>();
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.
Done.
…mation along with the list of hfiles prefetched
…mation along with the list of hfiles prefetched
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
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.
LGTM, thanks!
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
The UT failures are falkey and unrelated to this PR changers. |
apache#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com>
#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com>
#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com>
#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com>
#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com>
apache#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com>
apache#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com> (cherry picked from commit 364fcea)
apache#5339) Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> Reviewew-by: Kota-SH <shanmukhaharipriya@gmail.com> (cherry picked from commit 364fcea)
…mation along with the list of hfiles prefetched