Exemplo n.º 1
0
        public void Check(ICheckNotifier notifier)
        {
            if (ColumnToDilute == null)
            {
                notifier.OnCheckPerformed(new CheckEventArgs("ColumnToDilute is null", CheckResult.Fail, null));
                return;
            }

            if (ColumnToDilute.Destination != DiscardedColumnDestination.Dilute)
            {
                notifier.OnCheckPerformed(new CheckEventArgs("ColumnToDilute '" + ColumnToDilute.GetRuntimeName() + "' is not marked as DiscardedColumnDestination.Dilute", CheckResult.Fail, null));
            }

            //Stamp out the type
            IDilutionOperation instance = null;

            try
            {
                var factory = new DilutionOperationFactory(ColumnToDilute);
                instance = factory.Create(Operation);
            }
            catch (Exception e)
            {
                notifier.OnCheckPerformed(
                    new CheckEventArgs(
                        "Could not create DilutionOperation of Type " + Operation +
                        " using DilutionOperationFactory, see inner Exception for details", CheckResult.Fail, e));
            }

            if (_loadStage != LoadStage.AdjustStaging)
            {
                notifier.OnCheckPerformed(new CheckEventArgs("Dilution can ONLY occur in load stage AdjustStaging, it is currently configured as load stage: " + _loadStage, CheckResult.Fail));
            }

            if (instance != null)
            {
                instance.Check(notifier);
            }
        }
Exemplo n.º 2
0
        private string GetMutilationSql(INameDatabasesAndTablesDuringLoads namer)
        {
            var factory = new DilutionOperationFactory(ColumnToDilute);

            return(factory.Create(Operation).GetMutilationSql(namer));
        }