@Override
public void addAccountNamesToNewQueue(List<String> accountNameList) {
Hashtable<String, AlertEvaluation> alertEvaluationHash = new Hashtable<>();
for (BasicAlertEvaluation alertEvaluation: RiakAbstractDao.getListFromRiakBucket(riakClient, newAlertEvaluationQueueBucketKey, new BasicAlertEvaluation(), BasicAlertEvaluation.class)) {
if (alertEvaluation != null && alertEvaluation.getAccountName() != null) {
alertEvaluationHash.put(alertEvaluation.getAccountName(), alertEvaluation);
}
}
//Add only the new AlertEvaluations to the new queue
List<BasicAlertEvaluation> alertEvaluationsToAdd = new ArrayList<>();
for (String account : accountNameList) {
if (alertEvaluationHash.get(account) == null) {
BasicAlertEvaluation newAlertEvaluation = new BasicAlertEvaluation();
newAlertEvaluation.setId(account);
newAlertEvaluation.setAccountName(account);
newAlertEvaluation.setQueue("new");
alertEvaluationsToAdd.add(newAlertEvaluation);
}
}
for (BasicAlertEvaluation alertEvaluation : alertEvaluationsToAdd) {