/** * Calls the single update variant if there's only one update, otherwise calls batch. * MetaAlerts may defer to an implementation specific IndexDao. * @param updates The list of updates to run * @throws IOException If there's an update error */ protected void update(Map<Document, Optional<String>> updates) throws IOException { if (updates.size() == 1) { Entry<Document, Optional<String>> singleUpdate = updates.entrySet().iterator().next(); updateDao.update(singleUpdate.getKey(), singleUpdate.getValue()); } else if (updates.size() > 1) { updateDao.batchUpdate(updates); } // else we have no updates, so don't do anything }
getUpdateDao().batchUpdate(updates);