/** * For a given key / value pair that has been written to the db, write * additional entries to the db for each primary filter. */ private static long writePrimaryFilterEntries(WriteBatch writeBatch, Map<String, Set<Object>> primaryFilters, byte[] key, byte[] value) throws IOException { long putCount = 0; if (primaryFilters != null) { for (Entry<String, Set<Object>> pf : primaryFilters.entrySet()) { for (Object pfval : pf.getValue()) { writeBatch.put(addPrimaryFilterToKey(pf.getKey(), pfval, key), value); ++putCount; } } } return putCount; }