Пример #1
0
 public RegressionEnvironment Rollout(
     IList<EPDeploymentRolloutCompiled> items,
     RolloutOptions options)
 {
     Runtime.DeploymentService.Rollout(items, options);
     return this;
 }
Пример #2
0
 private IDisposable GetRolloutLock(RolloutOptions options)
 {
     try {
         return(options.RolloutLockStrategy.Acquire(_services.EventProcessingRWLock));
     }
     catch (Exception e) {
         throw new EPDeployLockException(e.Message, e);
     }
 }
Пример #3
0
        public EPDeploymentRollout Rollout(
            ICollection <EPDeploymentRolloutCompiled> items,
            RolloutOptions options)
        {
            if (options == null)
            {
                options = new RolloutOptions();
            }

            ValidateRuntimeAlive();
            var rollItemNum = 0;

            foreach (var item in items)
            {
                CheckManifest(rollItemNum++, item.Compiled.Manifest);
            }

            DeployerRolloutDeploymentResult rolloutResult;

            using (GetRolloutLock(options)) {
                var statementIdRecovery = _services.EpServicesHA.StatementIdRecoveryService;
                var currentStatementId  = statementIdRecovery.CurrentStatementId;
                if (currentStatementId == null)
                {
                    currentStatementId = 1;
                }

                rolloutResult = DeployerRollout.Rollout(currentStatementId.Value, items, _runtime);
                statementIdRecovery.CurrentStatementId = currentStatementId + rolloutResult.NumStatements;

                // dispatch event
                for (var i = 0; i < rolloutResult.Deployments.Length; i++)
                {
                    DispatchOnDeploymentEvent(rolloutResult.Deployments[i], i);
                }
            }

            var deployments = new EPDeploymentRolloutItem[items.Count];

            for (var i = 0; i < rolloutResult.Deployments.Length; i++)
            {
                var deployment = MakeDeployment(rolloutResult.Deployments[i]);
                deployments[i] = new EPDeploymentRolloutItem(deployment);
            }

            return(new EPDeploymentRollout(deployments));
        }