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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to