use of org.apache.rya.api.client.Install.InstallConfiguration in project incubator-rya by apache.
the class RyaAdminCommandsTest method installWithAccumuloParameters_userAbort.
@Test
public void installWithAccumuloParameters_userAbort() throws DuplicateInstanceNameException, RyaClientException, IOException {
// Mock the object that performs the install operation.
final Install mockInstall = mock(Install.class);
final RyaClient mockCommands = mock(RyaClient.class);
when(mockCommands.getInstall()).thenReturn(mockInstall);
final SharedShellState state = new SharedShellState();
state.connectedToAccumulo(mock(AccumuloConnectionDetails.class), mockCommands);
final String instanceName = "unitTests";
final boolean enableTableHashPrefix = false;
final boolean enableEntityCentricIndex = true;
final boolean enableFreeTextIndex = false;
final boolean enableTemporalIndex = false;
final boolean enablePcjIndex = true;
final String fluoPcjAppName = instanceName + "pcj_updater";
// Execute the command.
final InstallConfiguration installConfig = InstallConfiguration.builder().setEnableTableHashPrefix(enableTableHashPrefix).setEnableEntityCentricIndex(enableEntityCentricIndex).setEnableFreeTextIndex(enableFreeTextIndex).setEnableTemporalIndex(enableTemporalIndex).setEnablePcjIndex(enablePcjIndex).setFluoPcjAppName(fluoPcjAppName).build();
final InstallPrompt mockInstallPrompt = mock(InstallPrompt.class);
when(mockInstallPrompt.promptInstanceName()).thenReturn(instanceName);
when(mockInstallPrompt.promptInstallConfiguration(instanceName)).thenReturn(installConfig);
when(mockInstallPrompt.promptVerified(eq(instanceName), eq(installConfig))).thenReturn(false);
final RyaAdminCommands commands = new RyaAdminCommands(state, mockInstallPrompt, mock(SparqlPrompt.class), mock(UninstallPrompt.class));
final String message = commands.installWithAccumuloParameters(instanceName, enableTableHashPrefix, enableEntityCentricIndex, enableFreeTextIndex, enableTemporalIndex, enablePcjIndex, fluoPcjAppName);
// Verify a message is returned that indicates the success of the operation.
final String expected = "Skipping Installation.";
assertEquals(expected, message);
}
use of org.apache.rya.api.client.Install.InstallConfiguration 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;
}
use of org.apache.rya.api.client.Install.InstallConfiguration in project incubator-rya by apache.
the class AccumuloInstallIT method install.
@Test
public void install() throws AccumuloException, AccumuloSecurityException, DuplicateInstanceNameException, RyaClientException, NotInitializedException, RyaDetailsRepositoryException {
// Install an instance of Rya.
final String instanceName = getRyaInstanceName();
final AccumuloConnectionDetails connectionDetails = new AccumuloConnectionDetails(getUsername(), getPassword().toCharArray(), getInstanceName(), getZookeepers());
final RyaClient ryaClient = AccumuloRyaClientFactory.build(connectionDetails, getConnector());
final InstallConfiguration installConfig = InstallConfiguration.builder().setEnableTableHashPrefix(false).setEnableEntityCentricIndex(false).setEnableFreeTextIndex(false).setEnableTemporalIndex(false).setEnablePcjIndex(false).setEnableGeoIndex(false).build();
ryaClient.getInstall().install(instanceName, installConfig);
// Check that the instance exists.
assertTrue(ryaClient.getInstanceExists().exists(instanceName));
}
use of org.apache.rya.api.client.Install.InstallConfiguration in project incubator-rya by apache.
the class AccumuloInstallIT method install_withIndexers.
@Test
public void install_withIndexers() throws AccumuloException, AccumuloSecurityException, DuplicateInstanceNameException, RyaClientException, NotInitializedException, RyaDetailsRepositoryException {
// Install an instance of Rya.
final String instanceName = getRyaInstanceName();
final AccumuloConnectionDetails connectionDetails = new AccumuloConnectionDetails(getUsername(), getPassword().toCharArray(), getInstanceName(), getZookeepers());
final RyaClient ryaClient = AccumuloRyaClientFactory.build(connectionDetails, getConnector());
final InstallConfiguration installConfig = InstallConfiguration.builder().setEnableTableHashPrefix(true).setEnableEntityCentricIndex(true).setEnableFreeTextIndex(true).setEnableTemporalIndex(true).setEnablePcjIndex(true).setEnableGeoIndex(true).build();
ryaClient.getInstall().install(instanceName, installConfig);
// Check that the instance exists.
assertTrue(ryaClient.getInstanceExists().exists(instanceName));
}
use of org.apache.rya.api.client.Install.InstallConfiguration in project incubator-rya by apache.
the class AccumuloInstallIT method install_alreadyExists.
@Test(expected = DuplicateInstanceNameException.class)
public void install_alreadyExists() throws DuplicateInstanceNameException, RyaClientException, AccumuloException, AccumuloSecurityException {
// Install an instance of Rya.
final String instanceName = getRyaInstanceName();
final AccumuloConnectionDetails connectionDetails = new AccumuloConnectionDetails(getUsername(), getPassword().toCharArray(), getInstanceName(), getZookeepers());
final RyaClient ryaClient = AccumuloRyaClientFactory.build(connectionDetails, getConnector());
final InstallConfiguration installConfig = InstallConfiguration.builder().build();
ryaClient.getInstall().install(instanceName, installConfig);
// Install it again.
ryaClient.getInstall().install(instanceName, installConfig);
}
Aggregations