/** * This functionality should be resolved in the higher level which is * MemStoreScanner, currently returns true as default. Doesn't throw * IllegalStateException in order not to change the signature of the * overridden method */ @Override public boolean shouldUseScanner(Scan scan, HStore store, long oldestUnexpiredTS) { return getSegment().shouldSeek(scan.getColumnFamilyTimeRange() .getOrDefault(store.getColumnFamilyDescriptor().getName(), scan.getTimeRange()), oldestUnexpiredTS); }
@Override public boolean shouldUseScanner(Scan scan, HStore store, long oldestUnexpiredTS) { // if the file has no entries, no need to validate or create a scanner. byte[] cf = store.getColumnFamilyDescriptor().getName(); TimeRange timeRange = scan.getColumnFamilyTimeRange().get(cf); if (timeRange == null) { timeRange = scan.getTimeRange(); } return reader.passesTimerangeFilter(timeRange, oldestUnexpiredTS) && reader .passesKeyRangeFilter(scan) && reader.passesBloomFilter(scan, scan.getFamilyMap().get(cf)); }
kvs = toKeyValue(row, data.get(row), scan.getTimeRange().getMin(), scan.getTimeRange().getMax(), scan.getMaxVersions()); } else { continue; for (Long timestamp : data.get(row).get(family).get(qualifier).descendingKeySet()) { if (timestamp < scan.getTimeRange().getMin()) continue; if (timestamp > scan.getTimeRange().getMax()) continue; byte[] value = data.get(row).get(family).get(qualifier).get(timestamp);
protected UserScanQueryMatcher(Scan scan, ScanInfo scanInfo, ColumnTracker columns, boolean hasNullColumn, long oldestUnexpiredTS, long now) { super(createStartKey(scan, scanInfo), scanInfo, columns, oldestUnexpiredTS, now); this.hasNullColumn = hasNullColumn; this.filter = scan.getFilter(); if (this.filter != null) { this.versionsAfterFilter = scan.isRaw() ? scan.getMaxVersions() : Math.min(scan.getMaxVersions(), scanInfo.getMaxVersions()); } else { this.versionsAfterFilter = 0; } this.stopRow = scan.getStopRow(); TimeRange timeRange = scan.getColumnFamilyTimeRange().get(scanInfo.getFamily()); if (timeRange == null) { this.tr = scan.getTimeRange(); } else { this.tr = timeRange; } }
model.setStartTime(scan.getTimeRange().getMin()); model.setEndTime(scan.getTimeRange().getMax()); int caching = scan.getCaching(); if (caching > 0) {
tTimeRange.setMinStamp(in.getTimeRange().getMin()).setMaxStamp(in.getTimeRange().getMax()); out.setTimeRange(tTimeRange); out.setBatchSize(in.getBatch());
@Override public void preScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Scan scan) throws IOException { Region region = c.getEnvironment().getRegion(); TableName tableName = region.getTableDescriptor().getTableName(); Long ttl = this.ttls.get(tableName); if (ttl != null) { scan.setTimeRange(EnvironmentEdgeManager.currentTime() - ttl, scan.getTimeRange().getMax()); } Integer version = this.versions.get(tableName); if (version != null) { scan.readVersions(version); } } }
small = scan.isSmall(); allowPartialResults = scan.getAllowPartialResults(); tr = scan.getTimeRange(); // TimeRange is immutable Map<byte[], NavigableSet<byte[]>> fams = scan.getFamilyMap(); for (Map.Entry<byte[],NavigableSet<byte[]>> entry : fams.entrySet()) {
TimeRange tr = scan.getTimeRange(); TimeRange desTr = desScan.getTimeRange(); assertEquals(tr.getMax(), desTr.getMax()); assertEquals(tr.getMin(), desTr.getMin());
Scan scan = ExportUtils.getScanFromCommandLine(UTIL.getConfiguration(), args); assertEquals(version, scan.getMaxVersions()); assertEquals(startTime, scan.getTimeRange().getMin()); assertEquals(endTime, scan.getTimeRange().getMax()); assertEquals(true, (scan.getFilter() instanceof PrefixFilter)); assertEquals(0, Bytes.compareTo(((PrefixFilter) scan.getFilter()).getPrefix(), Bytes.toBytesBinary(prefix))); Scan scanWithLabels = ExportUtils.getScanFromCommandLine(conf, otherArgs); assertEquals(version, scanWithLabels.getMaxVersions()); assertEquals(startTime, scanWithLabels.getTimeRange().getMin()); assertEquals(endTime, scanWithLabels.getTimeRange().getMax()); assertEquals(true, (scanWithLabels.getFilter() instanceof PrefixFilter)); assertEquals(0, Bytes.compareTo(((PrefixFilter) scanWithLabels.getFilter()).getPrefix(), Bytes.toBytesBinary(prefix)));
@Override public RegionScanner answer(InvocationOnMock invocation) throws Throwable { Scan sArg = (Scan) invocation.getArguments()[0]; TimeRange timeRange = sArg.getTimeRange(); return getMockTimeRangeRegionScanner(timeRange); } });
.build()); }); scanBuilder.setTimeRange(toTimeRange(scan.getTimeRange())); Map<String, byte[]> attributes = scan.getAttributesMap(); if (!attributes.isEmpty()) {
.build()); }); scanBuilder.setTimeRange(ProtobufUtil.toTimeRange(scan.getTimeRange())); Map<String, byte[]> attributes = scan.getAttributesMap(); if (!attributes.isEmpty()) {
assertEquals(get.getMaxVersions(), scan.getMaxVersions()); assertEquals(get.getRowOffsetPerColumnFamily(), scan.getRowOffsetPerColumnFamily()); assertEquals(get.getTimeRange().getMin(), scan.getTimeRange().getMin()); assertEquals(get.getTimeRange().getMax(), scan.getTimeRange().getMax()); assertTrue(Bytes.equals(get.getAttribute("att_v0"), scan.getAttribute("att_v0"))); assertEquals(get.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMin(),
assertEquals(scan.getStartRow(), scanCopy.getStartRow()); assertEquals(scan.getStopRow(), scanCopy.getStopRow()); assertEquals(scan.getTimeRange(), scanCopy.getTimeRange());
small = scan.isSmall(); allowPartialResults = scan.getAllowPartialResults(); tr = scan.getTimeRange(); // TimeRange is immutable Map<byte[], NavigableSet<byte[]>> fams = scan.getFamilyMap(); for (Map.Entry<byte[],NavigableSet<byte[]>> entry : fams.entrySet()) {
@Override public void preScannerOpen(org.apache.hadoop.hbase.coprocessor.ObserverContext<RegionCoprocessorEnvironment> c, Scan scan) throws IOException { byte[] txnScn = scan.getAttribute(TX_SCN); if (txnScn!=null) { TimeRange timeRange = scan.getTimeRange(); scan.setTimeRange(timeRange.getMin(), Bytes.toLong(txnScn)); } if (isRegionObserverFor(scan)) { // For local indexes, we need to throw if out of region as we'll get inconsistent // results otherwise while in other cases, it may just mean out client-side data // on region boundaries is out of date and can safely be ignored. if (!skipRegionBoundaryCheck(scan) || ScanUtil.isLocalIndex(scan)) { throwIfScanOutOfRegion(scan, c.getEnvironment().getRegion()); } // Muck with the start/stop row of the scan and set as reversed at the // last possible moment. You need to swap the start/stop and make the // start exclusive and the stop inclusive. ScanUtil.setupReverseScan(scan); } }
Long scn = connection.getSCN(); try { if (ScanUtil.isDefaultTimeRange(scan.getTimeRange())) { if (scn == null) { scn = mutationPlan.getContext().getCurrentTime();
assertEquals(get.getMaxVersions(), scan.getMaxVersions()); assertEquals(get.getRowOffsetPerColumnFamily(), scan.getRowOffsetPerColumnFamily()); assertEquals(get.getTimeRange().getMin(), scan.getTimeRange().getMin()); assertEquals(get.getTimeRange().getMax(), scan.getTimeRange().getMax()); assertTrue(Bytes.equals(get.getAttribute("att_v0"), scan.getAttribute("att_v0"))); assertEquals(get.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMin(),
assertEquals(scan.getStartRow(), scanCopy.getStartRow()); assertEquals(scan.getStopRow(), scanCopy.getStopRow()); assertEquals(scan.getTimeRange(), scanCopy.getTimeRange());