Data Receiver process for managing disk space

The Z Common Data Provider Data Receiver limits the number of output files that can simultaneously exist in its output directory (CDPDR_PATH directory). To manage these output files, the Data Receiver uses a cyclic process with rolling files, which are a dynamic, sequential set of files that contain a continuous stream of data.

How the process works

The cycle property in the Data Receiver properties file defines the number of output files that can simultaneously exist in the Data Receiver output directory.

When the number of output files in the output directory equals the value of the cycle property, and a new file is written, then the oldest file is deleted. Each file contains 1 hour of data. Therefore, if the value of the cycle property is set to 3 (3 hours), no more than 3 hours of data (in 3 output files) is on disk at a time.

The following points further illustrate this example of how the Data Receiver manages the output files:
  • With the value of the cycle property set to 3, the suffixes -0, -1, and -2 are appended to the names of the output files.
  • At the beginning of each hour, the Data Receiver erases the old data in the next file in the sequence (if it exists) and writes new data to the file (for example, if it last wrote data to the -0 file, it erases the old data in the -1 file and writes new data to the -1 file).
  • One hour later, the Data Receiver erases the old data in the -2 file and writes new data to the -2 file.
Important: The target destination must read the output data in a timely manner. In this example, if the target destination does not read the data within 2 hours of when it is written, the data is lost because it is deleted.