cryptoe commented on code in PR #12514:
URL: https://github.com/apache/druid/pull/12514#discussion_r872624211
##########
processing/src/main/java/org/apache/druid/query/spec/SpecificSegmentQueryRunner.java:
##########
@@ -64,18 +68,26 @@ public Sequence<T> run(final QueryPlus<T> input, final
ResponseContext responseC
)
);
- final Query<T> query = queryPlus.getQuery();
+ final boolean setName =
input.getQuery().getContextBoolean(CTX_SET_THREAD_NAME, true);
- final Thread currThread = Thread.currentThread();
- final String currThreadName = currThread.getName();
- final String newName = query.getType() + "_" + query.getDataSource() + "_"
+ query.getIntervals();
+ final Query<T> query = queryPlus.getQuery();
- final Sequence<T> baseSequence = doNamed(
- currThread,
- currThreadName,
- newName,
- () -> base.run(queryPlus, responseContext)
- );
+ final Thread currThread = setName ? Thread.currentThread() : null;
+ final String currThreadName = setName ? currThread.getName() : null;
Review Comment:
Super Nit: 75:77 we are checking the setName variable thrice.
We can easily move them inside the block which starts from line 81.
I think it makes the code easier to read as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]