Search in sources :

Example 1 with AccumuloInstall

use of org.apache.rya.api.client.accumulo.AccumuloInstall in project incubator-rya by apache.

the class FluoITBase method setupRya.

/**
 * Sets up a Rya instance.
 */
protected RyaSailRepository setupRya() throws AccumuloException, AccumuloSecurityException, RepositoryException, RyaDAOException, NumberFormatException, UnknownHostException, InferenceEngineException, AlreadyInitializedException, RyaDetailsRepositoryException, DuplicateInstanceNameException, RyaClientException, SailException {
    checkNotNull(instanceName);
    checkNotNull(zookeepers);
    // Setup Rya configuration values.
    final AccumuloRdfConfiguration conf = new AccumuloRdfConfiguration();
    conf.setTablePrefix(getRyaInstanceName());
    conf.setDisplayQueryPlan(true);
    conf.setBoolean(ConfigUtils.USE_MOCK_INSTANCE, false);
    conf.set(ConfigUtils.CLOUDBASE_USER, clusterInstance.getUsername());
    conf.set(ConfigUtils.CLOUDBASE_PASSWORD, clusterInstance.getPassword());
    conf.set(ConfigUtils.CLOUDBASE_INSTANCE, clusterInstance.getInstanceName());
    conf.set(ConfigUtils.CLOUDBASE_ZOOKEEPERS, clusterInstance.getZookeepers());
    conf.set(ConfigUtils.USE_PCJ, "true");
    conf.set(ConfigUtils.FLUO_APP_NAME, getRyaInstanceName());
    conf.set(ConfigUtils.PCJ_STORAGE_TYPE, PrecomputedJoinIndexerConfig.PrecomputedJoinStorageType.ACCUMULO.toString());
    conf.set(ConfigUtils.PCJ_UPDATER_TYPE, PrecomputedJoinIndexerConfig.PrecomputedJoinUpdaterType.FLUO.toString());
    conf.set(ConfigUtils.CLOUDBASE_AUTHS, "");
    // Install the test instance of Rya.
    final Install install = new AccumuloInstall(createConnectionDetails(), accumuloConn);
    final InstallConfiguration installConfig = InstallConfiguration.builder().setEnableTableHashPrefix(true).setEnableEntityCentricIndex(true).setEnableFreeTextIndex(true).setEnableTemporalIndex(true).setEnablePcjIndex(true).setEnableGeoIndex(true).setFluoPcjAppName(getRyaInstanceName()).build();
    install.install(getRyaInstanceName(), installConfig);
    // Connect to the instance of Rya that was just installed.
    final Sail sail = RyaSailFactory.getInstance(conf);
    final RyaSailRepository ryaRepo = new RyaSailRepository(sail);
    return ryaRepo;
}
Also used : AccumuloInstall(org.apache.rya.api.client.accumulo.AccumuloInstall) Sail(org.openrdf.sail.Sail) RyaSailRepository(org.apache.rya.rdftriplestore.RyaSailRepository) AccumuloRdfConfiguration(org.apache.rya.accumulo.AccumuloRdfConfiguration) AccumuloInstall(org.apache.rya.api.client.accumulo.AccumuloInstall) Install(org.apache.rya.api.client.Install) InstallConfiguration(org.apache.rya.api.client.Install.InstallConfiguration)

Aggregations

AccumuloRdfConfiguration (org.apache.rya.accumulo.AccumuloRdfConfiguration)1 Install (org.apache.rya.api.client.Install)1 InstallConfiguration (org.apache.rya.api.client.Install.InstallConfiguration)1 AccumuloInstall (org.apache.rya.api.client.accumulo.AccumuloInstall)1 RyaSailRepository (org.apache.rya.rdftriplestore.RyaSailRepository)1 Sail (org.openrdf.sail.Sail)1