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); } } }
@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; }
final Iterable<? extends Element> input = addElementsOperation.getInput(); final ExecutorService pool = createThreadPool(spark, parquetStoreProperties); final List<Callable<Tuple2<String, Map<Object, Integer>>>> tasks = new ArrayList<>();
if (null == addElements.getInput()) { if (!addElements.isValidate() || !addElements.isSkipInvalidElements()) { LOGGER.debug("Invalid elements will be skipped when added to {}", graph.getGraphId()); final Set<String> graphGroups = graph.getSchema().getGroups(); final Iterable<? extends Element> filteredInput = Iterables.filter( addElements.getInput(), element -> graphGroups.contains(null != element ? element.getGroup() : null) );