[ https://issues.apache.org/jira/browse/RYA-284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044453#comment-16044453 ]
ASF GitHub Bot commented on RYA-284: ------------------------------------ Github user thn-w commented on a diff in the pull request: https://github.com/apache/incubator-rya/pull/169#discussion_r121130647 --- Diff: dao/accumulo.rya/src/main/java/org/apache/rya/accumulo/query/AccumuloRyaQueryEngine.java --- @@ -374,56 +387,64 @@ protected String getData(RyaType ryaType) { final TripleRowRegex tripleRowRegex = strategy.buildRegex(regexSubject, regexPredicate, regexObject, null, null); final String table = layoutToTable(layout, tableLayoutStrategy); - boolean useBatchScanner = ranges.size() > maxRanges; + final boolean useBatchScanner = ranges.size() > maxRanges; FluentCloseableIterable<RyaStatement> results = null; if (useBatchScanner) { - BatchScanner scanner = connector.createBatchScanner(table, authorizations, numQueryThreads); + final BatchScanner scanner = connector.createBatchScanner(table, authorizations, numQueryThreads); scanner.setRanges(ranges); fillScanner(scanner, context, null, ttl, null, tripleRowRegex, ryaQuery.getConf()); - results = FluentCloseableIterable.from(new ScannerBaseCloseableIterable(scanner)) - .transform(keyValueToRyaStatementFunctionMap.get(layout)); - } else { + results = FluentCloseableIterable.from(new ScannerBaseCloseableIterable(scanner)).transform(keyValueToRyaStatementFunctionMap.get(layout)); + } + else { final RyaURI fcontext = context; final RdfCloudTripleStoreConfiguration fconf = ryaQuery.getConf(); - FluentIterable<RyaStatement> fluent = FluentIterable.from(ranges) - .transformAndConcat(new Function<Range, Iterable<Map.Entry<Key, Value>>>() { - @Override - public Iterable<Map.Entry<Key, Value>> apply(Range range) { - try { - Scanner scanner = connector.createScanner(table, authorizations); - scanner.setRange(range); - fillScanner(scanner, fcontext, null, ttl, null, tripleRowRegex, fconf); - return scanner; - } catch (Exception e) { - throw new RuntimeException(e); - } - } - }).transform(keyValueToRyaStatementFunctionMap.get(layout)); + final FluentIterable<RyaStatement> fluent = FluentIterable.from(ranges).transformAndConcat(range -> { + try { + final Scanner scanner = connector.createScanner(table, authorizations); + scanner.setRange(range); + fillScanner(scanner, fcontext, null, ttl, null, tripleRowRegex, fconf); + return scanner; + } + catch (final Exception e) { + throw new RuntimeException(e); + } + }).transform(keyValueToRyaStatementFunctionMap.get(layout)); results = FluentCloseableIterable.from(CloseableIterables.wrap(fluent)); } if (maxResults != null) { results = results.limit(maxResults.intValue()); } return results; - } catch (Exception e) { + } + catch (final Exception e) { throw new RyaDAOException(e); } } - protected void fillScanner(ScannerBase scanner, RyaURI context, String qualifier, Long ttl, Long currentTime, - TripleRowRegex tripleRowRegex, RdfCloudTripleStoreConfiguration conf) throws IOException { - if (context != null && qualifier != null) { + private static Text createText(final byte[] data, final RyaType ryaType) throws RyaTypeResolverException { --- End diff -- Okay. Will put up a new PR with the new method name. > Enhance accumulo.rya to support the use of bloom filter > ------------------------------------------------------- > > Key: RYA-284 > URL: https://issues.apache.org/jira/browse/RYA-284 > Project: Rya > Issue Type: Improvement > Components: dao > Reporter: Tri H. Nguyen > Assignee: Tri H. Nguyen > Priority: Minor > > Enhancing accumulo.rya to take advantage of the use of bloom filter when > enabled in accumulo > Accumulo's Bloom Filter example > https://accumulo.apache.org/1.8/examples/bloom -- This message was sent by Atlassian JIRA (v6.3.15#6346)