Removed exception handling in InternalIndexShard.docStats() & storeStats()

This is already caught at another level, see #4203
This commit is contained in:
Boaz Leskes 2013-12-18 11:08:30 +01:00
parent fffa6a21dc
commit b865047125
1 changed files with 10 additions and 14 deletions

View File

@ -85,6 +85,7 @@ import org.elasticsearch.search.suggest.completion.Completion090PostingsFormat;
import org.elasticsearch.search.suggest.completion.CompletionStats; import org.elasticsearch.search.suggest.completion.CompletionStats;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import java.io.IOException;
import java.io.PrintStream; import java.io.PrintStream;
import java.nio.channels.ClosedByInterruptException; import java.nio.channels.ClosedByInterruptException;
import java.util.concurrent.ScheduledFuture; import java.util.concurrent.ScheduledFuture;
@ -349,6 +350,7 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
/** /**
* Changes the state of the current shard * Changes the state of the current shard
*
* @param newState the new shard state * @param newState the new shard state
* @param reason the reason for the state change * @param reason the reason for the state change
* @return the previous shard state * @return the previous shard state
@ -487,17 +489,12 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
@Override @Override
public DocsStats docStats() { public DocsStats docStats() {
try {
final Engine.Searcher searcher = acquireSearcher("doc_stats"); final Engine.Searcher searcher = acquireSearcher("doc_stats");
try { try {
return new DocsStats(searcher.reader().numDocs(), searcher.reader().numDeletedDocs()); return new DocsStats(searcher.reader().numDocs(), searcher.reader().numDeletedDocs());
} finally { } finally {
searcher.release(); searcher.release();
} }
} catch (Throwable e) {
logger.debug("Can not build 'doc stats' from engine shard state [{}]", e, state);
return new DocsStats();
}
} }
@Override @Override
@ -519,9 +516,8 @@ public class InternalIndexShard extends AbstractIndexShardComponent implements I
public StoreStats storeStats() { public StoreStats storeStats() {
try { try {
return store.stats(); return store.stats();
} catch (Throwable e) { } catch (IOException e) {
logger.debug("Can not build 'store stats' from engine shard state [{}]", e, state); throw new ElasticSearchException("io exception while building 'store stats'", e);
return new StoreStats();
} }
} }