Java Code Examples for org.apache.hadoop.hbase.client.Scan#getBatch()
The following examples show how to use
org.apache.hadoop.hbase.client.Scan#getBatch() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hbase File: ThriftTable.java License: Apache License 2.0 | 5 votes |
public Scanner(Scan scan) throws IOException { if (scan.getBatch() > 0) { throw new IOException("Batch is not supported in Scanner"); } if (scan.getCaching() <= 0) { scan.setCaching(scannerCaching); } else if (scan.getCaching() == 1 && scan.isReversed()){ // for reverse scan, we need to pass the last row to the next scanner // we need caching number bigger than 1 scan.setCaching(scan.getCaching() + 1); } this.scan = ThriftUtilities.scanFromHBase(scan); }
Example 2
Source Project: spliceengine File: MemStoreFlushAwareScanner.java License: GNU Affero General Public License v3.0 | 5 votes |
public MemStoreFlushAwareScanner(HRegion region, Store store, ScanInfo scanInfo, Scan scan, final NavigableSet<byte[]> columns, long readPt, AtomicReference<MemstoreAware> memstoreAware, MemstoreAware initialValue) throws IOException { super((HStore) store, scanInfo, scan, columns, readPt); if (LOG.isDebugEnabled()) SpliceLogUtils.debug(LOG, "init for region=%s, scan=%s", region.getRegionInfo().getRegionNameAsString(),scan); this.memstoreAware = memstoreAware; this.initialValue = initialValue; this.region = region; this.stopRow = Bytes.equals(scan.getStopRow(), HConstants.EMPTY_END_ROW) ? null : scan.getStopRow(); this.filter = scan.getFilter(); this.batch = scan.getBatch(); }
Example 3
Source Project: hbase File: ScannerModel.java License: Apache License 2.0 | 4 votes |
/** * @param scan the scan specification * @throws Exception */ public static ScannerModel fromScan(Scan scan) throws Exception { ScannerModel model = new ScannerModel(); model.setStartRow(scan.getStartRow()); model.setEndRow(scan.getStopRow()); Map<byte [], NavigableSet<byte []>> families = scan.getFamilyMap(); if (families != null) { for (Map.Entry<byte [], NavigableSet<byte []>> entry : families.entrySet()) { if (entry.getValue() != null) { for (byte[] qualifier: entry.getValue()) { model.addColumn(Bytes.add(entry.getKey(), COLUMN_DIVIDER, qualifier)); } } else { model.addColumn(entry.getKey()); } } } model.setStartTime(scan.getTimeRange().getMin()); model.setEndTime(scan.getTimeRange().getMax()); int caching = scan.getCaching(); if (caching > 0) { model.setCaching(caching); } int batch = scan.getBatch(); if (batch > 0) { model.setBatch(batch); } int maxVersions = scan.getMaxVersions(); if (maxVersions > 0) { model.setMaxVersions(maxVersions); } if (scan.getLimit() > 0) { model.setLimit(scan.getLimit()); } Filter filter = scan.getFilter(); if (filter != null) { model.setFilter(stringifyFilter(filter)); } // Add the visbility labels if found in the attributes Authorizations authorizations = scan.getAuthorizations(); if (authorizations != null) { List<String> labels = authorizations.getLabels(); for (String label : labels) { model.addLabel(label); } } return model; }