/** * {@inheritDoc} */ @Override public Bucket getBucket(Experiment.ID experimentID, Bucket.Label bucketLabel) { return cassandraRepository.getBucket(experimentID, bucketLabel); }
private void checkBucketConstraint(Experiment experiment, Bucket newBucket) { Bucket test = cassandraRepository.getBucket(newBucket.getExperimentID(), newBucket.getLabel()); if (test != null) { throw new ConstraintViolationException(ConstraintViolationException.Reason.UNIQUE_CONSTRAINT_VIOLATION, "Bucket label must be unique within an experiment", null); } if (!experiment.getState().equals(Experiment.State.DRAFT) && newBucket.isControl() != null && newBucket.isControl()) { throw new ConstraintViolationException(ConstraintViolationException.Reason.APPLICATION_CONSTRAINT_VIOLATION, "Bucket added to a running experiment may not be a control bucket", null); } }
boolean isBucketEmpty = false; if (bucketLabel != null && experimentRepository.getBucket(experimentID, t.getBucketLabel()).getState().equals(Bucket.State.EMPTY)) { bucketLabel = null; isBucketEmpty = true;
Bucket bucket = cassandraRepository.getBucket(experimentID, bucketLabel);