-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 分块上传优化 #2813 #2816
base: master
Are you sure you want to change the base?
feat: 分块上传优化 #2813 #2816
Conversation
...neric/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/controller/GenericController.kt
Outdated
Show resolved
Hide resolved
.../common/common-mongo/src/main/kotlin/com/tencent/bkrepo/common/mongo/dao/AbstractMongoDao.kt
Outdated
Show resolved
Hide resolved
...main/kotlin/com/tencent/bkrepo/common/artifact/repository/core/AbstractArtifactRepository.kt
Outdated
Show resolved
Hide resolved
...ain/kotlin/com/tencent/bkrepo/common/metadata/service/blocknode/impl/BlockNodeServiceImpl.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...ackend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/model/NodeAttribute.kt
Outdated
Show resolved
Hide resolved
...ce/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/node/impl/NodeDeleteSupport.kt
Outdated
Show resolved
Hide resolved
...ata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/dao/blocknode/BlockNodeDao.kt
Outdated
Show resolved
Hide resolved
...ice/src/main/kotlin/com/tencent/bkrepo/common/artifact/repository/core/ArtifactRepository.kt
Outdated
Show resolved
Hide resolved
...ce/src/main/kotlin/com/tencent/bkrepo/common/metadata/service/node/impl/NodeDeleteSupport.kt
Outdated
Show resolved
Hide resolved
...metadata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/util/NodeDeleteHelper.kt
Outdated
Show resolved
Hide resolved
...biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/controller/SeparateBlockController.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/controller/SeparateBlockController.kt
Show resolved
Hide resolved
...biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/controller/SeparateBlockController.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/controller/SeparateBlockController.kt
Outdated
Show resolved
Hide resolved
...ain/kotlin/com/tencent/bkrepo/common/metadata/service/blocknode/impl/BlockNodeServiceImpl.kt
Outdated
Show resolved
Hide resolved
...ic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/artifact/GenericLocalRepository.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...ata-service/src/main/kotlin/com/tencent/bkrepo/common/metadata/dao/blocknode/BlockNodeDao.kt
Outdated
Show resolved
Hide resolved
...biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/controller/SeparateBlockController.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...ic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/artifact/GenericLocalRepository.kt
Outdated
Show resolved
Hide resolved
...ic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/artifact/GenericLocalRepository.kt
Outdated
Show resolved
Hide resolved
...ic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/artifact/GenericLocalRepository.kt
Outdated
Show resolved
Hide resolved
...ic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/artifact/GenericLocalRepository.kt
Outdated
Show resolved
Hide resolved
...ain/kotlin/com/tencent/bkrepo/common/metadata/service/blocknode/impl/BlockNodeServiceImpl.kt
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Show resolved
Hide resolved
...etadata/metadata-api/src/main/kotlin/com/tencent/bkrepo/common/metadata/constant/Constant.kt
Show resolved
Hide resolved
...main/kotlin/com/tencent/bkrepo/common/artifact/repository/core/AbstractArtifactRepository.kt
Outdated
Show resolved
Hide resolved
...ain/kotlin/com/tencent/bkrepo/common/metadata/service/blocknode/impl/BlockNodeServiceImpl.kt
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...end/generic/api-generic/src/main/kotlin/com/tencent/bkrepo/generic/pojo/SeparateBlockInfo.kt
Outdated
Show resolved
Hide resolved
...ic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/artifact/GenericLocalRepository.kt
Outdated
Show resolved
Hide resolved
...ic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/artifact/GenericLocalRepository.kt
Outdated
Show resolved
Hide resolved
...ain/kotlin/com/tencent/bkrepo/common/metadata/service/blocknode/impl/BlockNodeServiceImpl.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Outdated
Show resolved
Hide resolved
...kend/generic/biz-generic/src/main/kotlin/com/tencent/bkrepo/generic/service/UploadService.kt
Show resolved
Hide resolved
/** | ||
* 删除旧分块,即删除非指定的nodeCurrentSha256的分块。 | ||
* 如果未指定nodeCurrentSha256,则删除节点所有分块 | ||
* 如果指定uploadId,则删除该uploadId对应的分块,未指定则删除所有分块 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
未指定时指挥删除uploadId
为null的分块,而不是所有分块
if (deletedNum == 0L) return NodeDeleteResult(0L, 0L, deleteTime) | ||
|
||
// 计算删除的文件大小 | ||
val deletedSize = nodeBaseService.aggregateComputeSize(criteria.apply { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不需要计算删除的文件大小
@@ -137,7 +145,9 @@ class GenericLocalRepository( | |||
private val replicaTaskClient: ReplicaTaskClient, | |||
private val clusterNodeClient: ClusterNodeClient, | |||
private val pipelineNodeService: PipelineNodeService, | |||
private val ciPermissionManager: CIPermissionManager | |||
private val ciPermissionManager: CIPermissionManager, | |||
private val blockNodeServiceImpl: BlockNodeServiceImpl, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里要依赖接口
val sha256 = getArtifactSha256() | ||
|
||
val offset = context.request.getHeader(HEADER_OFFSET)?.toLongOrNull() | ||
val expires = storageProperties.filesystem.cache.expireDuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取错配置了
|
||
val node = nodeService.getNodeDetail(this) | ||
|
||
val expires = getLongHeader(HEADER_EXPIRES).takeIf { it > 0 } ?: TRANSACTION_EXPIRES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不需要支持用户配置,支持服务内配置限制最大过期时间即可
) | ||
|
||
// 获取节点信息并验证节点是否存在 | ||
val node = ArtifactContextHolder.getNodeDetail(artifactInfo) ?: run { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处为什么要验证节点是否存在
No description provided.