}
}
@Test
public void testGetMultipleFullyQualifiedColumns() throws Exception {
final KijiColumnName column1 = PRIMITIVE_STRING;
final KijiColumnName column2 = STRING_MAP_1;
for (int pageSize : ImmutableList.of(0, 1, 2, 10)) {
{ // Single version | no timerange
final KijiDataRequest request = KijiDataRequest
.builder()
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.add(column1.getFamily(), column1.getQualifier())
.add(column2.getFamily(), column2.getQualifier()))
.build();
final Iterable<? extends Entry<Long, ?>> column1Entries =
Iterables.limit(ROW_DATA.get(column1).entrySet(), 1);
final Iterable<? extends Entry<Long, ?>> column2Entries =
Iterables.limit(ROW_DATA.get(column2).entrySet(), 1);
testViewGet(request, Iterables.concat(column1Entries, column2Entries));
}
{ // Single version | timerange
final KijiDataRequest request = KijiDataRequest
.builder()
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.add(column1.getFamily(), column1.getQualifier())
.add(column2.getFamily(), column2.getQualifier()))
.withTimeRange(4, 6)
.build();
final Iterable<? extends Entry<Long, ?>> column1Entries =
Iterables.limit(ROW_DATA.get(column1).subMap(6L, false, 4L, true).entrySet(), 1);
final Iterable<? extends Entry<Long, ?>> column2Entries =
Iterables.limit(ROW_DATA.get(column2).subMap(6L, false, 4L, true).entrySet(), 1);
testViewGet(request, Iterables.concat(column1Entries, column2Entries));
}
{ // Multiple versions | no timerange
final KijiDataRequest request = KijiDataRequest
.builder()
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.withMaxVersions(100)
.add(column1.getFamily(), column1.getQualifier())
.add(column2.getFamily(), column2.getQualifier()))
.build();
final Iterable<? extends Entry<Long, ?>> column1Entries = ROW_DATA.get(column1).entrySet();
final Iterable<? extends Entry<Long, ?>> column2Entries = ROW_DATA.get(column2).entrySet();
testViewGet(request, Iterables.concat(column1Entries, column2Entries));
}
{ // Multiple versions | timerange
final KijiDataRequest request = KijiDataRequest
.builder()
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.withMaxVersions(100)
.add(column1.getFamily(), column1.getQualifier())
.add(column2.getFamily(), column2.getQualifier()))
.withTimeRange(4, 6)
.build();
final Iterable<? extends Entry<Long, ?>> column1Entries =
ROW_DATA.get(column1).subMap(6L, false, 4L, true).entrySet();
final Iterable<? extends Entry<Long, ?>> column2Entries =
ROW_DATA.get(column2).subMap(6L, false, 4L, true).entrySet();
testViewGet(request, Iterables.concat(column1Entries, column2Entries));
}
{ // Mixed versions | timerange
final KijiDataRequest request = KijiDataRequest
.builder()
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.withMaxVersions(100)
.add(column1.getFamily(), column1.getQualifier()))
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.withMaxVersions(1)
.add(column2.getFamily(), column2.getQualifier()))
.withTimeRange(4, 6)
.build();
final Iterable<? extends Entry<Long, ?>> column1Entries =
ROW_DATA.get(column1).subMap(6L, false, 4L, true).entrySet();
final Iterable<? extends Entry<Long, ?>> column2Entries =
Iterables.limit(ROW_DATA.get(column2).subMap(6L, false, 4L, true).entrySet(), 1);
testViewGet(request, Iterables.concat(column1Entries, column2Entries));
}
{ // Mixed versions | no timerange
final KijiDataRequest request = KijiDataRequest
.builder()
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.withMaxVersions(1)
.add(column1.getFamily(), column1.getQualifier()))
.addColumns(
ColumnsDef.create()
.withPageSize(pageSize)
.withMaxVersions(100)
.add(column2.getFamily(), column2.getQualifier()))
.build();
final Iterable<? extends Entry<Long, ?>> column1Entries =
Iterables.limit(ROW_DATA.get(column1).entrySet(), 1);
final Iterable<? extends Entry<Long, ?>> column2Entries =