-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29626: Refactor server side scan metrics for Coproc hooks #7340
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-29626: Refactor server side scan metrics for Coproc hooks #7340
Conversation
…orrect and cleaner consumption in Coproc hooks
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Left minor comments, looks good overall
} | ||
|
||
@Override | ||
public long getFsReadTime() { |
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.
Let's remove getFsReadTime()
entirely? It's of no use anyways right?
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.
Actually I wanted remove these from RpcCall
interface but I saw that RpcCall
is marked LimitedPrivate with visibility to Phoenix and Coprocs in general while ServerCall
its HBase implementation is marked Private
.
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 this is recently introduced, we can remove it for IA.LP
boolean isScanMetricsEnabled = scan.isScanMetricsEnabled(); | ||
ThreadLocalServerSideScanMetrics.setScanMetricsEnabled(isScanMetricsEnabled); | ||
if (isScanMetricsEnabled) { | ||
this.scannerInitMetrics = new ServerSideScanMetrics(); | ||
ThreadLocalServerSideScanMetrics.reset(); | ||
} |
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 am bit confused, do we really not need this at all?
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.
The removed code in RegionScannerImpl was doing two things:
- Capturing server side scan metrics even when RegionScanner is initialized and passing it to the
next()
call inRegionScannerImpl
to updateServerSideScanMetrics
fromScannerContext
. - Resetting the state of thread local variable to start fresh for a scan.
For the first point given the call to RegionScannerImpl
constructor and next()
happens from same thread and its the same thread which is handling RSRpcServices#scan()
call so, we can avoid passing around ServerSideScanMetrics
from constructor to next()
call if we populate ServerSideScanMetrics
in RSRpcServices
as done for some other scan metrics already.
For second point, I am taking care of resetting the thread local variables for each call in RSRpcServices#scan()
call and its much cleaner also.
So, we are still doing same thing in RSRpcServices
which we used to do in RegionScannerImpl
it's just that its more concise and cleaner now. Please let me know if I am missing something. Thanks
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.
+1, pending build results
This comment has been minimized.
This comment has been minimized.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Signed-off-by: Viraj Jasani <[email protected]>
JIRA: HBASE-29626