Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

升级方案:将方案一“0, 1”文件夹下的内容合并放入上层文件夹即可


2.开发者视角

2.1 整体架构

Image RemovedImage Added

2.2 方案一架构 

整体架构中N = 逻辑存储组数量,M = 虚拟存储组数量,L = 1,在用户例子下,其具体结构如下:(节点中的序号是为了之后的说明使用,无实际意义)

...

整体架构中N = 1, M = 虚拟存储组数量,L = 逻辑存储组数量,在用户例子下,其具体结构如下:(节点中的序号是为了之后的说明使用,无实际意义)

Image RemovedImage Added

2.5 方案二写入流程

2.5.1 写入root.sg1.d1.s1

...

ConcurrentHashMap<PartialPath, StorageGroupProcessor> processorMap -> ConcurrentHashMap<PartialPath, VirtualStorageGroupManager> StorageGroupManager> processorMap


从时间序列设备ID找到存储组的过程需要做相应修改,主要影响的函数为:
insert(InsertRowPlan)
insertTablet(InsertTabletPlan)
delete(PartialPath, long, long, long)
deleteTimeseries(PartialPath, long)
query(SingleSeriesExpression, QueryContext, QueryFileManager)
mergeLock(List<PartialPath>)
loadNewTsFileForSync(TsFileResource newTsFileResource)
loadNewTsFile(TsFileResource newTsFileResource)
deleteTsfileForSync(File deletedTsfile)
moveTsfile(File tsfileToBeMoved, File targetDir)
setPartitionVersionToMax(PartialPath storageGroup, long partitionId,long newMaxVersion)
removePartitions(PartialPath storageGroupPath, TimePartitionFilter filter)
setTTL(PartialPath storageGroup, long dataTTL)


3.2 Virtual Storage Group Manager

字段:
VirtualPartitioner partitioner; // 用于决定划分虚拟存储组的具体逻辑

...

(1)Storage Engine拿到device ID,根据其逻辑存储组名找到对应的VirtualStorageGroupManagerID,根据其逻辑存储组名找到对应的StorageGroupManager
(2)使用deviceID根据VirtualStorageGroupManager使用deviceID根据StorageGroupManager.getProcessor方法拿到虚拟存储组(方案二中就是StorageGroupProcessor)
(3)将请求发给找到的虚拟存储组

...

(1)Storage Engine拿到device ID,根据其逻辑存储组名找到对应的VirtualStorageGroupManagerID,根据其逻辑存储组名找到对应的StorageGroupManager
(2)使用VirtualStorageGroupManager使用StorageGroupManager.getAllVirutalStorageGroupProcessor方法拿到所属全部虚拟存储组(方案二中就是StorageGroupProcessor)
(3)将请求转发至所有虚拟存储组

...