We use Samza RocksDB to keep track of our user event sessions. The task periodically calls window() to update all sessions in the store and purge all closed sessions.
We do all of this in the same iterator loop. Here's how we are doing it: public void window(MessageCollector collector, TaskCoordinator coordinator) throws Exception { KeyValueIterator<String, Session> it = sessionStore.all(); while (it.hasNext()) { Entry<String, Session> entry = it.next(); Session session = entry.getValue(); update(session); if (session.getStatus() == Status.CLOSED) { sessionStore.delete(entry.getKey()); } else { sessionStore.put(entry.getKey(), session); } } } The question is: is this the correct/efficient way to do a read+update for RocksDB? Thanks, David