Exemple #1
0
        /// <summary>
        /// Establish the context based on the context info from the side of the pipeline
        /// </summary>
        public virtual void EstablishContext(ChangeGroupService sourceSystemChangeGroupService)
        {
            try
            {
                if (m_witMetadataSyncPolicy == WitMetadataSyncPolicy.DoNotTakeTheirs)
                {
                    return;
                }

                if (m_witMetadataSyncPolicy == WitMetadataSyncPolicy.Merge)
                {
                    throw new NotImplementedException("WitMetadataSyncPolicy.Merge has not been implemented");
                }

                int pageNumber = 0;
                int pageSize   = 1000;
                IEnumerable <ChangeGroup> changeGroups = null;
                do
                {
                    changeGroups = sourceSystemChangeGroupService.NextDeltaTablePage(pageNumber++, pageSize, false);
                    foreach (ChangeGroup nextChangeGroup in changeGroups)
                    {
                        if (nextChangeGroup.ContainsBackloggedAction)
                        {
                            continue;
                        }

                        if (TryProcessContextSyncChangeGroup(nextChangeGroup))
                        {
                            break;
                        }
                    }
                } while (changeGroups.Count() == pageSize);
            }
            catch (Exception exception)
            {
                if (!(exception is MigrationUnresolvedConflictException))
                {
                    ErrorManager errMgr = m_migrationServiceContainer.GetService(typeof(ErrorManager)) as ErrorManager;
                    errMgr.TryHandleException(exception);
                }
                return;
            }
        }