code: void flushCache() throws Exception {
  		if (!entryCache.isEmpty()) {
  			entries.putAll(entryCache);
  			entryCache.clear();
  		}
  		if (!eventsBufferCache.isEmpty()) {
  			eventsBuffer.putAll(eventsBufferCache);
  			eventsBufferCache.clear();
  		}
  	}
docs: Flush the event and node from cache to state.
  
  @throws Exception Thrown if the system cannot access the state.