Interface for reading data from a Kiji table.
Utilizes {@link org.kiji.schema.EntityId} and {@link org.kiji.schema.KijiDataRequest}to return {@link org.kiji.schema.KijiRowData} or a {@link org.kiji.schema.KijiRowScanner}to iterate across rows in a Kiji table.
To get the three most recent versions of cell data from a column bar
from the family foo
within the time range (123, 456):
{@code KijiDataRequestBuilder builder = KijiDataRequest.builder() .withTimeRange(123L, 456L); .newColumnsDef() .withMaxVersions(3) .add("foo", "bar"); final KijiDataRequest request = builder.build(); final KijiTableReader reader = myKijiTable.openTableReader(); final KijiRowData data = reader.get(myEntityId, request);}
To get a row scanner across many records using the same column and version restrictions from above:
{@code final KijiRowScanner scanner = reader.getScanner(request); final KijiScannerOptions options = new KijiScannerOptions() .setStartRow(myStartRow) .setStopRow(myStopRow); final KijiRowScanner limitedScanner = reader.getScanner(request, options);}
If a KijiScannerOptions is not set, the scanner will iterate over all rows in the table (as in the case of
scanner
). By default, Kiji row scanners automatically handle HBase scanner timeouts and reopen the HBase scanner as needed. This behavior may be disabled using {@link KijiScannerOptions#setReopenScannerOnTimeout(boolean)}. Finally, row caching may be configured via KijiScannerOptions. By default, row caching is configured from the Hadoop Configuration property {@code hbase.client.scanner.caching}.
Instantiated in Kiji Schema via {@link org.kiji.schema.KijiTable#openTableReader()}.
Unless otherwise specified, readers are not thread-safe and must be synchronized externally.