Fix some type checks that were always false (#27706)
* CustomFieldQuery: removed a redundant type check that was already done higher up in the same if/else chain. * PrioritizedEsThreadPoolExecutor: removed a check that was simply a duplicate of one earlier one and would never have been true.
This commit is contained in:
parent
87313e12ba
commit
85dd1880fc
|
@ -75,9 +75,6 @@ public class CustomFieldQuery extends FieldQuery {
|
||||||
} else if (sourceQuery instanceof BlendedTermQuery) {
|
} else if (sourceQuery instanceof BlendedTermQuery) {
|
||||||
final BlendedTermQuery blendedTermQuery = (BlendedTermQuery) sourceQuery;
|
final BlendedTermQuery blendedTermQuery = (BlendedTermQuery) sourceQuery;
|
||||||
flatten(blendedTermQuery.rewrite(reader), reader, flatQueries, boost);
|
flatten(blendedTermQuery.rewrite(reader), reader, flatQueries, boost);
|
||||||
} else if (sourceQuery instanceof ESToParentBlockJoinQuery) {
|
|
||||||
ESToParentBlockJoinQuery blockJoinQuery = (ESToParentBlockJoinQuery) sourceQuery;
|
|
||||||
flatten(blockJoinQuery.getChildQuery(), reader, flatQueries, boost);
|
|
||||||
} else if (sourceQuery instanceof BoostingQuery) {
|
} else if (sourceQuery instanceof BoostingQuery) {
|
||||||
BoostingQuery boostingQuery = (BoostingQuery) sourceQuery;
|
BoostingQuery boostingQuery = (BoostingQuery) sourceQuery;
|
||||||
//flatten positive query with query boost
|
//flatten positive query with query boost
|
||||||
|
|
|
@ -137,7 +137,7 @@ public class PrioritizedEsThreadPoolExecutor extends EsThreadPoolExecutor {
|
||||||
@Override
|
@Override
|
||||||
protected Runnable wrapRunnable(Runnable command) {
|
protected Runnable wrapRunnable(Runnable command) {
|
||||||
if (command instanceof PrioritizedRunnable) {
|
if (command instanceof PrioritizedRunnable) {
|
||||||
if ((command instanceof TieBreakingPrioritizedRunnable)) {
|
if (command instanceof TieBreakingPrioritizedRunnable) {
|
||||||
return command;
|
return command;
|
||||||
}
|
}
|
||||||
Priority priority = ((PrioritizedRunnable) command).priority();
|
Priority priority = ((PrioritizedRunnable) command).priority();
|
||||||
|
@ -145,9 +145,6 @@ public class PrioritizedEsThreadPoolExecutor extends EsThreadPoolExecutor {
|
||||||
} else if (command instanceof PrioritizedFutureTask) {
|
} else if (command instanceof PrioritizedFutureTask) {
|
||||||
return command;
|
return command;
|
||||||
} else { // it might be a callable wrapper...
|
} else { // it might be a callable wrapper...
|
||||||
if (command instanceof TieBreakingPrioritizedRunnable) {
|
|
||||||
return command;
|
|
||||||
}
|
|
||||||
return new TieBreakingPrioritizedRunnable(super.wrapRunnable(command), Priority.NORMAL, insertionOrder.incrementAndGet());
|
return new TieBreakingPrioritizedRunnable(super.wrapRunnable(command), Priority.NORMAL, insertionOrder.incrementAndGet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue