Search in sources :

Example 21 with InstanceId

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);
    }
}
Also used : AccumuloClient(org.apache.accumulo.core.client.AccumuloClient) InstanceId(org.apache.accumulo.core.data.InstanceId) Initialize(org.apache.accumulo.server.init.Initialize) Test(org.junit.Test)

Example 22 with InstanceId

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;
}
Also used : InstanceId(org.apache.accumulo.core.data.InstanceId) Admin(org.apache.accumulo.server.util.Admin)

Example 23 with InstanceId

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);
    }
}
Also used : AccumuloClient(org.apache.accumulo.core.client.AccumuloClient) InstanceId(org.apache.accumulo.core.data.InstanceId) Initialize(org.apache.accumulo.server.init.Initialize) Test(org.junit.Test)

Aggregations

InstanceId (org.apache.accumulo.core.data.InstanceId)23 Test (org.junit.Test)8 IOException (java.io.IOException)6 ZooReaderWriter (org.apache.accumulo.fate.zookeeper.ZooReaderWriter)6 AccumuloClient (org.apache.accumulo.core.client.AccumuloClient)5 TableId (org.apache.accumulo.core.data.TableId)5 ServerContext (org.apache.accumulo.server.ServerContext)5 Path (org.apache.hadoop.fs.Path)5 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)4 KeeperException (org.apache.zookeeper.KeeperException)4 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)3 Socket (java.net.Socket)3 SiteConfiguration (org.apache.accumulo.core.conf.SiteConfiguration)3 ZooReader (org.apache.accumulo.fate.zookeeper.ZooReader)3 Initialize (org.apache.accumulo.server.init.Initialize)3 Configuration (org.apache.hadoop.conf.Configuration)3 AccumuloException (org.apache.accumulo.core.client.AccumuloException)2 TableNotFoundException (org.apache.accumulo.core.client.TableNotFoundException)2 NamespaceId (org.apache.accumulo.core.data.NamespaceId)2 AdminUtil (org.apache.accumulo.fate.AdminUtil)2