Cleanup and added check to avoid cyclic flushing in MappedFlishPreProcessorImpl