void CRULogCleanupTaskExecutor::Init()
{
	inherited::Init();

	CRUTbl &tbl = GetLogCleanupTask()->GetTable();
	hasRangeLog_ = (CDDObject::eNONE != tbl.GetRangeLogType());
        noOfPartitions_ = tbl.getNumberOfPartitions();

	ComposeMySql();
}
void CRUUnAuditRefreshTaskExecutor::Init()
{
	inherited::Init();

	RUASSERT(TRUE == HasWork());

	if (FALSE == GetRefreshTask()->NeedToExecuteInternalRefresh())
	{
		return;
	}

	Lng32 refreshPattern = GetRootMV().GetRefreshPatternMap();
	isPurgedata_ = (0 != (refreshPattern & CRUMV::PURGEDATA));
	isPopindex_ = (0 != (refreshPattern & CRUMV::POPINDEX));

	// Compose the INTERNAL REFRESH 
	// + (optionally) the PopIndex CatApi request statements
	// + (optionally) the LOCK TABLE statements for ON STATEMENT MV
	ComposeMySql();
}
void CRURefreshTaskExecutor::Init()
{
	inherited::Init(); 

	CRUMV &rootMV = GetRefreshTask()->GetRootMV();

	SetRecompute(rootMV.WillBeRecomputed());

	rootMVName_   = rootMV.GetFullName();
	rootMVSchema_ = rootMV.GetCatName() + "." + rootMV.GetSchName();
	rootMVCatalog_ = rootMV.GetCatName();

	rootMVType_   = rootMV.GetRefreshType();
	rootMVUID_	  = rootMV.GetUID();

	// Runtime consistency check.
	// Check requirement that the regular table's deltas 
	// are empty (if they must be).
	CheckSingleDeltaRestriction();

	ComposeMySql();
} 
void CRUAuditRefreshTaskExecutor::Init()
{
	inherited::Init();
	
	RUASSERT(TRUE == HasWork());

	if (FALSE == GetRefreshTask()->NeedToExecuteInternalRefresh())
	{
		return;
	}

        Lng32 refreshPattern = GetRootMV().GetRefreshPatternMap();
	isPurgedata_ = (0 != (refreshPattern & CRUMV::PURGEDATA));
	isPopindex_ = (0 != (refreshPattern & CRUMV::POPINDEX));

	CRUMV &mv = GetRootMV();
	if (mv.GetCommitNRows() != 0 && 
		TRUE == GetRootMV().IsMultiTxnContext())
	{
		RUASSERT(TRUE == GetRefreshTask()->IsRecompute());

		// We need to drop multi-txn context table
		// becuase we are recomputing a multi-txn mv
		isDeleteMultiTxnContext_ = TRUE;
	}

	// We must synchronize between the table and the mv, so we need to 
	// lock the table partitions
	// Here we copy the partitions file names in order to allow access to 
	// the files in the remote process when DDOL is not built
	tableLockProtocol_ = new CRUTableLockProtocol();
	tableLockProtocol_->Init(mv.GetTablesUsedByMe(), 
				 GetRefreshTask()->GetDeltaDefList());

	ComposeMySql();
}