final CassandraKijiTable table,
final KijiTableLayout layout,
final CassandraColumnNameTranslator columnTranslator,
final CellDecoderProvider decoderProvider
) throws IOException {
final KijiDataRequestBuilder unpagedRequestBuilder = KijiDataRequest.builder();
final KijiDataRequestBuilder pagedRequestBuilder = KijiDataRequest.builder();
unpagedRequestBuilder.withTimeRange(
dataRequest.getMinTimestamp(),
dataRequest.getMaxTimestamp());
pagedRequestBuilder.withTimeRange(dataRequest.getMinTimestamp(), dataRequest.getMaxTimestamp());
for (final Column columnRequest : dataRequest.getColumns()) {
if (columnRequest.getFilter() != null) {
throw new UnsupportedOperationException(
String.format("Cassandra Kiji does not support filters on column requests: %s.",
columnRequest));
}
if (columnRequest.isPagingEnabled()) {
pagedRequestBuilder.newColumnsDef(columnRequest);
} else {
unpagedRequestBuilder.newColumnsDef(columnRequest);
}
}
final CellDecoderProvider requestDecoderProvider =
decoderProvider.getDecoderProviderForRequest(dataRequest);
final KijiDataRequest unpagedRequest = unpagedRequestBuilder.build();
final KijiDataRequest pagedRequest = pagedRequestBuilder.build();
if (unpagedRequest.isEmpty() && pagedRequest.isEmpty()) {
return new EmptyKijiResult<T>(entityId, dataRequest);
}