• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Blob.BlobContinuationToken类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Blob.BlobContinuationToken的典型用法代码示例。如果您正苦于以下问题:C# BlobContinuationToken类的具体用法?C# BlobContinuationToken怎么用?C# BlobContinuationToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BlobContinuationToken类属于Microsoft.WindowsAzure.Storage.Blob命名空间,在下文中一共展示了BlobContinuationToken类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ListBlobsSegmented

 public BlobResultSegment ListBlobsSegmented(string prefix, bool useFlatListing, BlobListingDetails blobListingDetails,
     int? maxResults, BlobContinuationToken continuationToken, BlobRequestOptions blobRequestOptions,
     OperationContext operationContext)
 {
     return _client.ListBlobsSegmented(prefix, useFlatListing, blobListingDetails, maxResults, continuationToken,
         blobRequestOptions, operationContext);
 }
开发者ID:NurimOnsemiro,项目名称:reef,代码行数:7,代码来源:AzureCloudBlobClient.cs


示例2: GetNextHeartbeats

        private BlobResultSegment GetNextHeartbeats(CloudBlobDirectory directory, BlobContinuationToken currentToken)
        {
            const int batchSize = 100;

            try
            {
                return directory.ListBlobsSegmented(useFlatBlobListing: true,
                    blobListingDetails: BlobListingDetails.None,
                    maxResults: batchSize,
                    currentToken: currentToken,
                    options: null,
                    operationContext: null);
            }
            catch (StorageException exception)
            {
                if (exception.IsNotFound())
                {
                    return null;
                }
                else
                {
                    throw;
                }
            }
        }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:25,代码来源:HeartbeatMonitor.cs


示例3: ListContainersSegmented

 private Task<ContainerResultSegment> ListContainersSegmented(string prefix, ContainerListingDetails detailsIncluded, int? maxResults, BlobContinuationToken continuationToken, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken = default(CancellationToken))
 {
     return AsyncTaskUtil.RunAsyncCancellable<ContainerResultSegment>(
         _inner.BeginListContainersSegmented(prefix, detailsIncluded, maxResults, continuationToken, options, operationContext, null, null),
         _inner.EndListContainersSegmented,
         cancellationToken);
 }
开发者ID:Porges,项目名称:azure-storage-async,代码行数:7,代码来源:AsyncCloudBlobClient.cs


示例4: ListBlobsSegmentedAsync

        public static IAzureBlobResultSegment ListBlobsSegmentedAsync(
            string containerDirectory,
            string searchDirectory,
            string prefix,
            BlobListing blobListing,
            BlobListingDetails blobListingDetails,
            int? maxResults,
            BlobContinuationToken currentToken)
        {
            if (blobListing == BlobListing.Hierarchical && (blobListingDetails & BlobListingDetails.Snapshots) == BlobListingDetails.Snapshots)
            {
                throw new ArgumentException("Listing snapshots is only supported in flat mode.");
            }

            var numberToSkip = DetermineNumberToSkip(currentToken);

            var resultSegment = blobListing == BlobListing.Flat
                ? FindFilesFlattened(containerDirectory, searchDirectory, prefix, maxResults, numberToSkip)
                : FindFilesHierarchical(containerDirectory, searchDirectory, prefix, maxResults, numberToSkip);

            if ((blobListingDetails & BlobListingDetails.Metadata) == BlobListingDetails.Metadata)
            {
                foreach (var blob in resultSegment.Results.OfType<StandaloneAzureBlockBlob>())
                {
                    blob.FetchAttributes();
                }
            }

            return resultSegment;
        }
开发者ID:johndalin,项目名称:LightBlue,代码行数:30,代码来源:StandaloneList.cs


示例5: ListBlobsImplAsync

        /// <summary>
        ///     Returns an enumerable collection of the blobs in the container that are retrieved asynchronously.
        /// </summary>
        /// <param name="blobDirectory">Cloud blob directory.</param>
        /// <param name="cloudBlobs">List of cloud blobs.</param>
        /// <param name="useFlatBlobListing">Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.</param>
        /// <param name="blobListingDetails">
        ///     A <see cref="T:Microsoft.WindowsAzure.Storage.Blob.BlobListingDetails" /> enumeration describing which items to include in the listing.
        /// </param>
        /// <param name="maxResults">
        ///     A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
        ///     per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
        /// </param>
        /// <param name="continuationToken">Continuation token.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>
        ///     An enumerable collection of objects that implement <see cref="T:Microsoft.WindowsAzure.Storage.Blob.IListBlobItem" /> that are retrieved.
        /// </returns>
        private static Task<List<IListBlobItem>> ListBlobsImplAsync(
            this CloudBlobDirectory blobDirectory,
            List<IListBlobItem> cloudBlobs,
            bool useFlatBlobListing,
            BlobListingDetails blobListingDetails,
            int? maxResults,
            BlobContinuationToken continuationToken,
            CancellationToken cancellationToken = default (CancellationToken))
        {
            return blobDirectory
                .ListBlobsSegmentedAsync(useFlatBlobListing, blobListingDetails, maxResults, continuationToken, cancellationToken)
                .Then(result =>
                    {
                        cancellationToken.ThrowIfCancellationRequested();

                        cloudBlobs.AddRange(result.Results);

                        // Checks whether maxresults entities has been received
                        if (maxResults.HasValue && cloudBlobs.Count >= maxResults.Value)
                        {
                            return TaskHelpers.FromResult(cloudBlobs.Take(maxResults.Value).ToList());
                        }

                        // Checks whether enumeration has been completed
                        if (result.ContinuationToken != null)
                        {
                            return ListBlobsImplAsync(blobDirectory, cloudBlobs, useFlatBlobListing, blobListingDetails, maxResults, continuationToken, cancellationToken);
                        }

                        return TaskHelpers.FromResult(cloudBlobs);
                    });
        }
开发者ID:jorik041,项目名称:WindowsAzure,代码行数:50,代码来源:CloudBlobDirectoryExtensions.cs


示例6: ListBlobsSegmented

 private Task<BlobResultSegment> ListBlobsSegmented(string prefix, bool useFlatBlobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken continuationToken, BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken = default(CancellationToken))
 {
     return AsyncTaskUtil.RunAsyncCancellable<BlobResultSegment>(
         _inner.BeginListBlobsSegmented(prefix, useFlatBlobListing, blobListingDetails, maxResults, continuationToken, options, operationContext, null, null),
         _inner.EndListBlobsSegmented,
         cancellationToken);
 }
开发者ID:Porges,项目名称:azure-storage-async,代码行数:7,代码来源:AsyncCloudBlobClient.cs


示例7: ListBlobsSegmentedAsync

 /// <inheritdoc />
 public Task<IStorageBlobResultSegment> ListBlobsSegmentedAsync(string prefix, bool useFlatBlobListing,
     BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken,
     BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
 {
     Task<BlobResultSegment> sdkTask = _sdk.ListBlobsSegmentedAsync(prefix, useFlatBlobListing,
         blobListingDetails, maxResults, currentToken, options, operationContext, cancellationToken);
     return ListBlobsSegmentedAsyncCore(sdkTask);
 }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:9,代码来源:StorageBlobClient.cs


示例8: ListBlobsSegmentedAsync

 public async Task<IAzureBlobResultSegment> ListBlobsSegmentedAsync(BlobListing blobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken)
 {
     return new HostedAzureBlobResultSegment(await _cloudBlobDirectory.ListBlobsSegmentedAsync(
         blobListing == BlobListing.Flat,
         blobListingDetails,
         maxResults,
         currentToken,
         null,
         null));
 }
开发者ID:johndalin,项目名称:LightBlue,代码行数:10,代码来源:HostedAzureBlobDirectory.cs


示例9: DetermineNumberToSkip

        private static int DetermineNumberToSkip(BlobContinuationToken currentToken)
        {
            if (currentToken == null)
            {
                return 0;
            }

            int numberToSkip;
            return Int32.TryParse(currentToken.NextMarker, out numberToSkip) ? numberToSkip : 0;
        }
开发者ID:johndalin,项目名称:LightBlue,代码行数:10,代码来源:StandaloneList.cs


示例10: ListBlobsSegmentedAsync

 public Task<IAzureBlobResultSegment> ListBlobsSegmentedAsync(BlobListing blobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken)
 {
     return Task.FromResult(StandaloneList.ListBlobsSegmentedAsync(
         _containerDirectory,
         _directoryPath,
         "",
         blobListing,
         blobListingDetails,
         maxResults,
         currentToken));
 }
开发者ID:johndalin,项目名称:LightBlue,代码行数:11,代码来源:StandaloneAzureBlobDirectory.cs


示例11: StandaloneAzureBlobResultSegment

 public StandaloneAzureBlobResultSegment(IEnumerable<IAzureListBlobItem> results, BlobContinuationToken continuationToken)
 {
     if (results == null)
     {
         throw new ArgumentNullException("results");
     }
     if (continuationToken == null)
     {
         throw new ArgumentNullException("continuationToken");
     }
     Results = results;
     ContinuationToken = continuationToken;
 }
开发者ID:jamesmiles,项目名称:LightBlue,代码行数:13,代码来源:StandaloneAzureBlobResultSegment.cs


示例12: ListBlobsSegmentedAsync

        public Task<IAzureBlobResultSegment> ListBlobsSegmentedAsync(string prefix, BlobListing blobListing, BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken)
        {
            if (blobListing == BlobListing.Hierarchical && (blobListingDetails & BlobListingDetails.Snapshots) == BlobListingDetails.Snapshots)
            {
                throw new ArgumentException("Listing snapshots is only supported in flat mode.");
            }

            var numberToSkip = DetermineNumberToSkip(currentToken);

            var resultSegment = blobListing == BlobListing.Flat
                ? FindFilesFlattened(prefix, maxResults, numberToSkip)
                : FindFilesHierarchical(prefix, maxResults, numberToSkip);

            return Task.FromResult((IAzureBlobResultSegment) resultSegment);
        }
开发者ID:jamesmiles,项目名称:LightBlue,代码行数:15,代码来源:StandaloneAzureBlobContainer.cs


示例13: Serialize

        public static string Serialize(BlobContinuationToken token)
        {
            if (token == null)
            {
                return null;
            }

            // Include TargetLocation in serialized form to ensure consistent results for RA-GRS accounts. (Without it,
            // each request could see different sides of eventually consisent replication).
            // See: http://blogs.msdn.com/b/windowsazurestorage/archive/2013/12/04/ (ignore source line break)
            // introducing-read-access-geo-replicated-storage-ra-grs-for-windows-azure-storage.aspx

            // Prefix the NextMarker with a single character indicating TargetLocation.
            return Serialize(token.TargetLocation) + token.NextMarker;
        }
开发者ID:rafaelmtz,项目名称:azure-webjobs-sdk,代码行数:15,代码来源:BlobContinuationTokenSerializer.cs


示例14: ListContainers

        public IObservable<AsyncCloudBlobContainer> ListContainers(string prefix, ContainerListingDetails detailsIncluded, int? maxResults, BlobRequestOptions options, OperationContext operationContext)
        {
            return Observable.Create<AsyncCloudBlobContainer>(
            async (observer, ct) =>
            {
                var containerToken = new BlobContinuationToken();
                while (containerToken != null)
                {
                    var results = await ListContainersSegmented(prefix, detailsIncluded, maxResults, containerToken, options, operationContext, ct);
                    foreach (var result in results.Results)
                    {
                        observer.OnNext(new AsyncCloudBlobContainer(result));
                    }

                    containerToken = results.ContinuationToken;
                }
            });
        }
开发者ID:Porges,项目名称:azure-storage-async,代码行数:18,代码来源:AsyncCloudBlobClient.cs


示例15: ListBlobs

        public IObservable<IAsyncListBlobItem> ListBlobs(string prefix, bool useFlatBlobListing, BlobListingDetails blobListingDetails = BlobListingDetails.None, int? maxResults = null, BlobRequestOptions options = null, OperationContext operationContext = null)
        {
            return Observable.Create<IAsyncListBlobItem>(
            async (observer, ct) =>
            {
                var containerToken = new BlobContinuationToken();
                while (containerToken != null)
                {
                    var results = await ListBlobsSegmented(prefix, useFlatBlobListing, blobListingDetails, maxResults, containerToken, options, operationContext, ct);
                    foreach (var result in results.Results)
                    {
                        observer.OnNext(AsyncListBlobItemHelpers.FromIListBlobItem(result));
                    }

                    containerToken = results.ContinuationToken;
                }
            });
        }
开发者ID:Porges,项目名称:azure-storage-async,代码行数:18,代码来源:AsyncCloudBlobContainer.cs


示例16: ListBlobsSegmentedAsync

        /// <summary>
        ///     Returns a result segment containing a collection of blob items in the container asynchronously.
        /// </summary>
        /// <param name="blobDirectory">Cloud blob directory.</param>
        /// <param name="useFlatBlobListing">Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.</param>
        /// <param name="blobListingDetails">
        ///     A <see cref="T:Microsoft.WindowsAzure.Storage.Blob.BlobListingDetails" /> enumeration describing which items to include in the listing.
        /// </param>
        /// <param name="maxResults">
        ///     A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
        ///     per-operation limit of 5000. If this value is <c>null</c>, the maximum possible number of results will be returned, up to 5000.
        /// </param>
        /// <param name="continuationToken">A continuation token returned by a previous listing operation.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>
        ///     The ID of the acquired lease.
        /// </returns>
        public static Task<BlobResultSegment> ListBlobsSegmentedAsync(
            this CloudBlobDirectory blobDirectory,
            bool useFlatBlobListing,
            BlobListingDetails blobListingDetails,
            int? maxResults,
            BlobContinuationToken continuationToken,
            CancellationToken cancellationToken = default (CancellationToken))
        {
            ICancellableAsyncResult asyncResult = blobDirectory.BeginListBlobsSegmented(useFlatBlobListing, blobListingDetails, maxResults, continuationToken, null, null, null, null);
            CancellationTokenRegistration registration = cancellationToken.Register(p => asyncResult.Cancel(), null);

            return Task<BlobResultSegment>.Factory.FromAsync(
                asyncResult,
                result =>
                    {
                        registration.Dispose();
                        return blobDirectory.EndListBlobsSegmented(result);
                    });
        }
开发者ID:jorik041,项目名称:WindowsAzure,代码行数:36,代码来源:CloudBlobDirectoryExtensions.cs


示例17: ListBlobsSegmentedAsync

        public Task<IStorageBlobResultSegment> ListBlobsSegmentedAsync(string prefix, bool useFlatBlobListing,
            BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken,
            BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
        {
            if (options != null)
            {
                throw new NotImplementedException();
            }

            if (operationContext != null)
            {
                throw new NotImplementedException();
            }

            Func<string, IStorageBlobContainer> containerFactory = (n) => new FakeStorageBlobContainer(_store, n, this);
            IStorageBlobResultSegment segment = _store.ListBlobsSegmented(containerFactory, prefix, useFlatBlobListing,
                blobListingDetails, maxResults, currentToken);
            return Task.FromResult(segment);
        }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:19,代码来源:FakeStorageBlobClient.cs


示例18: ListBlobsSegmented

        public IStorageBlobResultSegment ListBlobsSegmented(Func<string, IStorageBlobContainer> containerFactory,
            string prefix, bool useFlatBlobListing, BlobListingDetails blobListingDetails, int? maxResults,
            BlobContinuationToken currentToken)
        {
            if (prefix == null)
            {
                throw new ArgumentNullException("prefix");
            }

            if (!useFlatBlobListing)
            {
                throw new NotImplementedException();
            }

            if (maxResults.HasValue)
            {
                throw new NotImplementedException();
            }

            if (blobListingDetails != BlobListingDetails.None && blobListingDetails != BlobListingDetails.Metadata)
            {
                throw new NotImplementedException();
            }

            if (prefix.StartsWith("$logs/"))
            {
                return null;
            }

            if (prefix.Contains("/"))
            {
                throw new NotImplementedException();
            }

            if (!_items.ContainsKey(prefix))
            {
                return null;
            }

            IStorageBlobContainer parent = containerFactory.Invoke(prefix);
            IEnumerable<IStorageBlob> results = _items[prefix].ListBlobs(this, parent, blobListingDetails);
            return new StorageBlobResultSegment(null, results);
        }
开发者ID:rafaelmtz,项目名称:azure-webjobs-sdk,代码行数:43,代码来源:MemoryBlobStore.cs


示例19: ListBlobsSegmentedAsync

        public Task<IStorageBlobResultSegment> ListBlobsSegmentedAsync(string prefix, bool useFlatBlobListing,
            BlobListingDetails blobListingDetails, int? maxResults, BlobContinuationToken currentToken,
            BlobRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken)
        {
            if (options != null)
            {
                throw new NotImplementedException();
            }

            if (operationContext != null)
            {
                throw new NotImplementedException();
            }

            string fullPrefix;

            if (!String.IsNullOrEmpty(prefix))
            {
                fullPrefix = _containerName + "/" + prefix;
            }
            else
            {
                fullPrefix = _containerName;
            }

            Func<string, IStorageBlobContainer> containerFactory = (name) =>
            {
                if (name != _containerName)
                {
                    throw new InvalidOperationException();
                }

                return this;
            };
            IStorageBlobResultSegment segment = _store.ListBlobsSegmented(containerFactory, fullPrefix,
                useFlatBlobListing, blobListingDetails, maxResults, currentToken);
            return Task.FromResult(segment);
        }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:38,代码来源:FakeStorageBlobContainer.cs


示例20: ListContainersImpl

        /// <summary>
        /// Core implementation for the ListContainers method.
        /// </summary>
        /// <param name="prefix">The container prefix.</param>
        /// <param name="detailsIncluded">The details included.</param>
        /// <param name="currentToken">The continuation token.</param>
        /// <param name="maxResults">A non-negative integer value that indicates the maximum number of results to be returned 
        /// in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.</param>
        /// <param name="options">A <see cref="BlobRequestOptions"/> object that specifies any additional options for the request.</param>
        /// <returns>A <see cref="ResultSegment{T}"/> that lists the containers.</returns>
        private RESTCommand<ResultSegment<CloudBlobContainer>> ListContainersImpl(string prefix, ContainerListingDetails detailsIncluded, BlobContinuationToken currentToken, int? maxResults, BlobRequestOptions options)
        {
            ListingContext listingContext = new ListingContext(prefix, maxResults)
            {
                Marker = currentToken != null ? currentToken.NextMarker : null
            };

            RESTCommand<ResultSegment<CloudBlobContainer>> getCmd = new RESTCommand<ResultSegment<CloudBlobContainer>>(this.Credentials, this.BaseUri);

            getCmd.ApplyRequestOptions(options);
            getCmd.RetrieveResponseStream = true;
            getCmd.BuildRequestDelegate = (uri, builder, serverTimeout, ctx) => ContainerHttpWebRequestFactory.List(uri, serverTimeout, listingContext, detailsIncluded, ctx);
            getCmd.SignRequest = this.AuthenticationHandler.SignRequest;
            getCmd.PreProcessResponse = (cmd, resp, ex, ctx) => HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, null /* retVal */, cmd, ex, ctx);
            getCmd.PostProcessResponse = (cmd, resp, ex, ctx) =>
            {
                ListContainersResponse listContainersResponse = new ListContainersResponse(cmd.ResponseStream);
                List<CloudBlobContainer> containersList = new List<CloudBlobContainer>(
                    listContainersResponse.Containers.Select(item => new CloudBlobContainer(item.Properties, item.Metadata, item.Name, this)));
                BlobContinuationToken continuationToken = null;
                if (listContainersResponse.NextMarker != null)
                {
                    continuationToken = new BlobContinuationToken()
                    {
                        NextMarker = listContainersResponse.NextMarker,
                    };
                }

                return new ResultSegment<CloudBlobContainer>(containersList)
                {
                    ContinuationToken = continuationToken,
                };
            };

            return getCmd;
        }
开发者ID:jdkillian,项目名称:azure-sdk-for-net,代码行数:46,代码来源:CloudBlobClient.cs



注:本文中的Microsoft.WindowsAzure.Storage.Blob.BlobContinuationToken类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Blob.BlobRequestOptions类代码示例发布时间:2022-05-26
下一篇:
C# Blob.BlobContainerPermissions类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap