SOLR-8995: Replace anonymous implementations of SAM interfaces with Lambdas

This commit is contained in:
Noble Paul 2016-04-15 19:03:22 +05:30
parent a07a8499d3
commit 09f92b7edf
1 changed files with 14 additions and 17 deletions

View File

@ -1822,25 +1822,22 @@ public final class SolrCore implements SolrInfoMBean, Closeable {
final RefCounted<SolrIndexSearcher> currSearcherHolderF = currSearcherHolder; final RefCounted<SolrIndexSearcher> currSearcherHolderF = currSearcherHolder;
if (!alreadyRegistered) { if (!alreadyRegistered) {
future = searcherExecutor.submit( future = searcherExecutor.submit(
new Callable() { () -> {
@Override try {
public Object call() throws Exception { // registerSearcher will decrement onDeckSearchers and
try { // do a notify, even if it fails.
// registerSearcher will decrement onDeckSearchers and registerSearcher(newSearchHolder);
// do a notify, even if it fails. } catch (Throwable e) {
registerSearcher(newSearchHolder); SolrException.log(log, e);
} catch (Throwable e) { if (e instanceof Error) {
SolrException.log(log, e); throw (Error) e;
if (e instanceof Error) {
throw (Error) e;
}
} finally {
// we are all done with the old searcher we used
// for warming...
if (currSearcherHolderF!=null) currSearcherHolderF.decref();
} }
return null; } finally {
// we are all done with the old searcher we used
// for warming...
if (currSearcherHolderF!=null) currSearcherHolderF.decref();
} }
return null;
} }
); );
} }