Skip to content

Commit

Permalink
fix: 分块上传优化-问题修复 #2813
Browse files Browse the repository at this point in the history
  • Loading branch information
zzdjx committed Dec 3, 2024
1 parent 8642550 commit 5cbe04d
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ import com.tencent.bkrepo.common.storage.pojo.RegionResource
import com.tencent.bkrepo.repository.pojo.node.NodeDetail
import org.slf4j.LoggerFactory
import org.springframework.context.annotation.Conditional
import org.springframework.data.mongodb.core.query.*
import org.springframework.data.mongodb.core.query.Criteria
import org.springframework.data.mongodb.core.query.Query
import org.springframework.data.mongodb.core.query.Update
import org.springframework.data.mongodb.core.query.and
import org.springframework.data.mongodb.core.query.isEqualTo

import org.springframework.stereotype.Service
import java.time.LocalDateTime

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.tencent.bkrepo.generic.pojo

import io.swagger.annotations.ApiModel
import io.swagger.annotations.ApiModelProperty


@ApiModel("新分块信息")
data class NewBlockInfo(
@ApiModelProperty("分块大小")
val size: Long,
@ApiModelProperty("分块sha256")
val sha256: String,
@ApiModelProperty("分块起始位置")
val startPos: Long
)
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,20 @@ import com.tencent.bkrepo.common.service.util.ResponseBuilder
import com.tencent.bkrepo.common.storage.message.StorageErrorException
import com.tencent.bkrepo.common.storage.pojo.FileInfo
import com.tencent.bkrepo.generic.artifact.context.GenericArtifactSearchContext
import com.tencent.bkrepo.generic.constant.*
import com.tencent.bkrepo.generic.constant.BKREPO_META
import com.tencent.bkrepo.generic.constant.BKREPO_META_PREFIX
import com.tencent.bkrepo.generic.constant.CHUNKED_UPLOAD
import com.tencent.bkrepo.generic.constant.GenericMessageCode
import com.tencent.bkrepo.generic.constant.HEADER_MD5
import com.tencent.bkrepo.generic.constant.HEADER_SEQUENCE
import com.tencent.bkrepo.generic.constant.HEADER_SHA256
import com.tencent.bkrepo.generic.constant.HEADER_UPLOAD_ID
import com.tencent.bkrepo.generic.constant.HEADER_UPLOAD_TYPE
import com.tencent.bkrepo.generic.constant.HEADER_OFFSET
import com.tencent.bkrepo.generic.constant.HEADER_SIZE
import com.tencent.bkrepo.generic.constant.HEADER_OVERWRITE
import com.tencent.bkrepo.generic.constant.HEADER_BLOCK_APPEND
import com.tencent.bkrepo.generic.constant.HEADER_EXPIRES
import com.tencent.bkrepo.generic.pojo.ChunkedResponseProperty
import com.tencent.bkrepo.generic.util.ChunkedRequestUtil.uploadResponse
import com.tencent.bkrepo.replication.api.ClusterNodeClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ import com.tencent.bkrepo.generic.artifact.GenericArtifactInfo.Companion.BATCH_M
import com.tencent.bkrepo.generic.artifact.GenericArtifactInfo.Companion.BLOCK_MAPPING_URI
import com.tencent.bkrepo.generic.artifact.GenericArtifactInfo.Companion.GENERIC_MAPPING_URI
import com.tencent.bkrepo.generic.constant.HEADER_UPLOAD_ID
import com.tencent.bkrepo.generic.pojo.*
import com.tencent.bkrepo.generic.pojo.BatchDownloadPaths
import com.tencent.bkrepo.generic.pojo.BlockInfo
import com.tencent.bkrepo.generic.pojo.CompressedFileInfo
import com.tencent.bkrepo.generic.pojo.NewBlockInfo
import com.tencent.bkrepo.generic.pojo.UploadTransactionInfo

import com.tencent.bkrepo.generic.service.CompressedFileService
import com.tencent.bkrepo.generic.service.DownloadService
import com.tencent.bkrepo.generic.service.UploadService
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.tencent.bkrepo.generic.model

data class NodeAttribute(
// 用户id
val uid: String,
// 组id
val gid: String,
// 文件权限,八进制
val mode: Int? = DEFAULT_MODE,
// windows文件flag,十六进制
val flags: Int? = null,
// 设备文件设备号
val rdev: Int? = null,
// 文件类型
val type: Int? = null
) {
companion object {
const val DEFAULT_MODE = 644
const val NOBODY = "nobody"
}
}

0 comments on commit 5cbe04d

Please sign in to comment.