/** Adds a new resolved (meaning it maps docIDs to new values) doc values packet. We buffer these in RAM and write to disk when too much * RAM is used or when a merge needs to kick off, or a commit/refresh. */ public synchronized void addDVUpdate(DocValuesFieldUpdates update) throws IOException { if (update.getFinished() == false) { throw new IllegalArgumentException("call finish first"); } List<DocValuesFieldUpdates> fieldUpdates = pendingDVUpdates.computeIfAbsent(update.field, key -> new ArrayList<>()); assert assertNoDupGen(fieldUpdates, update); ramBytesUsed.addAndGet(update.ramBytesUsed()); fieldUpdates.add(update); if (isMerging) { fieldUpdates = mergingDVUpdates.get(update.field); if (fieldUpdates == null) { fieldUpdates = new ArrayList<>(); mergingDVUpdates.put(update.field, fieldUpdates); } fieldUpdates.add(update); } }
/** Adds a new resolved (meaning it maps docIDs to new values) doc values packet. We buffer these in RAM and write to disk when too much * RAM is used or when a merge needs to kick off, or a commit/refresh. */ public synchronized void addDVUpdate(DocValuesFieldUpdates update) throws IOException { if (update.getFinished() == false) { throw new IllegalArgumentException("call finish first"); } List<DocValuesFieldUpdates> fieldUpdates = pendingDVUpdates.computeIfAbsent(update.field, key -> new ArrayList<>()); assert assertNoDupGen(fieldUpdates, update); ramBytesUsed.addAndGet(update.ramBytesUsed()); fieldUpdates.add(update); if (isMerging) { fieldUpdates = mergingDVUpdates.get(update.field); if (fieldUpdates == null) { fieldUpdates = new ArrayList<>(); mergingDVUpdates.put(update.field, fieldUpdates); } fieldUpdates.add(update); } }