Example #1
0
void CRUCache::FetchNonInvolvedMVsMetadata()
{
	DSListPosition tpos = tableList_.GetHeadPosition();
	while (NULL != tpos) 
	{
		CRUTbl *pTbl = tableList_.GetNext(tpos);
		
		// Retrieve the table's private dependency list
		CDDUIDTripleList &privTblList = pTbl->GetUIDsOfAllMVsUsingMe();
			
		DSListPosition mvpos = privTblList.GetHeadPosition();
		while (NULL != mvpos)
		{
			CDDUIDTriple &uidt = privTblList.GetNext(mvpos);

			CRUMV *pMV = GetMV(uidt.objUID); 
			if (NULL == pMV)
			{
				// The MV is non-involved, fetch the DD object
				CDDMV *pddMV = GetDDMVByUID(uidt);

				// If the MV is not ON REQUEST, skip it
				if (CDDObject::eON_REQUEST != pddMV->GetRefreshType())
				{
					continue;
				}

				pMV = FetchSingleNonInvolvedMV(pddMV);
			}

			if (FALSE == pMV->IsInvolved())
			{
				// If the MV is involved, the pointer exists already
				pTbl->AddRefToUsingMV(pMV);
			}
		}
	}	
}
Example #2
0
void CRUCache::FetchUsedObjectsMetadataForSingleMV(CRUMV *pMV)
{
	CDDUIDTripleList &uList = pMV->GetAllUsedObjectsUIDs();

	DSListPosition pos = uList.GetHeadPosition();
	while (NULL != pos) 
	{
		CDDUIDTriple& uidt = uList.GetNext(pos);
		TInt64 objUid = uidt.objUID;

		// Tables that are IGNORE CHANGES and UDFs do not interest us
		// for the purpose of REFRESH
		if (TRUE == pMV->IsIgnoreChanges(objUid) ||
		    TRUE == pMV->IsUsedObjectUDF(objUid)) 
		{
			continue;
		}

		// Fetch the pointer to the used table's wrapper object
		// (create the wrapper if the table is referenced first)
		CRUTbl *pTbl = GetTable(objUid);
		if (NULL == pTbl)
		{
			pTbl = FetchSingleUsedObject(pMV, uidt);
		}
		
		// Add the pointer to the table to the MV's list of dependencies.
		pMV->AddRefToUsedObject(pTbl);
		
		// Add the pointer to the MV to the table's list of dependencies.
		pTbl->AddRefToUsingMV(pMV);

		// Register the used object for the DDL lock handling ...
		SetupUsedObject(pTbl);
	}
}