Assert.assertEquals(partitionStrategy, ds.getDescriptor()
.getPartitionStrategy());
writeTestUsers(ds, 10);
checkTestUsers(ds, 10);
PartitionKey key0 = new PartitionKey(0);
PartitionKey key1 = new PartitionKey(1);
int total = readTestUsersInPartition(ds, key0, "email_hash")
+ readTestUsersInPartition(ds, key0, "email_hash");
Assert.assertEquals(10, total);
total = 0;
for (int i1 = 0; i1 < 2; i1++) {
for (int i2 = 0; i2 < 3; i2++) {
String part = "username_hash=" + i1 + "/email_hash=" + i2;
Assert.assertTrue("Partitioned directory " + part + " exists",
fileSystem.exists(new Path(testDirectory, part)));
total += readTestUsersInPartition(ds,
new PartitionKey(i1, i2), null);
}
}
Assert.assertEquals(10, total);
testPartitionKeysAreEqual(ds, key0, key1);