org.apache.accumulo.core.data.Range Java Examples
The following examples show how to use
org.apache.accumulo.core.data.Range.
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 File: DatawaveFieldIndexIteratorJexlTest.java From datawave with Apache License 2.0 | 6 votes |
@Test public void buildBoundingFiRange_notUpperInclusive_multiChar_test() throws IOException { DatawaveFieldIndexFilterIteratorJexl iteratorJexl = DatawaveFieldIndexFilterIteratorJexl.builder().upperInclusive(false).lowerInclusive(true) .withMaxRangeSplit(1).withFieldName("FIELD").withFieldValue("a").withUpperBound("az").withIvaratorCacheDirs(cacheDirs).build(); Text row = new Text("row"); Text fiName = new Text("fi" + Constants.NULL + "FIELD"); Text fieldValue = new Text("aa"); Text fieldValueNullAppended = new Text("aa" + Constants.NULL); List<Range> ranges = iteratorJexl.buildBoundingFiRanges(row, fiName, fieldValue); Assert.assertNotEquals(null, ranges); Assert.assertEquals(1, ranges.size()); Range r = ranges.get(0); // note that the end key is expected to be inclusive even though upperInclusive is set to false because the value has been decremented by one Assert.assertTrue(r.isStartKeyInclusive()); Assert.assertTrue(r.isEndKeyInclusive()); Assert.assertEquals(new Key(row, fiName, fieldValueNullAppended), r.getStartKey()); Assert.assertEquals(new Key(row, fiName, new Text("ay" + Constants.MAX_UNICODE_STRING)), r.getEndKey()); }
Example #2
Source File: AccumuloClient.java From presto with Apache License 2.0 | 6 votes |
/** * Gets a collection of Accumulo Range objects from the given Presto domain. * This maps the column constraints of the given Domain to an Accumulo Range scan. * * @param domain Domain, can be null (returns (-inf, +inf) Range) * @param serializer Instance of an {@link AccumuloRowSerializer} * @return A collection of Accumulo Range objects * @throws TableNotFoundException If the Accumulo table is not found */ public static Collection<Range> getRangesFromDomain(Optional<Domain> domain, AccumuloRowSerializer serializer) throws TableNotFoundException { // if we have no predicate pushdown, use the full range if (domain.isEmpty()) { return ImmutableSet.of(new Range()); } ImmutableSet.Builder<Range> rangeBuilder = ImmutableSet.builder(); for (io.prestosql.spi.predicate.Range range : domain.get().getValues().getRanges().getOrderedRanges()) { rangeBuilder.add(getRangeFromPrestoRange(range, serializer)); } return rangeBuilder.build(); }
Example #3
Source File: DocumentAggregatingIterator.java From datawave with Apache License 2.0 | 6 votes |
public void move(Key pointer) throws IOException { // check the current position if (nextKey != null && nextKey.compareTo(pointer) >= 0) { throw new IllegalStateException("Tried to call move when already at or beyond move point: topkey=" + nextKey + ", movekey=" + pointer); } if (!getSource().hasTop()) { // there is nothing beyond the current key nextKey = null; nextValue = null; document = null; } else if (getSource().getTopKey().compareTo(pointer) >= 0) { // load that into next next(); } else { // we have to seek seek(new Range(pointer, true, seekRange.getEndKey(), seekRange.isEndKeyInclusive()), seekColumnFamilies, seekInclusive); } }
Example #4
Source File: AccumuloCounterSource.java From datawave with Apache License 2.0 | 6 votes |
public static void main(String[] args) throws AccumuloException, AccumuloSecurityException { String instance = args[0]; String zookeepers = args[1]; String username = args[2]; String password = PasswordConverter.parseArg(args[3]); String table = args[4]; String startRow = args[5]; String endRow = args[6]; String columnFamily = args[7]; AccumuloCounterSource source = new AccumuloCounterSource(instance, zookeepers, username, password, table); Range range = new Range(startRow, endRow); source.addRange(range); source.addColumnFaily(columnFamily); CounterDump dumper = new CounterDump(source); System.out.println(dumper); }
Example #5
Source File: DescendantCountFunction.java From datawave with Apache License 2.0 | 6 votes |
private boolean skipExcessiveNumberOfDescendants(final String childSuffix, final Matcher matcher, final Text row, final String fiRootValue, final Key endKey) throws IOException { boolean skipped; if (matcher.find() && (matcher.start() < childSuffix.length())) { // Get the base matching child suffix final String baseMatch = childSuffix.substring(0, matcher.start()); // create the skipping range final Key skipStartKey = new Key(row, this.indexCf, new Text(fiRootValue + baseMatch + '0')); final Range skipRange = new Range(skipStartKey, true, endKey, false); // seek to the next first-generation child, if one exists final Set<ByteSequence> emptyCfs = Collections.emptySet(); this.source.seek(skipRange, emptyCfs, false); // Assign the return value skipped = true; } else { skipped = false; } return skipped; }
Example #6
Source File: AccumuloTemporalIndexer.java From rya with Apache License 2.0 | 6 votes |
/** * Get intervals stored in the repository matching the given interval. * Indexing Intervals will probably change or be removed. * Currently predicate and subject constraints are filtered on the client. */ @Override public CloseableIteration<Statement, QueryEvaluationException> queryIntervalEquals( final TemporalInterval query, final StatementConstraints contraints) throws QueryEvaluationException { final Scanner scanner = getScanner(); if (scanner != null) { // get rows where the start and end match. final Range range = Range.prefix(new Text(query.getAsKeyBeginning())); scanner.setRange(range); if (contraints.hasContext()) { scanner.fetchColumn(new Text(contraints.getContext().toString()), new Text(KeyParts.CQ_BEGIN)); } else { scanner.fetchColumn(new Text(""), new Text(KeyParts.CQ_BEGIN)); } } // Iterator<Entry<Key, Value>> iter = scanner.iterator(); // while (iter.hasNext()) { // System.out.println("queryIntervalEquals results:"+iter.next()); // } //return getConstrainedIteratorWrapper(scanner, contraints); return getIteratorWrapper(scanner); }
Example #7
Source File: AccumuloChangelogStore.java From accumulo-recipes with Apache License 2.0 | 6 votes |
/** * Gets the actual change objects that live inside of the specified buckets * * @param buckets dates representing time increments (i.e. 15 minutes) * @return */ @Override public CloseableIterable<Event> getChanges(Iterable<Date> buckets, Auths auths) { checkNotNull(buckets); checkNotNull(auths); try { final BatchScanner scanner = connector.createBatchScanner(tableName, auths.getAuths(), config.getMaxQueryThreads()); List<Range> ranges = new ArrayList<Range>(); for (Date date : buckets) { Range range = new Range(String.format("%d", truncatedReverseTimestamp(date.getTime(), bucketSize))); ranges.add(range); } scanner.setRanges(ranges); return transform(closeableIterable(scanner), entityTransform); } catch (TableNotFoundException e) { throw new RuntimeException(e); } }
Example #8
Source File: AccumuloTemporalIndexer.java From rya with Apache License 2.0 | 6 votes |
/** * Interval after given interval. Find intervals that begin after the endings of the given interval. * Use the special following prefix mechanism to avoid matching the beginning date. * Indexing Intervals will probably change or be removed. * Currently predicate and subject and context constraints are filtered on the client. */ @Override public CloseableIteration<Statement, QueryEvaluationException> queryIntervalAfter( final TemporalInterval queryInterval, final StatementConstraints constraints) throws QueryEvaluationException { final Scanner scanner = getScanner(); if (scanner != null) { // get rows where the start date is greater than the queryInterval.getEnd() final Range range = new Range(new Key(Range.followingPrefix(new Text(queryInterval.getHasEnd().getAsKeyBytes()))), false, null, true); scanner.setRange(range); if (constraints.hasContext()) { scanner.fetchColumn(new Text(constraints.getContext().toString()), new Text(KeyParts.CQ_BEGIN)); } else { scanner.fetchColumn(new Text(""), new Text(KeyParts.CQ_BEGIN)); } } // TODO currently predicate, subject and context constraints are filtered on the clients return getIteratorWrapper(scanner); }
Example #9
Source File: TermFrequencyIndexIteratorTest.java From datawave with Apache License 2.0 | 6 votes |
@Test public void testScanMinorRangeTLD() throws Exception { Range r = new Range(getFiKey("row", "type1", "123.345.456", "FOO", "baz"), true, getFiKey("row", "type1", "123.345.456", "FOO", "baz"), true); TermFrequencyAggregator aggregator = new TLDTermFrequencyAggregator(fieldsToKeep, filter, -1); TermFrequencyIndexIterator iterator = new TermFrequencyIndexIterator(r, source, null, typeMetadata, true, null, aggregator); // jump to the first doc iterator.seek(null, null, true); Assert.assertTrue(iterator.hasTop()); Document d = iterator.document(); Assert.assertTrue(d != null); Assert.assertTrue(d.getDictionary().size() == 2); Assert.assertTrue(d.getDictionary().get("FOO") != null); Assert.assertTrue(d.getDictionary().get("RECORD_ID") != null); Assert.assertTrue(d.getDictionary().get("FOO").getData() != null); Assert.assertTrue((d.getDictionary().get("FOO").getData()).equals("baz")); }
Example #10
Source File: AccumuloQueryRuleset.java From rya with Apache License 2.0 | 6 votes |
/** * Get the rules that apply to all statements within a Range. The range may not * contain every row relevant to the associated rule(s), but every row within the * range is relevant to the rule(s). * @param layout Defines which table the range is meant to scan * @param range The Range of rows in that table * @return Any rules in this ruleset that match the given table and contain the given range * @throws IOException if the Range can't be resolved */ public List<CopyRule> getRules(final TABLE_LAYOUT layout, final Range range) throws IOException { final List<CopyRule> matchingRules = new LinkedList<>(); for (final CopyRule rule : rules) { // Compare the rule to the given range final Map.Entry<TABLE_LAYOUT, ByteRange> entry = getRange(rule.getStatement()); final TABLE_LAYOUT ruleLayout = entry.getKey(); // If they apply to different tables, they are unrelated. if (!ruleLayout.equals(layout)) { continue; } // If the given range is contained in (or equal to) the rule's range, then the // rule matches and should be included. final ByteRange byteRange = entry.getValue(); final Range ruleRange = new Range(new Text(byteRange.getStart()), new Text(byteRange.getEnd())); if (rangeContainsRange(ruleRange, range)) { matchingRules.add(rule); } } return matchingRules; }
Example #11
Source File: BulkInputFormat.java From datawave with Apache License 2.0 | 6 votes |
private void clipRanges(Map<String,Map<KeyExtent,List<Range>>> binnedRanges) { // truncate the ranges to within the tablets... this makes it easier to know what work // needs to be redone when failures occurs and tablets have merged or split Map<String,Map<KeyExtent,List<Range>>> binnedRanges2 = new HashMap<>(); for (Entry<String,Map<KeyExtent,List<Range>>> entry : binnedRanges.entrySet()) { Map<KeyExtent,List<Range>> tabletMap = new HashMap<>(); binnedRanges2.put(entry.getKey(), tabletMap); for (Entry<KeyExtent,List<Range>> tabletRanges : entry.getValue().entrySet()) { Range tabletRange = tabletRanges.getKey().toDataRange(); List<Range> clippedRanges = new ArrayList<>(); tabletMap.put(tabletRanges.getKey(), clippedRanges); for (Range range : tabletRanges.getValue()) clippedRanges.add(tabletRange.clip(range)); } } binnedRanges.clear(); binnedRanges.putAll(binnedRanges2); }
Example #12
Source File: AccumuloTemporalIndexer.java From rya with Apache License 2.0 | 6 votes |
/** * get statements where the date object is after the given queryInstant. */ @Override public CloseableIteration<Statement, QueryEvaluationException> queryInstantAfterInstant( final TemporalInstant queryInstant, final StatementConstraints constraints) throws QueryEvaluationException { final Query query = new Query() { @Override public Range getRange(final KeyParts keyParts) { final Text start = Range.followingPrefix(keyParts.getQueryKey()); // <-- specific logic Text endAt = null; // no constraints // <-- specific logic if (keyParts.constraintPrefix != null ) { endAt = Range.followingPrefix(keyParts.constraintPrefix); } //System.out.println("Scanning queryInstantAfterInstant from after:" + KeyParts.toHumanString(start) + " up to:" + KeyParts.toHumanString(endAt)); return new Range(start, true, endAt, false); } }; final ScannerBase scanner = query.doQuery(queryInstant, constraints); return getContextIteratorWrapper(scanner, constraints.getContext()); }
Example #13
Source File: UpgradeCounterValues.java From datawave with Apache License 2.0 | 6 votes |
private void parseConfig(String[] args) throws ParseException { CommandLine cl = new BasicParser().parse(options, args); instanceName = cl.getOptionValue(instanceNameOpt.getOpt()); zookeepers = cl.getOptionValue(zookeeperOpt.getOpt()); username = cl.getOptionValue(usernameOpt.getOpt()); password = cl.getOptionValue(passwordOpt.getOpt()); tableName = cl.getOptionValue(tableNameOpt.getOpt()); ranges = new ArrayList<>(); if (!cl.hasOption(rangesOpt.getOpt())) { System.out.println("NOTE: no ranges specified on the command line. Scanning the entire table."); ranges.add(new Range()); } else { for (String rangeStr : cl.getOptionValues(rangesOpt.getOpt())) { String[] startEnd = rangeStr.split("\\s*,\\s*"); ranges.add(new Range(startEnd[0], false, startEnd[1], false)); } System.out.println("Using ranges: " + ranges); } if (cl.hasOption(bsThreadsOpt.getOpt())) bsThreads = Integer.parseInt(cl.getOptionValue(bsThreadsOpt.getOpt())); if (cl.hasOption(bwThreadsOpt.getOpt())) bwThreads = Integer.parseInt(cl.getOptionValue(bwThreadsOpt.getOpt())); if (cl.hasOption(bwMemoryOpt.getOpt())) bwMemory = Long.parseLong(cl.getOptionValue(bwMemoryOpt.getOpt())); }
Example #14
Source File: RangeBindingSetEntries.java From rya with Apache License 2.0 | 6 votes |
public Collection<BindingSet> containsKey(Key key) { Set<BindingSet> bsSet = new HashSet<>(); for (Range range : ranges.keySet()) { // Check to see if the Key falls within Range and has same ColumnFamily // as beginning and ending key of Range. // The additional ColumnFamily check by the method // validateContext(...) is necessary because range.contains(key) // returns true if only the Row is within the Range but the ColumnFamily // doesn't fall within the Range ColumnFamily bounds. if (range.contains(key) && validateContext(key.getColumnFamily(), range.getStartKey().getColumnFamily(), range.getEndKey().getColumnFamily())) { bsSet.addAll(ranges.get(range)); } } return bsSet; }
Example #15
Source File: TupleToRangeTest.java From datawave with Apache License 2.0 | 6 votes |
@Test public void testGenerateDocumentRanges() { String shard = "20190314_0"; Set<String> docIds = Sets.newHashSet("docId0", "docId1", "docId2"); IndexInfo indexInfo = new IndexInfo(docIds); indexInfo.applyNode(queryNode); // Build expected shard ranges List<Range> expectedRanges = new ArrayList<>(3); expectedRanges.add(makeTestRange(shard, "docId0")); expectedRanges.add(makeTestRange(shard, "docId1")); expectedRanges.add(makeTestRange(shard, "docId2")); // Create the ranges Iterator<QueryPlan> ranges = TupleToRange.createDocumentRanges(queryNode, shard, indexInfo, config.isTldQuery()); // Assert ranges against expected ranges eval(expectedRanges, ranges); }
Example #16
Source File: GeoTemporalTweetQuery.java From OSTMap with Apache License 2.0 | 6 votes |
/** * @return ranges for rowkeys [0-255][startDay-endDay][setOfGeohashes] */ private List<Range> getRangeList() { List<Range> rangeList = new ArrayList<>(); Coverage coverage = GeoHash.coverBoundingBoxMaxHashes(north, west, south, east, 100); log.debug("coverage: [size:" + coverage.getHashes().size() + ", ratio:" + coverage.getRatio() + "]"); Set<String> hashes = coverage.getHashes(); for (String hash : hashes) { for (short day = startDay; day <= endDay; day++) { for (int spreadingByte = 0; spreadingByte <= 255; spreadingByte++) { ByteBuffer startKey = ByteBuffer.allocate(3 + hash.length()); if (hash.length() > 8) { hash = hash.substring(0, 8); } startKey.put((byte) spreadingByte).putShort(day).put(hash.getBytes()); rangeList.add(Range.prefix(new Text(startKey.array()))); } } } return rangeList; }
Example #17
Source File: EnrichingIterator.java From datawave with Apache License 2.0 | 6 votes |
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { if (this.subIter == null) { return; } this.subIter.seek(range, columnFamilies, inclusive); if (this.subIter.hasTop()) { this.topKey = this.subIter.getTopKey(); this.topValue = this.subIter.getTopValue(); if (this.topKey != null) { this.enrich(); } } else { this.topKey = null; this.topValue = null; } }
Example #18
Source File: DatawaveFieldIndexCachingIteratorJexl.java From datawave with Apache License 2.0 | 6 votes |
/** * Does the last range seeked contain the passed in range * * @param r * @return true if there is a last seeked range and it contains the passed in range */ protected boolean lastRangeSeekedContains(Range r) { boolean subRange = false; if (this.lastRangeSeeked != null) { Key beginOfThisRange = r.getStartKey(); Key endOfThisRange = r.getEndKey(); subRange = true; if (beginOfThisRange == null && this.lastRangeSeeked.getStartKey() != null) { subRange = false; } else if (!Objects.equal(beginOfThisRange, this.lastRangeSeeked.getStartKey()) && !this.lastRangeSeeked.contains(beginOfThisRange)) { subRange = false; } else if (endOfThisRange == null && this.lastRangeSeeked.getEndKey() != null) { subRange = false; } else if (!Objects.equal(endOfThisRange, this.lastRangeSeeked.getEndKey()) && !this.lastRangeSeeked.contains(endOfThisRange)) { subRange = false; } } return subRange; }
Example #19
Source File: AccumuloSelectivityEvalDAO.java From rya with Apache License 2.0 | 5 votes |
public int getTableSize(RdfCloudTripleStoreConfiguration conf) throws TableNotFoundException { Authorizations authorizations = getAuths(conf); if (joinMap.containsKey("subjectpredicateobject" + DELIM + "FullTableCardinality")) { FullTableCardinality = joinMap.get("subjectpredicateobject" + DELIM + "FullTableCardinality").intValue(); return FullTableCardinality; } if (FullTableCardinality == 0) { Scanner joinScanner = connector.createScanner(tableLayoutStrategy.getSelectivity(), authorizations); joinScanner.setRange(Range.prefix(new Text("subjectpredicateobject" + DELIM + "FullTableCardinality"))); Iterator<Map.Entry<Key,Value>> iterator = joinScanner.iterator(); if (iterator.hasNext()) { Map.Entry<Key,Value> entry = iterator.next(); if (entry.getKey().getColumnFamily().toString().equals("FullTableCardinality")) { String Count = entry.getKey().getColumnQualifier().toString(); FullTableCardinality = Integer.parseInt(Count); } } if (FullTableCardinality == 0) { throw new RuntimeException("Table does not contain full cardinality"); } } return FullTableCardinality; }
Example #20
Source File: RangeStreamScanner.java From datawave with Apache License 2.0 | 5 votes |
/** * @param tableName * @param auths * @param delegator * @param maxResults */ public RangeStreamScanner(String tableName, Set<Authorizations> auths, ResourceQueue delegator, int maxResults, Query settings, SessionOptions options, Collection<Range> ranges) { super(tableName, auths, delegator, maxResults, settings, options, ranges); delegatedResourceInitializer = BatchResource.class; currentQueue = Queues.newArrayDeque(); readLock = queueLock.readLock(); writeLock = queueLock.writeLock(); myExecutor = MoreExecutors.sameThreadExecutor(); if (null != stats) initializeTimers(); }
Example #21
Source File: RangeSplit.java From datawave with Apache License 2.0 | 5 votes |
public void write(DataOutput out) throws IOException { out.writeInt(ranges.size()); for (Range range : ranges) range.write(out); out.writeInt(locations.length); for (int i = 0; i < locations.length; ++i) out.writeUTF(locations[i]); }
Example #22
Source File: PredicateHandlerTest.java From accumulo-hive-storage-manager with Apache License 2.0 | 5 votes |
@Test() public void rangeGreaterThan() { setup(); ExprNodeDesc column = new ExprNodeColumnDesc(TypeInfoFactory.stringTypeInfo, "rid", null, false); ExprNodeDesc constant = new ExprNodeConstantDesc(TypeInfoFactory.stringTypeInfo, "aaa"); List<ExprNodeDesc> children = Lists.newArrayList(); children.add(column); children.add(constant); ExprNodeDesc node = new ExprNodeGenericFuncDesc(TypeInfoFactory.stringTypeInfo, new GenericUDFOPGreaterThan(), children); assertNotNull(node); String filterExpr = Utilities.serializeExpression(node); conf.set(TableScanDesc.FILTER_EXPR_CONF_STR, filterExpr); try { Collection<Range> ranges = handler.getRanges(conf); assertEquals(ranges.size(), 1); Range range = ranges.iterator().next(); assertTrue(range.isStartKeyInclusive()); assertFalse(range.isEndKeyInclusive()); assertFalse(range.contains(new Key(new Text("aaa")))); assertFalse(range.afterEndKey(new Key(new Text("ccccc")))); assertTrue(range.contains(new Key(new Text("aab")))); assertTrue(range.beforeStartKey(new Key(new Text("aa")))); assertTrue(range.beforeStartKey(new Key(new Text("aaa")))); } catch (Exception e) { fail("Error getting search conditions"); } }
Example #23
Source File: ElementTableWrapper.java From AccumuloGraph with Apache License 2.0 | 5 votes |
/** * Return true if the element with given id exists. * @param id * @return */ public boolean elementExists(String id) { Scanner scan = null; try { scan = getScanner(); scan.setRange(Range.exact(id)); scan.fetchColumnFamily(new Text(Constants.LABEL)); return new PropertyParser().parse(scan) != null; } finally { if (scan != null) { scan.close(); } } }
Example #24
Source File: TermFrequencyIndexIteratorTest.java From datawave with Apache License 2.0 | 5 votes |
@Test public void testEndingFieldMismatch() throws IOException, ParseException { Range r = new Range(getFiKey("row", "type1", "123.345.456.3", "FOO", "alf"), true, getFiKey("row", "type1", "123.345.456.3", Constants.MAX_UNICODE_STRING, "buz"), false); filter = new EventDataQueryExpressionFilter(JexlASTHelper.parseJexlQuery("FOO=='bar' || FOO=='baz' || FOO=='buf' || FOO=='arm'"), typeMetadata, fieldsToKeep); aggregator = new TermFrequencyAggregator(fieldsToKeep, filter); TermFrequencyIndexIterator iterator = new TermFrequencyIndexIterator(r, source, null, typeMetadata, true, null, aggregator); // jump to the first doc iterator.seek(null, null, true); Assert.assertFalse(iterator.hasTop()); }
Example #25
Source File: SourceManager.java From datawave with Apache License 2.0 | 5 votes |
@Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { lastKey = null; lastValue = null; rangeDone = false; if (null != child) { if (log.isDebugEnabled()) log.debug("DeepCopy at " + sourceQueue.size() + ", deepCopies: " + deepCopiesCalled + ", sources: " + sources + " child seek to " + range); child.seek(range, columnFamilies, inclusive); lastKey = child.getTopKey(); lastValue = child.getTopValue(); if (lastKey == null) { rangeDone = true; } } else { // we are a child source node and must be resought if (log.isDebugEnabled()) log.debug("DeepCopy at " + sourceQueue.size() + ", deepCopies: " + deepCopiesCalled + ", sources: " + sources + " original source seek to " + range); if (null != originalSource) { originalSource.seek(range, columnFamilies, inclusive); if (originalSource.hasTop()) { lastKey = originalSource.getTopKey(); lastValue = originalSource.getTopValue(); } } } lastRange = range; this.columnFamilies = columnFamilies; this.inclusive = inclusive; }
Example #26
Source File: DatawaveFieldIndexRangeIteratorJexl.java From datawave with Apache License 2.0 | 5 votes |
protected Range buildCompositeSafeFiRange(Text rowId, Text fiName, Text fieldValue) { if (subRanges != null && !subRanges.isEmpty()) { return currentFiRange; } else { Key startKey = new Key(rowId, fiName, new Text(fieldValue)); Key endKey = new Key(rowId, fiName, new Text(upperBound)); return new Range(startKey, lowerInclusive, endKey, upperInclusive); } }
Example #27
Source File: AggregationIterator.java From geowave with Apache License 2.0 | 5 votes |
@Override public void seek( final Range seekRange, final Collection<ByteSequence> columnFamilies, final boolean inclusive) throws IOException { aggregationReturned = false; aggregationFunction.clearResult(); startRowOfAggregation = null; parent.seek(seekRange, columnFamilies, inclusive); }
Example #28
Source File: JobSetupUtil.java From datawave with Apache License 2.0 | 5 votes |
public static Range formatReverseTimeRange(Range dayRange, Logger log) { long start = Long.parseLong(dayRange.getStartKey().getRow().toString()); long end = Long.parseLong(dayRange.getEndKey().getRow().toString()); String from = DateHelper.format(new Date(start)); String until = DateHelper.format(new Date(end)); return new Range(from, true, until, false); }
Example #29
Source File: AnyFieldScanner.java From datawave with Apache License 2.0 | 5 votes |
/** * @param tableName * @param auths * @param delegator * @param maxResults */ public AnyFieldScanner(String tableName, Set<Authorizations> auths, ResourceQueue delegator, int maxResults, Query settings, SessionOptions options, Collection<Range> ranges) { super(tableName, auths, delegator, maxResults, settings, options, ranges); // ensure that we only use a local uncaught exception handler instead of the one in settings as exceptions may not // be critical to the overall query execution this.uncaughtExceptionHandler = new QueryUncaughtExceptionHandler(); }
Example #30
Source File: BaseTableCache.java From datawave with Apache License 2.0 | 5 votes |
public void setupScanner(BatchScanner scanner) { scanner.setRanges(Lists.newArrayList(new Range())); Map<String,String> options = new HashMap<>(); options.put(RegExFilter.COLF_REGEX, "^f$"); options.put("negate", "true"); IteratorSetting settings = new IteratorSetting(100, "skipFColumn", RegExFilter.class, options); scanner.addScanIterator(settings); }