Noobaa-core
2020-06-11 10:59:55 2 举报
noobaa-core
作者其他创作
大纲/内容
upload_object(params,object_sdk)
upload_blob_block(params,object_sdk)
---> GetMapping.run --> find_dups //从mongdb中 查找是否有重复块chunk的 if (chunk.size === dup_chunk.size && chunk.digest_b64 === dup_chunk.digest_b64) { chunk.dup_chunk_id = dup_chunk._id; } --> do_allocations //分配空间并配置给分片构造包括ID
pipe的方式将 params.source_stream处理 ChunkSplitter , 流程比较复杂span style=\"font-size: inherit;\
src/agent/block_store_services/block_store_client.js
complete_object_upload(req)-->_complete_object_parts(obj) //从库中收集对象的part参数 -->MDStore.instance().find_all_parts_of_object(obj-->_put_object_handle_latest() //库状态更新,关于版本功能启用时的信息相关字段处理
create_object_upload(req)-->obj_id = MDStore.instance.make_md_id()// 生成oject id-->MDStore.instance.insert_object(info) //将object 信息写库
noobaa-core 上传对象
upload_blob_block(params)
---> PutMapping.run --> add_chunks --> update_db
src/sdk/map_client.js
//对象的存储目录构造function get_block_internal_dir(block_id) { let hex_str_regex = /^[0-9a-fA-F]+$/; let internal_dir = hex_str_regex.test(block_id) ? block_id.substring(block_id.length - 3) + '.blocks' : 'other.blocks'; return internal_dir;}
upload_object(params)
src/server/object_service/md_store.jsMongDB 服务
src/sdk/namespace_nb.js
src/sdk/object_io.js
upload_blob_block(params,object_sdk)src/sdk/blob_translator.js
upload_blob_block(params)src/endpoint/blob/ops/blob_put_blob_block.js
src/sdk/object_sdk.js
src/server/object_services/map_server.js
config.jsconfig.CHUNK_SPLIT_AVG_CHUNK = 4 * 1024 * 1024;config.CHUNK_SPLIT_DELTA_CHUNK = config.CHUNK_SPLIT_AVG_CHUNK / 4;
src/sdk/object_servers.js
async run() { const chunks = await this.get_mapping(); this.chunks = chunks; await this.process_mapping(); await this.put_mapping(); }
0 条评论
下一页