topsim.core.buffer.Buffer
- class topsim.core.buffer.Buffer(env, cluster, planner, config)[source]
- Parameters:
env (core.Simpy.Environment object) – The simulation environment
Methods
__init__(env, cluster, planner, config)buffer_storage_summary()Provide other actors information on the capacity and rate details of the respective buffers.
check_buffer_capacity(observation)Determines if there is capacity in both the Hot and Cold Buffers
check_buffer_over_data_threshold(b)has_observations_ready_for_processing()Observations that are available for processing must come from the ColdBuffer.
has_observations_stored(b)ingest_data_dump(data)ingest_data_stream(observation)Buffer ingests the data stream from the Ingest pipelines.
is_empty()Determine if both buffers are cleared of all observational data
mark_observation_finished(observation)To be called by the Scheduler.
move_cold_to_hot(b)Called from within the buffer, when we hae capacity in the HotBuffer to process an existing observation.
move_hot_to_cold(b)Called when the scheduler is requesting data for workflow processing.
next_observation_for_processing()Calls the cold buffer and checks if there are any observations for processing
project_buffer_capacity(obs, b)run()This is the main process of the Buffer to have it running continually during the simulation.
to_df()Return a pandas.DataFrame that represents the state of the Buffer and its attributes at the current timestep
transfer_in_progress(b)