当前位置: 首页>>代码示例>>Java>>正文


Java UploadPartRequest.getPartNumber方法代码示例

本文整理汇总了Java中com.amazonaws.services.s3.model.UploadPartRequest.getPartNumber方法的典型用法代码示例。如果您正苦于以下问题:Java UploadPartRequest.getPartNumber方法的具体用法?Java UploadPartRequest.getPartNumber怎么用?Java UploadPartRequest.getPartNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.services.s3.model.UploadPartRequest的用法示例。


在下文中一共展示了UploadPartRequest.getPartNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startWorker

import com.amazonaws.services.s3.model.UploadPartRequest; //导入方法依赖的package包/类
protected void startWorker(UploadPartRequest req, int retries) {
    int id = req.getPartNumber();

    CompletableFuture<Void> f = CompletableFuture
            .supplyAsync(() -> s3.uploadPart(req), executor)
            .handle((res, error) -> {
                workers.remove(id);
                if (res != null) {
                    done.add(res);
                }
                if (error != null && isOpen()) {
                    if (retries < failedPartUploadRetries) {
                        startWorker(req, retries + 1);
                    } else {
                        this.error = new IllegalStateException("Could not upload part " + id + " after "
                                + retries + " retries. Aborting upload", error.getCause());
                        cancel();
                    }
                }
                return null;
            });

    workers.put(id, f);
}
 
开发者ID:mentegy,项目名称:s3-channels,代码行数:25,代码来源:S3AppendableObjectChannel.java


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