public ComposedRangeTranslator(
     IRangeTranslator <TFromContext, TBetweenContext> first,
     IRangeTranslator <TBetweenContext, TToContext> second)
 {
     this._first  = first;
     this._second = second;
 }
 public static IRangeTranslator <TFromContext, TToContext> ComposedWith <TFromContext, TBetweenContext, TToContext>(
     this IRangeTranslator <TFromContext, TBetweenContext> first,
     IRangeTranslator <TBetweenContext, TToContext> second)
     where TFromContext : IComparable <TFromContext>
     where TBetweenContext : IComparable <TBetweenContext>
     where TToContext : IComparable <TToContext>
 {
     return(new ComposedRangeTranslator <TFromContext, TBetweenContext, TToContext>(first, second));
 }
Beispiel #3
0
 public StreamTranslator(
     IRangeTranslator <TOuterContext, TInnerContext> rangeTranslator,
     IResourceStore <TInnerContext, Stream> streamStore,
     TOuterContext outerContext,
     long streamLength)
 {
     this._rangeTranslator = rangeTranslator;
     this._streamStore     = streamStore;
     this._outerContext    = outerContext;
     this._streamLength    = streamLength;
 }
Beispiel #4
0
        protected Job(
            string bucketName,
            Guid jobId,
            ITransferItemSource transferItemSource,
            ITransferrer transferrer,
            ILookup <Blob, Range> rangesForRequests,
            IRangeTranslator <Blob, TItem> rangeTranslator,
            IEnumerable <ContextRange <TItem> > itemsToTrack)
        {
            this.BucketName          = bucketName;
            this.JobId               = jobId;
            this._transferItemSource = transferItemSource;
            this._transferrer        = transferrer;
            this._rangesForRequests  = rangesForRequests;
            this._rangeTranslator    = rangeTranslator;

            this._itemTracker = new JobItemTracker <TItem>(itemsToTrack);
            this._itemTracker.DataTransferred += size => this.DataTransferred.Call(size);
            this._itemTracker.ItemCompleted   += item =>
            {
                this._resourceStore.Close(item);
                this.ItemCompleted.Call(item);
            };
        }