/** * Builds an Accumulo edge table range for a given SOURCE and SINK. The SOURCE is assumed to not be a regex expression. * * If including stats edges then only build range for the SOURCE and the SOURCE+SINK, no stats edges for SINK will be returned. */ private Set<Range> buildRange(IdentityContext source, IdentityContext sink) { String rowSource = getLeadingLiteral(source, false); String rowSink = getLeadingLiteral(sink, true); Set<Range> rangeSet = new HashSet<>(2); if (includeStats) { rangeSet.add(EdgeKeyUtil.createEscapedRange(rowSource, false, includeStats, false)); } boolean isSinkRegex = sink.getOperation().equals(EQUALS_REGEX); rangeSet.add(EdgeKeyUtil.createEscapedRange(rowSource, rowSink, isSinkRegex)); return rangeSet; }
for (String normalizedLiteral : EdgeKeyUtil.normalizeRegexSource(literal, regexDataTypes, true)) { try { // verify that the normalized regex is valid here instead of letting it fail on tserver for (String normalizedLiteral : EdgeKeyUtil.normalizeSource(literal, dataTypes, true)) { IdentityContext iContext = new IdentityContext(identifier, normalizedLiteral, operator); contexts.add(iContext);
boolean value = false; Map<FieldKey,String> keyComponents = EdgeKeyUtil.dissasembleKey(k, protobuffFormat);
/** * Builds an Accumulo edge table range for a given SOURCE. Gets the leading string literal and makes a range between the leading string literal and the Max * Unicode String Constant. * * Note: if not including stats edges then we can speed things up by setting the start key equal to the SOURCE + the null char, ONLY IF IT IS NOT A REGEX * EXPRESSION Also Note: with regex expressions we need to have the end of the end key set to the max unicode value but if it is just an equals expression * then the end key should end in unicode 1 that way we don't pick up extra sources * * Use this method when there is either no sink or the source is a regex expression */ private Range buildRange(IdentityContext source) { String rowID = getLeadingLiteral(source, false); boolean isRegexRange = source.getOperation().equals(EQUALS_REGEX); return EdgeKeyUtil.createEscapedRange(rowID, isRegexRange, includeStats, true); }
protected Set<Range> computeRanges(EdgeExtendedSummaryConfiguration configuration) { Set<Range> ranges = new HashSet<>(); String query = configuration.getQueryString(); String[] sources = StringUtils.split(query, configuration.getDelimiter()); for (String source : sources) { for (String normalizedSource : normalizeQualifiedSource(source)) { ranges.add(EdgeKeyUtil.createEscapedRange(normalizedSource, false, configuration.includeStats(), configuration.isIncludeRelationships())); } } return ranges; }