Example #1
0
CRUTbl *CRUCache::FetchSingleUsedObject(CRUMV *pUsingMV, 
										const CDDUIDTriple &uidt)
{
	CRUTbl *pTbl;
	BOOL isMV = pUsingMV->IsUsedObjectAnMV(uidt.objUID);

	if (FALSE == isMV) 
	{
		CDDTable *pddTable = GetDDTableByUID(uidt);
		pTbl = new CRURegularTbl(pddTable);
	}
	else 
	{
		CDDMV *pddMV = GetDDMVByUID(uidt);
		pTbl = new CRUMVTbl(pddMV);

		// Read the REFRESH-specific metadata
		pddMV->FetchMVRefreshMetadata();

		// A table based on MV will always inherit the MV's timestamp
		pTbl->SetTimestamp(pddMV->GetRefreshedAtTimestamp());

		// Inherit the MV's feature.
		// If a table is NOT an involved MV, take care not to remove 
		// its dangling DDL lock (if any) accidentally.
		pTbl->SetReleaseDDLLock(pddMV->CanCancelDDLLock());
	}

	pTbl->SetInvolved();
	tableList_.AddTail(pTbl);

	return pTbl;
}
void CRURefreshTaskExecutor::IncrementTopMvCurrentEpoch()
{
	CRUMV &mv = GetRefreshTask()->GetTopMV();

	if (TRUE == mv.IsInvolvedTbl())
	{
		CRUTbl *pTbl = mv.GetTblInterface();
		
		pTbl->IncrementCurrentEpoch(TRUE /* through DDOL */);
		pTbl->SaveMetadata();
		
		pTbl->SetTimestamp(mv.GetTimestamp());
	}
}
//--------------------------------------------------------------------------//
//	CRULockEquivSetTaskExecutor::SetTimestampToAllTbls() 
//--------------------------------------------------------------------------//
void CRULockEquivSetTaskExecutor::SetTimestampToAllTbls(TInt64 ts)
{
	CRULockEquivSetTask *pParentTask = (CRULockEquivSetTask *)GetParentTask();
	RUASSERT(NULL != pParentTask);
	
	CRUTblList &tblList = pParentTask->GetTableList();

	DSListPosition pos = tblList.GetHeadPosition();
	while (NULL != pos)
	{
		CRUTbl *pTbl = tblList.GetNext(pos);
		pTbl->SetTimestamp(ts);
	}
}