public static String getSkipFailedFederatedStoreExecute(final Operation op) { return op.getOption(KEY_SKIP_FAILED_FEDERATED_STORE_EXECUTE, DEFAULT_VALUE_KEY_SKIP_FAILED_FEDERATED_STORE_EXECUTE); } }
protected Configuration getConfiguration(final OP operation) throws OperationException { final Configuration conf = new Configuration(); final String serialisedConf = operation.getOption(AbstractGetRDDHandler.HADOOP_CONFIGURATION_KEY); if (null != serialisedConf) { try { final ByteArrayInputStream bais = new ByteArrayInputStream(serialisedConf.getBytes(CommonConstants.UTF_8)); conf.readFields(new DataInputStream(bais)); } catch (final IOException e) { throw new OperationException("Exception decoding Configuration from options", e); } } return conf; }
public <OP extends Validatable & Operation> GafferAdder(final OP operation, final Store store) { this.store = store; this.validate = operation.isValidate(); this.skipInvalid = operation.isSkipInvalidElements(); final String maxQueueSizeOption = operation.getOption(FlinkConstants.MAX_QUEUE_SIZE); this.maxQueueSize = null != maxQueueSizeOption ? Integer.parseInt(maxQueueSizeOption) : MAX_QUEUE_SIZE_DEFAULT; graphId = store.getGraphId(); schema = store.getSchema().toCompactJson(); properties = store.getProperties().getProperties(); }
public Object doOperation(final Operation operation, final Context context, final Store store) throws OperationException { final Collection<Graph> graphs = ((FederatedStore) store).getGraphs(context.getUser(), operation.getOption(KEY_OPERATION_OPTIONS_GRAPH_IDS)); for (final Graph graph : graphs) { final Operation updatedOp = FederatedStoreUtil.updateOperationForGraph(operation, graph); if (null != updatedOp) { try { graph.execute(updatedOp, context); } catch (final Exception e) { if (!Boolean.valueOf(getSkipFailedFederatedStoreExecute(updatedOp))) { throw new OperationException(FederatedStoreUtil.createOperationErrorMsg(operation, graph.getGraphId(), e), e); } } } } return null; } }