@Override public void initialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException { // Initialise store super.initialise(graphId, schema, properties); // Initialise maps mapImpl = createMapImpl(); }
/** * Initialise this FederatedStore with any sub-graphs defined within the * properties. * * @param graphId the graphId to label this FederatedStore. * @param unused unused * @param properties properties to initialise this FederatedStore with, can * contain details on graphs to add to scope. * @throws StoreException if no cache has been set */ @Override public void initialise(final String graphId, final Schema unused, final StoreProperties properties) throws StoreException { super.initialise(graphId, new Schema(), properties); customPropertiesAuths = getCustomPropertiesAuths(); isPublicAccessAllowed = Boolean.valueOf(getProperties().getIsPublicAccessAllowed()); }
/** * Performs general initialisation without creating the table. * * @param graphId The graph ID. * @param schema The Gaffer Schema. * @param properties The Accumulo store properties. * @throws StoreException If the store could not be initialised. */ public void preInitialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException { setProperties(properties); final String deprecatedTableName = getProperties().getTable(); if (null == graphId && null != deprecatedTableName) { // Deprecated super.initialise(deprecatedTableName, schema, getProperties()); } else if (null != deprecatedTableName && !deprecatedTableName.equals(graphId)) { throw new IllegalArgumentException( "The table in store.properties should no longer be used. " + "Please use a graphId instead or for now just set the graphId to be the same value as the store.properties table."); } else { super.initialise(graphId, schema, getProperties()); } final String keyPackageClass = getProperties().getKeyPackageClass(); try { this.keyPackage = Class.forName(keyPackageClass).asSubclass(AccumuloKeyPackage.class).newInstance(); } catch (final InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new StoreException("Unable to construct an instance of key package: " + keyPackageClass, e); } this.keyPackage.setSchema(getSchema()); }
@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "The properties should always be ProxyProperties") @Override public void initialise(final String graphId, final Schema unusedSchema, final StoreProperties properties) throws StoreException { setProperties(properties); client = createClient(); schema = fetchSchema(); traits = fetchTraits(); supportedOperations = fetchOperations(); super.initialise(graphId, schema, getProperties()); checkDelegateStoreStatus(); }
@Override public void initialise(final String graphId, final Schema schema, final StoreProperties properties) throws StoreException { if (!(properties instanceof ParquetStoreProperties)) { throw new StoreException("ParquetStore must be initialised with properties of class ParquetStoreProperties"); } final ParquetStoreProperties parquetStoreProperties = (ParquetStoreProperties) properties; if (null == parquetStoreProperties.getDataDir()) { throw new StoreException("The ParquetStoreProperties must contain a non-null data directory (" + ParquetStoreProperties.DATA_DIR + ")"); } if (null == parquetStoreProperties.getTempFilesDir()) { throw new StoreException("The ParquetStoreProperties must contain a non-null temporary data directory (" + ParquetStoreProperties.TEMP_FILES_DIR + ")"); } super.initialise(graphId, schema, parquetStoreProperties); try { fs = FileSystem.get(new Configuration()); } catch (final IOException e) { throw new StoreException("Could not connect to the file system", e); } schemaUtils = new SchemaUtils(getSchema()); loadIndex(); }
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(); } }