Added timeout checks to the low-level file access routines using a delegating IndexInput.
Following performance tests using the Lucene benchmark frameworks it became apparent that wrapping IndexReader using FilterAtomicReader etc was always going to be too costly even before we add any timeout checking logic. The costs of delegating many “nextDoc” and “nextTerm” calls via a wrapper adds to many extra method invocations. The low-level IndexInput class used by Directory is a better choice for adding timer checks as
a) It is a higher-granularity API i.e. has less calls as they typically involve a disk access
b) Is more robust from a maintenance point of view. IndexReader has a constantly evolving set of methods as new features are added which would need instrumenting by our timeout testing wrappers whereas IndexInput is comparatively more stable and deals with a small number of methods accessing generic structures like byte arrays.