public void persistShardState(int shard, Map<Granularity, Map<Integer, UpdateStamp>> updates) throws ConnectionException {
Timer.Context ctx = Instrumentation.getWriteTimerContext(CassandraModel.CF_METRICS_STATE);
try {
MutationBatch mutationBatch = keyspace.prepareMutationBatch();
ColumnListMutation<SlotState> mutation = mutationBatch.withRow(CassandraModel.CF_METRICS_STATE, (long)shard);
for (Map.Entry<Granularity, Map<Integer, UpdateStamp>> granEntry : updates.entrySet()) {
Granularity g = granEntry.getKey();
for (Map.Entry<Integer, UpdateStamp> entry : granEntry.getValue().entrySet()) {
// granularity,slot,state
SlotState slotState = new SlotState(g, entry.getKey(), entry.getValue().getState());