Exemplo n.º 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()
                       ));
        }
Exemplo n.º 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()
                       ));
        }
Exemplo n.º 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()
                       ));
        }