/** * {@inheritDoc} */ @Override public void checkStateTransition(Experiment.ID experimentID, Experiment.State currentState, Experiment.State desiredState) { if (desiredState != null && !currentState.equals(desiredState)) { // Throw an exception if the StateTransition is invalid validator.validateStateTransition(currentState, desiredState); /* If moving from a DRAFT state to a RUNNING state a sanity-check is required on the experiment buckets. Fetch the bucket information if the experiment will be (or remain) in an active state (running, paused) because that info is used to create the KV-store entry. * */ if (currentState.equals(DRAFT) && desiredState.equals(RUNNING)) { // Throw an exception if the sanity-check fails BucketList bucketList = buckets.getBuckets(experimentID, false /* don't check experiment again */); validator.validateExperimentBuckets(bucketList.getBuckets()); } } }