/** * Sets the Accumulo username from the configuration object that is meant to * be used when connecting a {@link Connector} to Accumulo. * */ public void setAccumuloUser(final String user) { Preconditions.checkNotNull(user); set(CLOUDBASE_USER, user); }
private static AccumuloRdfConfiguration getConf() { AccumuloRdfConfiguration conf; Set<RyaIRI> propertySet = new HashSet<RyaIRI>(Arrays.asList(new RyaIRI("http://createdBy"), new RyaIRI("http://createdOn"), new RyaIRI("http://hasTimeStamp"))); conf = new AccumuloRdfConfiguration(); conf.setDisplayQueryPlan(false); conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, true); conf.set(RdfCloudTripleStoreConfiguration.CONF_TBL_PREFIX, "rya_"); conf.set(ConfigUtils.CLOUDBASE_USER, "root"); conf.set(ConfigUtils.CLOUDBASE_PASSWORD, ""); conf.set(ConfigUtils.CLOUDBASE_INSTANCE, "instance"); conf.set(ConfigUtils.CLOUDBASE_AUTHS, ""); conf.setUseStatementMetadata(true); conf.setStatementMetadataProperties(propertySet); return conf; }
protected AccumuloRdfConfiguration makeConfig(final String instanceName, final String zookeepers) { final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration(); conf.setTablePrefix(RYA_INSTANCE_NAME); // Accumulo connection information. conf.setAccumuloUser(AccumuloExportITBase.ACCUMULO_USER); conf.setAccumuloPassword(AccumuloExportITBase.ACCUMULO_PASSWORD); conf.setAccumuloInstance(super.getAccumuloConnector().getInstance().getInstanceName()); conf.setAccumuloZookeepers(super.getAccumuloConnector().getInstance().getZooKeepers()); conf.setAuths(""); // PCJ configuration information. conf.set(ConfigUtils.USE_PCJ, "true"); conf.set(ConfigUtils.USE_PCJ_UPDATER_INDEX, "true"); conf.set(ConfigUtils.FLUO_APP_NAME, super.getFluoConfiguration().getApplicationName()); conf.set(ConfigUtils.PCJ_STORAGE_TYPE, PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType.ACCUMULO.toString()); conf.set(ConfigUtils.PCJ_UPDATER_TYPE, PrecomputedJoinIndexerConfig.PrecomputedJoinUpdaterType.FLUO.toString()); conf.setDisplayQueryPlan(true); return conf; }
private Sail connectToRya(final String ryaInstanceName) throws RyaClientException { try { final AccumuloConnectionDetails connectionDetails = super.getAccumuloConnectionDetails(); final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration(); ryaConf.setTablePrefix(ryaInstanceName); ryaConf.set(ConfigUtils.CLOUDBASE_USER, connectionDetails.getUsername()); ryaConf.set(ConfigUtils.CLOUDBASE_PASSWORD, new String(connectionDetails.getUserPass())); ryaConf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, connectionDetails.getZookeepers()); ryaConf.set(ConfigUtils.CLOUDBASE_INSTANCE, connectionDetails.getInstanceName()); // Turn PCJs off so that we will only scan the core Rya tables while building the PCJ results. ryaConf.set(ConfigUtils.USE_PCJ, "false"); return RyaSailFactory.getInstance(ryaConf); } catch (SailException | AccumuloException | AccumuloSecurityException | RyaDAOException | InferenceEngineException e) { throw new RyaClientException("Could not connect to the Rya instance named '" + ryaInstanceName + "'.", e); } }
@Override protected void setup(final Context context) throws IOException, InterruptedException { super.setup(context); // Set up a mock child DAO for caching serialized statements childAccumuloRdfConfiguration.setBoolean(MRUtils.AC_MOCK_PROP, true); childUser = "root"; childAccumuloRdfConfiguration.set(MRUtils.AC_USERNAME_PROP, childUser); childAccumuloRdfConfiguration.set(MRUtils.AC_PWD_PROP, ""); MergeTool.setDuplicateKeys(childAccumuloRdfConfiguration); childConnector = AccumuloRyaUtils.setupConnector(childAccumuloRdfConfiguration); childDao = AccumuloRyaUtils.setupDao(childConnector, childAccumuloRdfConfiguration); copyAuthorizations(); addMetadataKeys(context); // call in super.setup() does nothing, has to be done after DAO is initialized // Determine the size of the cache maxStatements = childAccumuloRdfConfiguration.getInt(MAX_STATEMENTS_PROP, MAX_STATEMENTS_DEFAULT); }
protected AccumuloRdfConfiguration makeConfig(final String instanceName, final String zookeepers) { final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration(); conf.setTablePrefix(RYA_INSTANCE_NAME); // Accumulo connection information. conf.setAccumuloUser(AccumuloExportITBase.ACCUMULO_USER); conf.setAccumuloPassword(AccumuloExportITBase.ACCUMULO_PASSWORD); conf.setAccumuloInstance(super.getAccumuloConnector().getInstance().getInstanceName()); conf.setAccumuloZookeepers(super.getAccumuloConnector().getInstance().getZooKeepers()); conf.setAuths(""); // PCJ configuration information. conf.set(ConfigUtils.USE_PCJ, "true"); conf.set(ConfigUtils.USE_PCJ_UPDATER_INDEX, "true"); conf.set(ConfigUtils.FLUO_APP_NAME, super.getFluoConfiguration().getApplicationName()); conf.set(ConfigUtils.PCJ_STORAGE_TYPE, PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType.ACCUMULO.toString()); conf.set(ConfigUtils.PCJ_UPDATER_TYPE, PrecomputedJoinIndexerConfig.PrecomputedJoinUpdaterType.FLUO.toString()); conf.setDisplayQueryPlan(true); return conf; }
private Sail connectToRya(final String ryaInstanceName) throws RyaClientException { try { final AccumuloConnectionDetails connectionDetails = super.getAccumuloConnectionDetails(); final AccumuloRdfConfiguration ryaConf = new AccumuloRdfConfiguration(); ryaConf.setTablePrefix(ryaInstanceName); ryaConf.set(ConfigUtils.CLOUDBASE_USER, connectionDetails.getUsername()); ryaConf.set(ConfigUtils.CLOUDBASE_PASSWORD, new String(connectionDetails.getUserPass())); ryaConf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, connectionDetails.getZookeepers()); ryaConf.set(ConfigUtils.CLOUDBASE_INSTANCE, connectionDetails.getInstanceName()); // Turn PCJs off so that we will only scan the core Rya tables while building the PCJ results. ryaConf.set(ConfigUtils.USE_PCJ, "false"); return RyaSailFactory.getInstance(ryaConf); } catch (SailException | AccumuloException | AccumuloSecurityException | RyaDAOException | InferenceEngineException e) { throw new RyaClientException("Could not connect to the Rya instance named '" + ryaInstanceName + "'.", e); } }
/** * Sets the Accumulo password from the configuration object that is meant to * be used when connecting a {@link Connector} to Accumulo. * */ public void setAccumuloPassword(final String password) { Preconditions.checkNotNull(password); set(CLOUDBASE_PASSWORD, password); }
/** * Sets up the configuration and prints the arguments. */ public void setUpConfig() { log.info("Setting " + driverName + " config"); // Setup config if (isMock) { configMap.put(MRUtils.AC_MOCK_PROP, Boolean.TRUE.toString()); } configMap.put(MRUtils.AC_INSTANCE_PROP, instanceName); configMap.put(MRUtils.AC_USERNAME_PROP, user); configMap.put(MRUtils.AC_PWD_PROP, userpwd); configMap.put(MRUtils.TABLE_PREFIX_PROPERTY, tablePrefix); configMap.put(MRUtils.AC_AUTH_PROP, auth); configMap.put(MRUtils.AC_ZK_PROP, zooKeepers != null ? zooKeepers : "localhost"); log.info(driverName + " config properties"); config.setTablePrefix(tablePrefix); for (final Entry<String, String> entry : configMap.entrySet()) { final String key = entry.getKey(); final String value = entry.getValue(); final String argument = ToolConfigUtils.makeArgument(isParent ? key : key + MergeTool.CHILD_SUFFIX, value); if (!key.equals(MRUtils.AC_PWD_PROP)) { log.info(argument); } config.set(key, value); } MergeTool.setDuplicateKeys(config); }
/** * Sets a comma delimited list of the names of the Zookeeper servers from * the configuration object that is meant to be used when connecting a * {@link Connector} to Accumulo. * */ public void setAccumuloZookeepers(final String zookeepers) { Preconditions.checkNotNull(zookeepers); set(CLOUDBASE_ZOOKEEPERS, zookeepers); }
/** * Sets up the configuration and prints the arguments. */ public void setUpConfig() { log.info("Setting " + driverName + " config"); // Setup config if (isMock) { configMap.put(MRUtils.AC_MOCK_PROP, Boolean.TRUE.toString()); } configMap.put(MRUtils.AC_INSTANCE_PROP, instanceName); configMap.put(MRUtils.AC_USERNAME_PROP, user); configMap.put(MRUtils.AC_PWD_PROP, userpwd); configMap.put(MRUtils.TABLE_PREFIX_PROPERTY, tablePrefix); configMap.put(MRUtils.AC_AUTH_PROP, auth); configMap.put(MRUtils.AC_ZK_PROP, zooKeepers != null ? zooKeepers : "localhost"); configMap.put(AccumuloExportConstants.ACCUMULO_INSTANCE_TYPE_PROP, instanceType.toString()); log.info(driverName + " config properties"); config.setTablePrefix(tablePrefix); for (final Entry<String, String> entry : configMap.entrySet()) { final String key = entry.getKey(); final String value = entry.getValue(); final String argument = "-D" + key + "=" + value; if (!key.equals(MRUtils.AC_PWD_PROP)) { log.info(argument); } config.set(key, value); } AccumuloExportConstants.setDuplicateKeys(config); }
/** * Sets the Accumulo username from the configuration object that is meant to * be used when connecting a {@link Connector} to Accumulo. * */ public void setAccumuloUser(String user) { Preconditions.checkNotNull(user); set(CLOUDBASE_USER, user); }
/** * Sets up the configuration and prints the arguments. */ public void setUpConfig() { log.info("Setting " + driverName + " config"); // Setup config if (isMock) { configMap.put(MRUtils.AC_MOCK_PROP, Boolean.TRUE.toString()); } configMap.put(MRUtils.AC_INSTANCE_PROP, instanceName); configMap.put(MRUtils.AC_USERNAME_PROP, user); configMap.put(MRUtils.AC_PWD_PROP, userpwd); configMap.put(MRUtils.TABLE_PREFIX_PROPERTY, tablePrefix); configMap.put(MRUtils.AC_AUTH_PROP, auth); configMap.put(MRUtils.AC_ZK_PROP, zooKeepers != null ? zooKeepers : "localhost"); configMap.put(AccumuloExportConstants.ACCUMULO_INSTANCE_TYPE_PROP, instanceType.toString()); log.info(driverName + " config properties"); config.setTablePrefix(tablePrefix); for (final Entry<String, String> entry : configMap.entrySet()) { final String key = entry.getKey(); final String value = entry.getValue(); final String argument = "-D" + key + "=" + value; if (!key.equals(MRUtils.AC_PWD_PROP)) { log.info(argument); } config.set(key, value); } AccumuloExportConstants.setDuplicateKeys(config); }
/** * Sets the Accumulo instance name from the configuration object that is * meant to be used when connecting a {@link Connector} to Accumulo. * */ public void setAccumuloInstance(String instance) { Preconditions.checkNotNull(instance); set(CLOUDBASE_INSTANCE, instance); }
private AccumuloRdfConfiguration makeConfig() { final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration(); conf.setTablePrefix(getRyaInstanceName()); // Accumulo connection information. conf.set(ConfigUtils.CLOUDBASE_USER, getUsername()); conf.set(ConfigUtils.CLOUDBASE_PASSWORD, getPassword()); conf.set(ConfigUtils.CLOUDBASE_INSTANCE, super.getMiniAccumuloCluster().getInstanceName()); conf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, super.getMiniAccumuloCluster().getZooKeepers()); conf.set(RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, "U,V,W"); return conf; }
/** * Sets the Accumulo instance name from the configuration object that is * meant to be used when connecting a {@link Connector} to Accumulo. * */ public void setAccumuloInstance(final String instance) { Preconditions.checkNotNull(instance); set(CLOUDBASE_INSTANCE, instance); }
/** * Sets the Accumulo password from the configuration object that is meant to * be used when connecting a {@link Connector} to Accumulo. * */ public void setAccumuloPassword(String password) { Preconditions.checkNotNull(password); set(CLOUDBASE_PASSWORD, password); }
/** * Sets a comma delimited list of the names of the Zookeeper servers from * the configuration object that is meant to be used when connecting a * {@link Connector} to Accumulo. * */ public void setAccumuloZookeepers(String zookeepers) { Preconditions.checkNotNull(zookeepers); set(CLOUDBASE_ZOOKEEPERS, zookeepers); }
public void setAdditionalIterators(final IteratorSetting... additionalIterators){ //TODO do we need to worry about cleaning up this.set(ITERATOR_SETTINGS_SIZE, Integer.toString(additionalIterators.length)); int i = 0; for(final IteratorSetting iterator : additionalIterators) { this.set(String.format(ITERATOR_SETTINGS_NAME, i), iterator.getName()); this.set(String.format(ITERATOR_SETTINGS_CLASS, i), iterator.getIteratorClass()); this.set(String.format(ITERATOR_SETTINGS_PRIORITY, i), Integer.toString(iterator.getPriority())); final Map<String, String> options = iterator.getOptions(); this.set(String.format(ITERATOR_SETTINGS_OPTIONS_SIZE, i), Integer.toString(options.size())); final Iterator<Entry<String, String>> it = options.entrySet().iterator(); int j = 0; while(it.hasNext()) { final Entry<String, String> item = it.next(); this.set(String.format(ITERATOR_SETTINGS_OPTIONS_KEY, i, j), item.getKey()); this.set(String.format(ITERATOR_SETTINGS_OPTIONS_VALUE, i, j), item.getValue()); j++; } i++; } }
public void setAdditionalIterators(IteratorSetting... additionalIterators){ //TODO do we need to worry about cleaning up this.set(ITERATOR_SETTINGS_SIZE, Integer.toString(additionalIterators.length)); int i = 0; for(IteratorSetting iterator : additionalIterators) { this.set(String.format(ITERATOR_SETTINGS_NAME, i), iterator.getName()); this.set(String.format(ITERATOR_SETTINGS_CLASS, i), iterator.getIteratorClass()); this.set(String.format(ITERATOR_SETTINGS_PRIORITY, i), Integer.toString(iterator.getPriority())); Map<String, String> options = iterator.getOptions(); this.set(String.format(ITERATOR_SETTINGS_OPTIONS_SIZE, i), Integer.toString(options.size())); Iterator<Entry<String, String>> it = options.entrySet().iterator(); int j = 0; while(it.hasNext()) { Entry<String, String> item = it.next(); this.set(String.format(ITERATOR_SETTINGS_OPTIONS_KEY, i, j), item.getKey()); this.set(String.format(ITERATOR_SETTINGS_OPTIONS_VALUE, i, j), item.getValue()); j++; } i++; } }