Esempio n. 1
0
        private bool ProcessPartitionDeletedByHandler(
            string partition, CheckpointTag deletePosition, out string newState,
            out string projectionResult)
        {
            projectionResult = null;
            InitOrLoadHandlerState(partition);
            _stopwatch.Start();
            var result = _projectionStateHandler.ProcessPartitionDeleted(
                partition, deletePosition, out newState);

            if (result)
            {
                var oldState = _partitionStateCache.GetLockedPartitionState(partition);
                //TODO: depending on query processing final state to result transformation should happen either here (if EOF) on while writing results
                if (/*_producesRunningResults && */ oldState.State != newState)
                {
                    if (_definesStateTransform)
                    {
                        projectionResult = _projectionStateHandler.TransformStateToResult();
                    }
                    else
                    {
                        projectionResult = newState;
                    }
                }
                else
                {
                    projectionResult = oldState.Result;
                }
            }
            _stopwatch.Stop();
            return(result);
        }