Curve支持S3 数据缓存方案de中采用maps3ChunkInfoMap用于保存对象存储的位置信息。采用2级索引的好处是,根据操作的offset可以快速定位到index,则只需要遍历index相关的S3ChunkInfoList,减少了遍历的范围。 对象名设计 对象名采用chunkId+blockindex+compaction(后台碎片整理才会使用,默认0)+inod ),对于小io进行block级别的预读。 即读写缓存相互没影响不相关, 缓存层级 缓存层级分为fs->file->chunk->datacache 4层,通过inodeId找到file,通过index找到chunk,然后通过offset~len找到是否有合适的datacache或者new datacache。 对外接口 流程上对于读写缓存有影响的接口包括:write,read,releas TYPE_FILE only map s3ChunkInfoMap = 14; // TYPE_S3 only, first is chunk index optional uint64 version = 15; } class ClientS3Adaptor { public: ClientS3Adaptor () {} 0 码力 | 9 页 | 179.72 KB | 6 月前3
CurveFS S3数据整理(合并碎片、清理冗余)s3chuninfolist[index] = [s3chunkinfo(s)] s3chunkinfo { chunkid version // write always 0, compact will increase it offset len } s3 object命名: chunkid_version_index (index为obj在chunk内的index) 如果是已有inode任务, enqueue直接返回, 不入队 任务开始执行, 尝试根据inodekey获取inode信息, 获取不到就退出; 不是s3类型的inode退出 对于每一个s3类型的inode来说, 对每一个index内的chunkinfo按照chunkid升序排序. 对于一个chunk来说,chunkinfo数量大于20即进行处理 计算变更 - 记录整个chunk最大的chunkid - 读出一个chunk所0 码力 | 3 页 | 101.58 KB | 6 月前3
CurveFs 用户权限系统调研Filesystem revision #: 1 (dynamic) Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize */ }; struct ext4_xattr_entry { __u8 e_name_len; /* length of name */ __u8 e_name_index; /* attribute name index */ __le16 e_value_offs; /* offset in disk block of value */ __le32 e_value_inum; /*0 码力 | 33 页 | 732.13 KB | 6 月前3
Open Flags 调研*how, size_t size); open系统调用会打开pathname指定的文件(如果不存在,如果携带O_CREAT flag则会创建),返回一个文件描述符fd(该fd是进程打开文件描述符表的index),在后续系统调用(read(2)、write(2)、lseek(2)、fcntl(2) etc.)中指向这个打开的文件。打开的文件描述符记录中保存着文件的offset 和 文件status。 每个进程都有个 that reliably O_APPEND is not available). Filesystem may store an arbitrary file handle (pointer, index, etc) in fi->fh, and use this in other all other file operations (read, write, flush, release, fsync)0 码力 | 23 页 | 524.47 KB | 6 月前3
共 4 条
- 1













