use of org.apache.accumulo.core.data.InstanceId in project accumulo by apache.
the class VolumeIT method testNonConfiguredVolumes.
@Test
public void testNonConfiguredVolumes() throws Exception {
String[] tableNames = getUniqueNames(2);
try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
InstanceId uuid = verifyAndShutdownCluster(client, tableNames[0]);
updateConfig(config -> config.setProperty(Property.INSTANCE_VOLUMES.getKey(), v2 + "," + v3));
// initialize volume
assertEquals(0, cluster.exec(Initialize.class, "--add-volumes").getProcess().waitFor());
checkVolumesInitialized(Arrays.asList(v1, v2, v3), uuid);
// start cluster and verify that new volume is used
cluster.start();
// verify we can still read the tables (tableNames[0] is likely to have a file still on v1)
verifyData(expected, client.createScanner(tableNames[0], Authorizations.EMPTY));
// v1 should not have any data for tableNames[1]
verifyVolumesUsed(client, tableNames[1], false, v2, v3);
}
}
use of org.apache.accumulo.core.data.InstanceId in project accumulo by apache.
the class VolumeIT method verifyAndShutdownCluster.
// grab uuid before shutting down cluster
private InstanceId verifyAndShutdownCluster(AccumuloClient c, String tableName) throws Exception {
InstanceId uuid = c.instanceOperations().getInstanceId();
verifyVolumesUsed(c, tableName, false, v1, v2);
assertEquals(0, cluster.exec(Admin.class, "stopAll").getProcess().waitFor());
cluster.stop();
return uuid;
}
use of org.apache.accumulo.core.data.InstanceId in project accumulo by apache.
the class VolumeIT method testAddVolumes.
@Test
public void testAddVolumes() throws Exception {
try (AccumuloClient client = Accumulo.newClient().from(getClientProperties()).build()) {
String[] tableNames = getUniqueNames(2);
InstanceId uuid = verifyAndShutdownCluster(client, tableNames[0]);
updateConfig(config -> config.setProperty(Property.INSTANCE_VOLUMES.getKey(), v1 + "," + v2 + "," + v3));
// initialize volume
assertEquals(0, cluster.exec(Initialize.class, "--add-volumes").getProcess().waitFor());
checkVolumesInitialized(Arrays.asList(v1, v2, v3), uuid);
// start cluster and verify that new volume is used
cluster.start();
verifyVolumesUsed(client, tableNames[1], false, v1, v2, v3);
}
}
Aggregations