private IListBlockContext <TItem, THeader> CreateListBlockContext <TItem, THeader>(ListBlockRequest blockRequest, ProtoListBlock listBlock, int forcedBlockQueueId = 0) { var attempt = listBlock.Attempt + 1; var createRequest = new BlockExecutionCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName), blockRequest.TaskExecutionId, blockRequest.BlockType, listBlock.ListBlockId, attempt); var blockExecutionId = _blockRepository.AddListBlockExecution(createRequest); var listBlockOfT = Convert <TItem, THeader>(listBlock); var blockContext = new ListBlockContext <TItem, THeader>(_listBlockRepository, _taskExecutionRepository, blockRequest.ApplicationName, blockRequest.TaskName, blockRequest.TaskExecutionId, blockRequest.ListUpdateMode, blockRequest.UncommittedItemsThreshold, listBlockOfT, blockExecutionId, blockRequest.MaxStatusReasonLength, forcedBlockQueueId.ToString()); return(blockContext); }
private async Task <IListBlockContext <T> > CreateListBlockContextAsync <T>(ListBlockRequest blockRequest, ProtoListBlock listBlock, int forcedBlockQueueId = 0) { var attempt = listBlock.Attempt + 1; var createRequest = new BlockExecutionCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName), blockRequest.TaskExecutionId, BlockType.List, listBlock.ListBlockId, attempt); var blockExecutionId = await _blockRepository.AddListBlockExecutionAsync(createRequest).ConfigureAwait(false); var listBlockOfT = Convert <T>(listBlock); var blockContext = new ListBlockContext <T>(_listBlockRepository, _taskExecutionRepository, blockRequest.ApplicationName, blockRequest.TaskName, blockRequest.TaskExecutionId, blockRequest.ListUpdateMode, blockRequest.UncommittedItemsThreshold, listBlockOfT, blockExecutionId, blockRequest.MaxStatusReasonLength, forcedBlockQueueId.ToString()); return(blockContext); }
private IObjectBlockContext <T> CreateObjectBlockContext <T>(ObjectBlockRequest <T> blockRequest, ObjectBlock <T> objectBlock, int forcedBlockQueueId = 0) { var attempt = objectBlock.Attempt + 1; var createRequest = new BlockExecutionCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName), blockRequest.TaskExecutionId, blockRequest.BlockType, objectBlock.ObjectBlockId, attempt); var blockExecutionId = _blockRepository.AddObjectBlockExecution(createRequest); var blockContext = new ObjectBlockContext <T>(_objectBlockRepository, _taskExecutionRepository, blockRequest.ApplicationName, blockRequest.TaskName, blockRequest.TaskExecutionId, objectBlock, blockExecutionId, forcedBlockQueueId.ToString()); return(blockContext); }
private RangeBlockContext CreateBlockContext(BlockRequest blockRequest, RangeBlock rangeBlock, int forcedBlockQueueId = 0) { var attempt = rangeBlock.Attempt + 1; var createRequest = new BlockExecutionCreateRequest(new TaskId(blockRequest.ApplicationName, blockRequest.TaskName), blockRequest.TaskExecutionId, blockRequest.BlockType, rangeBlock.RangeBlockId, attempt); var blockExecutionId = _blockRepository.AddRangeBlockExecution(createRequest); var blockContext = new RangeBlockContext(_rangeBlockRepository, _taskExecutionRepository, blockRequest.ApplicationName, blockRequest.TaskName, blockRequest.TaskExecutionId, rangeBlock, blockExecutionId, forcedBlockQueueId.ToString()); return(blockContext); }