Example #1
0
        public IJob StartReadJob(string bucket, IEnumerable <Ds3Object> objectsToRead)
        {
            var jobResponse = this._client.BulkGet(
                new BulkGetRequest(bucket, VerifyObjectCount(objectsToRead))
                .WithChunkOrdering(ChunkOrdering.None)
                );

            return(FullObjectJob.Create(
                       jobResponse,
                       new ReadTransferItemSource(this._client, jobResponse),
                       new ReadTransferrer()
                       ));
        }
Example #2
0
        public IJob RecoverWriteJob(Guid jobId)
        {
            var jobResponse = this._client.ModifyJob(new ModifyJobRequest(jobId));

            if (jobResponse.RequestType != JobTypePut)
            {
                throw new InvalidOperationException(Resources.ExpectedPutJobButWasGetJobException);
            }
            return(FullObjectJob.Create(
                       jobResponse,
                       new WriteTransferItemSource(this._client, jobResponse),
                       new WriteTransferrer()
                       ));
        }
Example #3
0
        public IJob StartWriteJob(string bucket, IEnumerable <Ds3Object> objectsToWrite, long?maxBlobSize = null)
        {
            var request = new BulkPutRequest(
                bucket,
                VerifyObjectCount(objectsToWrite)
                );

            if (maxBlobSize.HasValue)
            {
                request.WithMaxBlobSize(maxBlobSize.Value);
            }
            var jobResponse = this._client.BulkPut(request);

            return(FullObjectJob.Create(
                       jobResponse,
                       new WriteTransferItemSource(this._client, jobResponse),
                       new WriteTransferrer()
                       ));
        }