public static String getSkipFailedFederatedStoreExecute(final Operation op) { return op.getOption(KEY_SKIP_FAILED_FEDERATED_STORE_EXECUTE, DEFAULT_VALUE_KEY_SKIP_FAILED_FEDERATED_STORE_EXECUTE); } }
public Schema getSchema(final Operation operation, final User user) { if (null == operation) { return getSchema((Map<String, String>) null, user); } return getSchema(operation.getOptions(), user); }
@Override public ValidationResult validate() { final ValidationResult result = Operation.super.validate(); result.add(FieldUtil.validateRequiredFields( new Tuple3<>("proportionToSample must be greater than 0", proportionToSample, new IsMoreThan(0f)) )); return result; }
OP resultOp = operation; if (operation instanceof Operations) { resultOp = (OP) operation.shallowClone(); final Operations<Operation> operations = (Operations) resultOp; final List<Operation> resultOperations = new ArrayList<>(); resultOp = (OP) operation.shallowClone(); if (validView.hasGroups()) { ((OperationView) resultOp).setView(validView);
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 Schema getSchema(final Operation operation, final Context context) { if (null == operation) { return getSchema((Map<String, String>) null, context); } return getSchema(operation.getOptions(), context); }
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; } }