Search in sources :

Example 6 with VerifyParams

use of org.apache.accumulo.test.VerifyIngest.VerifyParams in project accumulo by apache.

the class ReadWriteIT method verify.

private static void verify(AccumuloClient accumuloClient, ClientInfo info, int rows, int cols, int width, int offset, String colf, String tableName) throws Exception {
    VerifyParams params = new VerifyParams(info.getProperties(), tableName, rows);
    params.rows = rows;
    params.dataSize = width;
    params.startRow = offset;
    params.columnFamily = colf;
    params.cols = cols;
    VerifyIngest.verifyIngest(accumuloClient, params);
}
Also used : VerifyParams(org.apache.accumulo.test.VerifyIngest.VerifyParams)

Example 7 with VerifyParams

use of org.apache.accumulo.test.VerifyIngest.VerifyParams in project accumulo by apache.

the class RestartIT method killedTabletServer.

@Test
public void killedTabletServer() throws Exception {
    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
        String tableName = getUniqueNames(1)[0];
        c.tableOperations().create(tableName);
        VerifyParams params = new VerifyParams(getClientProps(), tableName, 10_000);
        TestIngest.ingest(c, params);
        VerifyIngest.verifyIngest(c, params);
        cluster.getClusterControl().stopAllServers(ServerType.TABLET_SERVER);
        cluster.start();
        VerifyIngest.verifyIngest(c, params);
    }
}
Also used : AccumuloClient(org.apache.accumulo.core.client.AccumuloClient) VerifyParams(org.apache.accumulo.test.VerifyIngest.VerifyParams) Test(org.junit.Test)

Example 8 with VerifyParams

use of org.apache.accumulo.test.VerifyIngest.VerifyParams in project accumulo by apache.

the class RestartIT method shutdownDuringCompactingSplitting.

@Test
public void shutdownDuringCompactingSplitting() throws Exception {
    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
        String tableName = getUniqueNames(1)[0];
        VerifyParams params = new VerifyParams(getClientProps(), tableName, 10_000);
        c.tableOperations().create(tableName);
        c.tableOperations().setProperty(tableName, Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K");
        String splitThreshold = null;
        for (Entry<String, String> entry : c.tableOperations().getProperties(tableName)) {
            if (entry.getKey().equals(Property.TABLE_SPLIT_THRESHOLD.getKey())) {
                splitThreshold = entry.getValue();
                break;
            }
        }
        assertNotNull(splitThreshold);
        try {
            c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), "20K");
            TestIngest.ingest(c, params);
            c.tableOperations().flush(tableName, null, null, false);
            VerifyIngest.verifyIngest(c, params);
            getCluster().stop();
        } finally {
            if (getClusterType() == ClusterType.STANDALONE) {
                getCluster().start();
                c.tableOperations().setProperty(MetadataTable.NAME, Property.TABLE_SPLIT_THRESHOLD.getKey(), splitThreshold);
            }
        }
    }
}
Also used : AccumuloClient(org.apache.accumulo.core.client.AccumuloClient) VerifyParams(org.apache.accumulo.test.VerifyIngest.VerifyParams) Test(org.junit.Test)

Example 9 with VerifyParams

use of org.apache.accumulo.test.VerifyIngest.VerifyParams in project accumulo by apache.

the class RestartIT method restartManager.

@Test
public void restartManager() throws Exception {
    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
        final String tableName = getUniqueNames(1)[0];
        c.tableOperations().create(tableName);
        final ClusterControl control = getCluster().getClusterControl();
        VerifyParams params = new VerifyParams(getClientProps(), tableName, 10_000);
        Future<Integer> ret = svc.submit(() -> {
            try {
                return control.exec(TestIngest.class, new String[] { "-c", cluster.getClientPropsPath(), "--rows", "" + params.rows, "--table", tableName });
            } catch (IOException e) {
                log.error("Error running TestIngest", e);
                return -1;
            }
        });
        control.stopAllServers(ServerType.MANAGER);
        control.startAllServers(ServerType.MANAGER);
        assertEquals(0, ret.get().intValue());
        VerifyIngest.verifyIngest(c, params);
    }
}
Also used : AccumuloClient(org.apache.accumulo.core.client.AccumuloClient) VerifyParams(org.apache.accumulo.test.VerifyIngest.VerifyParams) IOException(java.io.IOException) ClusterControl(org.apache.accumulo.cluster.ClusterControl) Test(org.junit.Test)

Example 10 with VerifyParams

use of org.apache.accumulo.test.VerifyIngest.VerifyParams in project accumulo by apache.

the class ChaoticBalancerIT method test.

@Test
public void test() throws Exception {
    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
        String[] names = getUniqueNames(1);
        String tableName = names[0];
        NewTableConfiguration ntc = new NewTableConfiguration();
        ntc.setProperties(Stream.of(new Pair<>(Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K"), new Pair<>(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE.getKey(), "1K")).collect(Collectors.toMap(Pair::getFirst, Pair::getSecond)));
        c.tableOperations().create(tableName, ntc);
        VerifyParams params = new VerifyParams(getClientProps(), tableName, 20_000);
        TestIngest.ingest(c, params);
        c.tableOperations().flush(tableName, null, null, true);
        VerifyIngest.verifyIngest(c, params);
    }
}
Also used : AccumuloClient(org.apache.accumulo.core.client.AccumuloClient) NewTableConfiguration(org.apache.accumulo.core.client.admin.NewTableConfiguration) VerifyParams(org.apache.accumulo.test.VerifyIngest.VerifyParams) Pair(org.apache.accumulo.core.util.Pair) Test(org.junit.Test)

Aggregations

VerifyParams (org.apache.accumulo.test.VerifyIngest.VerifyParams)20 Test (org.junit.Test)16 AccumuloClient (org.apache.accumulo.core.client.AccumuloClient)15 ClusterControl (org.apache.accumulo.cluster.ClusterControl)5 Path (org.apache.hadoop.fs.Path)4 IOException (java.io.IOException)3 FileSystem (org.apache.hadoop.fs.FileSystem)3 AccumuloException (org.apache.accumulo.core.client.AccumuloException)2 AccumuloSecurityException (org.apache.accumulo.core.client.AccumuloSecurityException)2 Scanner (org.apache.accumulo.core.client.Scanner)2 NewTableConfiguration (org.apache.accumulo.core.client.admin.NewTableConfiguration)2 ClientInfo (org.apache.accumulo.core.clientImpl.ClientInfo)2 TableId (org.apache.accumulo.core.data.TableId)2 KeyExtent (org.apache.accumulo.core.dataImpl.KeyExtent)2 ZooCache (org.apache.accumulo.fate.zookeeper.ZooCache)2 ZooReader (org.apache.accumulo.fate.zookeeper.ZooReader)2 IngestParams (org.apache.accumulo.test.TestIngest.IngestParams)2 FileNotFoundException (java.io.FileNotFoundException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1