IndexerRequestBufferHandler { public void bufferRequest( IndexerRequest indexerRequest, IndexerRequestBuffer indexerRequestBuffer) throws Exception { if (!BufferOverflowThreadLocal.isOverflowMode()) { int maxBufferSize = _indexerRegistryConfiguration.maxBufferSize(); indexerRequestBuffer.add( indexerRequest, _indexerRequestBufferOverflowHandler, maxBufferSize); } else { indexerRequest.execute(); } } IndexerRequestBufferHandler(
		IndexerRequestBufferOverflowHandler indexerRequestBufferOverflowHandler,
		IndexerRegistryConfiguration indexerRegistryConfiguration); void bufferRequest(
			IndexerRequest indexerRequest,
			IndexerRequestBuffer indexerRequestBuffer);  }
@Test public void testDeepReindexMustNotOverflow() throws Exception { int maxBufferSize = 5; _indexerRequestBufferHandler = new IndexerRequestBufferHandler( createIndexerRequestBufferOverflowHandler(), createIndexerRegistryConfiguration(maxBufferSize)); _indexerRequestBuffer = IndexerRequestBuffer.create(); Indexer<?> indexer = createIndexerWithDeepReindex(); List<IndexerRequest> indexerRequests = createIndexerRequests( indexer, maxBufferSize + 3); for (IndexerRequest indexerRequest : indexerRequests) { _indexerRequestBufferHandler.bufferRequest( indexerRequest, _indexerRequestBuffer); } }