public void save(Collection<Count> counts) {
    Map<String, Count> countHolder = new HashMap<String, Count>();
    for (Count count : counts) {
      Count c = countHolder.get(count.getCounterName());
      if (c != null) {
        c.apply(count);
      } else {
        countHolder.put(count.getCounterName(), count);
      }
    }
    Mutator<ByteBuffer> mutator = HFactory.createMutator(keyspace, ByteBufferSerializer.get());
    for (Count count : countHolder.values()) {
      mutator.addCounter(
          count.getKeyNameBytes(),
          count.getTableName(),
          new HCounterColumnImpl(
              count.getColumnName(), count.getValue(), count.getColumnNameSerializer()));
    }
    try {
      mutator.execute();
    } catch (Exception e) {

      // errors here happen a lot on shutdown, don't fill the logs with them
      String error = e.getClass().getCanonicalName();
      if (counterInsertFailures.get(error) == null) {
        log.error("CounterStore insert failed, first instance", e);
        counterInsertFailures.put(error, 1);

      } else {
        int count = counterInsertFailures.get(error) + 1;
        counterInsertFailures.put(error, count);
        if (log.isDebugEnabled()) {
          log.debug(error + " caused CounterStore insert failure, count =  " + count, e);
        } else {
          log.error(error + " caused CounterStore insert failure, count =  " + count);
        }
      }
    }
  }