Skip to content

Meta layer API

Youngjin Yu edited this page Dec 20, 2022 · 10 revisions
sequenceDiagram
  participant IOPath
  participant Meta
  participant SRM
  IOPath->>Meta: IMetaUpdater::UpdateBlockMap(VolumeIo, Callback) -> int
  Note left of Meta: called by BlockMapUpdateRequest

  IOPath->>Meta: IMetaUpdater::UpdateStripeMap(Stripe, Callback) -> int
  Note left of Meta: called by StripeMapUpdateRequest

  SRM->>Meta: IMetaUpdater::UpdateGcMap(Stripe, mapUpdateInfoList, invalidSegCnt, Callback) -> int
  Note right of Meta: called by GcMapUpdateRequest

  IOPath->>Meta: IVSAMap::GetVSAs(volumeId, startRba, numBlks, vsaArray) -> int
  Note left of Meta: called by Translator, VsaRangeMaker

  SRM->>Meta: IVSAMap::GetVSAInternal(volumeId, rba, caller) -> VirtualBlkAddr
  Note right of Meta: called by VictimStripe, GcMapUpdateRequest

  IOPath->>Meta: IVSAMap::GetRandomVSA(rba) -> VirtualBlkAddr
  Note left of Meta: called by Translator

  IOPath->>Meta: IVSAMap::GetNumUsedBlks(volId) -> int
  Note left of Meta: called by VolumeBase

  IOPath->>Meta: IStripeMap::GetLSA(vsid) -> StripeAddr 
  Note left of Meta: called by FlushCompletion, StripeMapUpdateRequest, Translator

  SRM->>Meta: IStripeMap::GetLSA(vsid) -> StripeAddr
  Note right of Meta: called by VictimStripe

  IOPath->>Meta: IStripeMap::GetLSAandReferLsid(vsid) -> LsidRefResult
  Note left of Meta: called by Translator

  IOPath->>Meta: IStripeMap::GetRandomLsid(vsid) -> StripeId
  Note left of Meta: called by Translator

  IOPath->>Meta: IStripeMap::IsInUserDataArea(StripeAddr) -> bool
  Note left of Meta: called by FlushCompletion, Translator

  IOPath->>Meta: IStripeMap::IsInWriteBufferArea(StripeAddr) -> bool
  Note left of Meta: called by StripeMapUpdateRequest

  SRM->>Meta: IReverseMap::Load(ReverseMapPack, Event) -> int
  Note right of Meta: called by VictimStripe

  SRM->>Meta: IReverseMap::AllocReverseMapPack(StripeId, StripeId) -> ReverseMapPack
  Note right of Meta: called by VictimStripe

  IOPath->>Meta: IMapFlush::FlushDirtyMpages(mapId, Event) -> int
  Note left of Meta: called by FlushCommandHandler, 
  
  IOPath->>Meta: IBlockAllocator::AllocateWriteBufferBlks(volumeId, numBlks) -> (VirtualBlks, StripeId)
  Note left of Meta: called by WriteSubmission

  SRM->>Meta: IBlockAllocator::AllocateGcDestStripe(volumeId) -> Stripe
  Note right of Meta: called by GcFlushSubmission

  IOPath->>Meta: IBlockAllocator::IsProhibitedUserBlkAlloc() -> bool
  Note left of Meta: called by WriteSubmission

  IOPath->>Meta: IBlockAllocator::BlockAllocating(volumeId) -> bool
  Note left of Meta: called by FlushCommandHandler

  IOPath->>Meta: IBlockAllocator::UnblockAllocating(volumeId) 
  Note left of Meta: called by FlushCommandHandler

  IOPath->>Meta: IBlockAllocator::TryRdLock(volumeId) -> bool
  Note left of Meta: called by WriteSubmission

  IOPath->>Meta: IBlockAllocator::Unlock(volumeId) -> bool
  Note left of Meta: called by WriteSubmission

  IOPath->>Meta: IContextManager::FlushContexts(Event, sync, logGroupId) -> int
  Note left of Meta: called by FlushCommandHandler

  SRM->>Meta: IContextManager::AllocateGCVictimSegment() -> SegmentId
  Note right of Meta: called by Copier

  SRM->>Meta: IContextManager::AllocateRebuildTargetSegment() -> SegmentId
  Note right of Meta: called by SegmentBasedRebuild

  SRM->>Meta: IContextManager::ReleaseRebuildSegment(SegmentId) -> int
  Note right of Meta: called by SegmentBasedRebuild

  SRM->>Meta: IContextManager::GetRebuildTargetSegmentCount() -> int
  Note right of Meta: called by SegmentBasedRebuild

  SRM->>Meta: IContextManager::GetGcThreshold(GcMode) -> int
  Note right of Meta: called by FlowControl, LinearDistributer, StateDistributer, TokenDistributer
  
  SRM->>Meta: IContextManager::GetSegmentCtx() -> SegmentCtx
  Note right of Meta: called by Copier, FlowControl

  SRM->>Meta: SegmentCtx::GetVictimSegmentList() -> set<SegmentId>
  Note right of Meta: called by Copier

  SRM->>Meta: SegmentCtx::GetValidBlockCount(SegmentId) -> int
  Note right of Meta: called by Copier 

  SRM->>Meta: SegmentCtx::MoveToFreeState(SegmentId)
  Note right of Meta: called by Copier

  SRM->>Meta: SegmentCtx::GetVictimSegmentCount() -> int
  Note right of Meta: called by Copier

  SRM->>Meta: SegmentCtx::GetNumOfFreeSegment() -> int
  Note right of Meta: called by Copier

  SRM->>Meta: IContextManager::GetGcCtx() -> GcCtx
  Note right of Meta: called by ArrayInfoCommand, CommandProcessor, Copier

  SRM->>Meta: GcCtx::GetCurrentGcMode() -> GcMode
  SRM->>Meta: GcCtx::GetUrgentThreshold() -> int
  SRM->>Meta: GcCtx::GetNormalGcThreshold() -> int
  Note right of Meta: called by Copier

  SRM->>Meta: IContextManager::GetSegmentContextUpdaterPtr() -> ISegmentCtx
  Note right of Meta: called by Copier

  SRM->>Meta: SegmentContextUpdater::ResetInfos(SegmentId)
  Note right of Meta: called by Copier

  IOPath->>Meta: IWBStripeAllocator::FreeWBStripeId(StripeId)
  Note left of Meta: called by StripePutEvent

  IOPath->>Meta: IWBStripeAllocator::GetStripe(StripeId) -> Stripe
  Note left of Meta: called by WriteCompletion

  IOPath->>Meta: IWBStripeAllocator::ReferLsidCnt(StripeAddr) -> bool
  Note left of Meta: called by Translator

  IOPath->>Meta: IWBStripeAllocator::DereferLsidCnt(StripeAddr, blockCount)
  Note left of Meta: called by ReadCompletion, ReadCompletionForPartialWrite

  IOPath->>Meta: IWBStripeAllocator::FlushAllPendingStripesInVolume(volumeId, flushIo) -> int
  Note left of Meta: called by FlushCommandHandler

  SRM->>Meta: Stripe::UpdateReverseMapEntry(offset, rba, volumeId)
  Note right of Meta: called by GcFlushSubmission

  SRM->>Meta: Stripe::GetReverseMapEntry(offset) -> (BlkAddr, int)
  Note right of Meta: called by GcFlushSubmission, GcMapUpdateCompletion, GcMapUpdateRequest

  SRM->>Meta: Stripe::Flush(Event) -> int
  Note right of Meta: called by GcFlushCompletion

  IOPath->>Meta: Stripe::Flush(Event) -> int
  Note left of Meta: called by WriteCompletion

  SRM->>Meta: Stripe::UpdateVictimVsa(offset, vsa) 
  Note right of Meta: called by GcFlushSubmission

  SRM->>Meta: Stripe::GetVictimVsa(offset) -> VirtualBlkAddr
  Note right of Meta: called by GcMapUpdateRequest

  IOPath->>Meta: Stripe::SetFinished()
  Note left of Meta: called by StripePutEvent

  IOPath->>Meta: Stripe::DecreseBlksRemaining(amount) -> int
  Note left of Meta: called by WriteCompletion

  IOPath->>Meta: Stripe::IsOkToFree() -> bool
  Note left of Meta: called by StripePutEvent

  IOPath->>Meta: Stripe::IsActiveFlushTarget() -> bool
  Note left of Meta: called by WriteCompletion

  
  
Loading
Clone this wiki locally