/** * find distinct values for a key * * @param key * The key * @return The results */ public List distinct(String key) { return distinct(key, new BasicDBObject()); }
@Override public void run() { while (!stop) { try { shouldUpdate.acquire(); if (stop) { break; } List<FailureCause> list = new LinkedList<FailureCause>(); DBCursor<FailureCause> dbCauses = jacksonCollection.find(NOT_REMOVED_QUERY); while (dbCauses.hasNext()) { list.add(dbCauses.next()); } cachedFailureCauses = list; categories = jacksonCollection.distinct("categories"); } catch (MongoException e) { logger.log(Level.SEVERE, "MongoException caught when updating cache: ", e); } catch (InterruptedException e) { logger.log(Level.WARNING, "Updater thread interrupted", e); } } } /**