The states handle the messages as follows:
- RUNNING state: Handles the
STORAGE_CLEAR,STORAGE_FLUSH,STORAGE_STATS, andSTORAGE_SET_THRESHOLDmessages. - BUFFER_IDLE state: Handles
STORAGE_BATCH_REQUESTto transition toBUFFER_PIPE_ACTIVE. - BUFFER_PIPE_ACTIVE state: Populates the pipe with
[header + data]items and handles the session management.