class StoreProcessorTask extends ConsistencyCheckerTask {

    @Override
    @SuppressWarnings( "unchecked" )
    public void run()
    {
        statistics.reset();
        beforeProcessing( processor );
        try
        {
            if ( processor.getStage().getCacheSlotSizes().length > 0 )
            {
                cacheAccess.setCacheSlotSizes( processor.getStage().getCacheSlotSizes() );
            }
            cacheAccess.setForward( processor.getStage().isForward() );

            if ( processor.getStage().isParallel() )
            {
                long highId;
                if ( processor.getStage() == CheckStage.Stage1_NS_PropsLabels )
                {
                    highId = storeAccess.getNodeStore().getHighId();
                }
                else if ( processor.getStage() == CheckStage.Stage8_PS_Props )
                {
                    highId = storeAccess.getPropertyStore().getHighId();
                }
                else
                {
                    highId = storeAccess.getNodeStore().getHighId();
                }
                long recordsPerCPU = RecordDistributor.calculateRecordsPerCpu( highId, numberOfThreads );
                QueueDistributor<R> distributor = distribution.distributor( recordsPerCPU, numberOfThreads );
                processor.applyFilteredParallel( store, progressListener, numberOfThreads, recordsPerCPU, distributor );
            }
            else
            {
                processor.applyFiltered( store, progressListener );
            }
            cacheAccess.setForward( true );
        }
        catch ( Throwable e )
        {
            progressListener.failed( e );
            throw new RuntimeException( e );
        }
        finally
        {
            afterProcessing( processor );
        }
        statistics.print( name );
    }

      StoreProcessorTask( String name, Statistics statistics, int threads, RecordStore<R> store, StoreAccess storeAccess,
            String builderPrefix, ProgressMonitorFactory.MultiPartBuilder builder, CacheAccess cacheAccess,
            StoreProcessor processor, QueueDistribution distribution );

}