/** * @return the StoreProperties for this Graph. */ public StoreProperties getStoreProperties() { return store.getProperties(); }
/** * Get this Store's {@link uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties}. * * @return the instance of {@link uk.gov.gchq.gaffer.federatedstore.FederatedStoreProperties}, * this may contain details such as database connection details. */ @Override public FederatedStoreProperties getProperties() { return (FederatedStoreProperties) super.getProperties(); }
@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", justification = "The properties should always be ParquetStoreProperties") @Override public ParquetStoreProperties getProperties() { return (ParquetStoreProperties) super.getProperties(); }
@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", justification = "The properties should always be MapStoreProperties") @Override public MapStoreProperties getProperties() { return (MapStoreProperties) super.getProperties(); }
/** * Gets all {@link AccumuloProperties} related to the store. * * @return {@link AccumuloProperties}. */ @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", justification = "The properties should always be AccumuloProperties") @Override public AccumuloProperties getProperties() { return (AccumuloProperties) super.getProperties(); }
@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE", justification = "The properties should always be ProxyProperties") @Override public ProxyProperties getProperties() { return (ProxyProperties) super.getProperties(); }
@Override public StoreProperties resolveStorePropertiesForGraph(final Store store, final StoreProperties properties, final String parentStorePropertiesId, final Pair<Schema, StoreProperties> existingGraphPair) { StoreProperties resultProps = super.resolveStorePropertiesForGraph(store, properties, parentStorePropertiesId, existingGraphPair); if (null == resultProps) { // If no properties have been provided then default to using the store properties resultProps = store.getProperties(); } return resultProps; }
@Override protected StoreProperties resolveStorePropertiesForGraph(final Store store, final StoreProperties properties, final String parentStorePropertiesId, final Pair<Schema, StoreProperties> existingGraphPair) { StoreProperties resultProps = super.resolveStorePropertiesForGraph(store, properties, parentStorePropertiesId, existingGraphPair); if (null == resultProps) { // If no properties have been provided then default to using the store properties resultProps = store.getProperties(); } return resultProps; }
@Override public Void doOperation(final AddElements operation, final Context context, final Store store) throws OperationException { final SparkSession spark = SparkContextUtil.getSparkSession(context, store.getProperties()); final ParquetStore parquetStore = (ParquetStore) store; SparkParquetUtils.configureSparkForAddElements(spark, parquetStore.getProperties()); addElements(operation, parquetStore, spark); return null; }
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(); }
@Override public Dataset<Row> doOperation(final GetDataFrameOfElements operation, final Context context, final Store store) throws OperationException { final SparkSession spark = SparkContextUtil.getSparkSession(context, store.getProperties()); final User user = context.getUser(); final Authorisations auths; final String visibility; if (user != null && user.getDataAuths() != null) { auths = new Authorisations(user.getDataAuths().toArray(new String[user.getDataAuths().size()])); } else { auths = new Authorisations(); } if (store.getSchema().getVisibilityProperty() != null) { visibility = store.getSchema().getVisibilityProperty(); } else { visibility = new String(); } return doOperation(operation, (ParquetStore) store, spark, auths, visibility); }
private void updateStore(final GraphConfig config) { if (null == store) { store = Store.createStore(config.getGraphId(), cloneSchema(schema), properties); } else if ((null != config.getGraphId() && !config.getGraphId().equals(store.getGraphId())) || (null != schema) || (null != properties && !properties.equals(store.getProperties()))) { if (null == config.getGraphId()) { config.setGraphId(store.getGraphId()); } if (null == schema || schema.getGroups().isEmpty()) { schema = store.getSchema(); } if (null == properties) { properties = store.getProperties(); } try { store.initialise(config.getGraphId(), cloneSchema(schema), properties); } catch (final StoreException e) { throw new IllegalArgumentException("Unable to initialise the store with the given graphId, schema and properties", e); } } store.setGraphLibrary(config.getLibrary()); if (null == schema || schema.getGroups().isEmpty()) { schema = store.getSchema(); } }
config.getLibrary().add(config.getGraphId(), schema, store.getProperties());
final String entityGroups = groupsToString(operation.getView().getEntityGroups()); final SparkSession sparkSession = SparkContextUtil.getSparkSession(context, store.getProperties());