use of uk.gov.gchq.gaffer.store.ValidatedElements in project Gaffer by gchq.
the class AddElementsHandler method addElements.
private void addElements(final AddElements operation, final AccumuloStore store) throws OperationException {
try {
final Iterable<? extends Element> validatedElements;
if (operation.isValidate()) {
validatedElements = new ValidatedElements(operation.getInput(), store.getSchema(), operation.isSkipInvalidElements());
} else {
validatedElements = operation.getInput();
}
store.addElements(validatedElements);
} catch (final StoreException e) {
throw new OperationException("Failed to add elements", e);
}
}
use of uk.gov.gchq.gaffer.store.ValidatedElements in project Gaffer by gchq.
the class AddElementsHandler method doOperation.
@Override
public Void doOperation(final AddElements addElements, final Context context, final Store store) throws OperationException {
Iterable<? extends Element> elements = addElements.getInput();
if (addElements.isValidate()) {
elements = new ValidatedElements(elements, store.getSchema(), addElements.isSkipInvalidElements());
}
addElements(elements, (MapStore) store);
return null;
}
Aggregations