private void checkConstraints() { List<String> violations = Lists.newArrayList(); for (Map.Entry<TableReference, ConstraintCheckable> entry : constraintsByTableName.entrySet()) { SortedMap<Cell, byte[]> sortedMap = writesByTable.get(entry.getKey()); if (sortedMap != null) { violations.addAll(entry.getValue().findConstraintFailures(sortedMap, this, constraintCheckingMode)); } } if (!violations.isEmpty()) { if (constraintCheckingMode.shouldThrowException()) { throw new AtlasDbConstraintException(violations); } else { constraintLogger.error("Constraint failure on commit.", new AtlasDbConstraintException(violations)); } } }
private void checkConstraints() { List<String> violations = Lists.newArrayList(); for (Map.Entry<TableReference, ConstraintCheckable> entry : constraintsByTableName.entrySet()) { SortedMap<Cell, byte[]> sortedMap = writesByTable.get(entry.getKey()); if (sortedMap != null) { violations.addAll(entry.getValue().findConstraintFailures(sortedMap, this, constraintCheckingMode)); } } if (!violations.isEmpty()) { if (constraintCheckingMode.shouldThrowException()) { throw new AtlasDbConstraintException(violations); } else { constraintLogger.error("Constraint failure on commit.", new AtlasDbConstraintException(violations)); } } }