use of org.apache.accumulo.core.client.AccumuloClient in project accumulo by apache.
the class ShellCreateTableIT method testCreateTableWithSplitsFile3.
/**
* Use shell to create a table with a supplied file containing splits.
*
* The splits will be contained in a file, sorted and encoded with no repeats or blank lines.
*/
@Test
public void testCreateTableWithSplitsFile3() throws IOException, AccumuloSecurityException, TableNotFoundException, AccumuloException {
String splitsFile = System.getProperty("user.dir") + "/target/splitFile";
try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
generateSplitsFile(splitsFile, 100, 23, false, true, true, false, false);
SortedSet<Text> expectedSplits = readSplitsFromFile(splitsFile);
final String tableName = getUniqueNames(1)[0];
ts.exec("createtable " + tableName + " -sf " + splitsFile, true);
Collection<Text> createdSplits = client.tableOperations().listSplits(tableName);
assertEquals(expectedSplits, new TreeSet<>(createdSplits));
} finally {
Files.delete(Paths.get(splitsFile));
}
}
use of org.apache.accumulo.core.client.AccumuloClient in project accumulo by apache.
the class ShellCreateTableIT method testCreateTableWithBinarySplitsFile3.
/**
* Use shell to create a table with a supplied file containing splits.
*
* The splits will be contained in a file, sorted and encoded with no repeats or blank lines.
*/
@Test
public void testCreateTableWithBinarySplitsFile3() throws IOException, AccumuloSecurityException, TableNotFoundException, AccumuloException {
String splitsFile = System.getProperty("user.dir") + "/target/splitFile";
try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
generateSplitsFile(splitsFile, 100, 23, true, true, true, false, false);
SortedSet<Text> expectedSplits = readSplitsFromFile(splitsFile);
final String tableName = getUniqueNames(1)[0];
ts.exec("createtable " + tableName + " -sf " + splitsFile, true);
Collection<Text> createdSplits = client.tableOperations().listSplits(tableName);
assertEquals(expectedSplits, new TreeSet<>(createdSplits));
} finally {
Files.delete(Paths.get(splitsFile));
}
}
use of org.apache.accumulo.core.client.AccumuloClient in project accumulo by apache.
the class ShellCreateTableIT method testCreateTableWithBinarySplitsFile2.
/**
* Use shell to create a table with a supplied file containing splits.
*
* The splits will be contained in a file, unsorted and encoded with no repeats or blank lines.
*/
@Test
public void testCreateTableWithBinarySplitsFile2() throws IOException, AccumuloSecurityException, TableNotFoundException, AccumuloException {
String splitsFile = System.getProperty("user.dir") + "/target/splitFile";
try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
generateSplitsFile(splitsFile, 300, 12, true, true, false, false, false);
SortedSet<Text> expectedSplits = readSplitsFromFile(splitsFile);
final String tableName = getUniqueNames(1)[0];
ts.exec("createtable " + tableName + " -sf " + splitsFile, true);
Collection<Text> createdSplits = client.tableOperations().listSplits(tableName);
assertEquals(expectedSplits, new TreeSet<>(createdSplits));
} finally {
Files.delete(Paths.get(splitsFile));
}
}
use of org.apache.accumulo.core.client.AccumuloClient in project accumulo by apache.
the class ShellCreateTableIT method testCreateTableWithBinarySplitsFile5.
/**
* Use shell to create a table with a supplied file containing splits.
*
* The splits will be contained in a file, sorted and encoded with a blank line and no repeats.
*/
@Test
public void testCreateTableWithBinarySplitsFile5() throws IOException, AccumuloSecurityException, TableNotFoundException, AccumuloException {
String splitsFile = System.getProperty("user.dir") + "/target/splitFile";
try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
generateSplitsFile(splitsFile, 100, 32, true, true, true, false, true);
SortedSet<Text> expectedSplits = readSplitsFromFile(splitsFile);
final String tableName = getUniqueNames(1)[0];
ts.exec("createtable " + tableName + " -sf " + splitsFile, true);
Collection<Text> createdSplits = client.tableOperations().listSplits(tableName);
assertEquals(expectedSplits, new TreeSet<>(createdSplits));
} finally {
Files.delete(Paths.get(splitsFile));
}
}
use of org.apache.accumulo.core.client.AccumuloClient in project accumulo by apache.
the class ShellCreateTableIT method testCreateTableWithBinarySplitsFile6.
/**
* Use shell to create a table with a supplied file containing splits.
*
* The splits will be contained in a file, unsorted and encoded with a blank line and repeats.
*/
@Test
public void testCreateTableWithBinarySplitsFile6() throws IOException, AccumuloSecurityException, TableNotFoundException, AccumuloException {
String splitsFile = System.getProperty("user.dir") + "/target/splitFile";
try (AccumuloClient client = Accumulo.newClient().from(getClientProps()).build()) {
generateSplitsFile(splitsFile, 100, 12, true, true, false, true, true);
SortedSet<Text> expectedSplits = readSplitsFromFile(splitsFile);
final String tableName = getUniqueNames(1)[0];
ts.exec("createtable " + tableName + " -sf " + splitsFile, true);
Collection<Text> createdSplits = client.tableOperations().listSplits(tableName);
assertEquals(expectedSplits, new TreeSet<>(createdSplits));
} finally {
Files.delete(Paths.get(splitsFile));
}
}
Aggregations