@Override protected void map(StaticBuffer key, Iterable<Entry> values, Context context) throws IOException, InterruptedException { EntryArrayList al = EntryArrayList.of(values); // KeyFilter check if (!keyFilter.test(key)) { log.debug("Skipping key {} based on KeyFilter", key); return; } // InitialQuery check (at least one match is required or else the key is ignored) EntryList initialQueryMatches = findEntriesMatchingQuery(initialQuery, al); if (0 == initialQueryMatches.size()) { log.debug("Skipping key {} based on InitialQuery ({}) match failure", key, initialQuery); return; } // Both conditions (KeyFilter && InitialQuery) for invoking process are satisfied // Create an entries parameter to be passed into the process method Map<SliceQuery, EntryList> matches = new HashMap<>(); matches.put(initialQuery, initialQueryMatches); // Find matches (if any are present) for subsequent queries for (SliceQuery sq : subsequentQueries) { matches.put(sq, findEntriesMatchingQuery(sq, al)); } // Process job.process(key, matches, metrics); }
@Override protected void map(StaticBuffer key, Iterable<Entry> values, Context context) throws IOException, InterruptedException { EntryArrayList al = EntryArrayList.of(values); // KeyFilter check if (!keyFilter.test(key)) { log.debug("Skipping key {} based on KeyFilter", key); return; } // InitialQuery check (at least one match is required or else the key is ignored) EntryList initialQueryMatches = findEntriesMatchingQuery(initialQuery, al); if (0 == initialQueryMatches.size()) { log.debug("Skipping key {} based on InitialQuery ({}) match failure", key, initialQuery); return; } // Both conditions (KeyFilter && InitialQuery) for invoking process are satisfied // Create an entries parameter to be passed into the process method Map<SliceQuery, EntryList> matches = new HashMap<>(); matches.put(initialQuery, initialQueryMatches); // Find matches (if any are present) for subsequent queries for (SliceQuery sq : subsequentQueries) { matches.put(sq, findEntriesMatchingQuery(sq, al)); } // Process job.process(key, matches, metrics); }
return EntryArrayList.of(sortedEntries.subList(lowestStartMatch, endIndex /* exclusive */)); } else { return EntryList.EMPTY_LIST;
return EntryArrayList.of(sortedEntries.subList(lowestStartMatch, endIndex /* exclusive */)); } else { return EntryList.EMPTY_LIST;