-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Reader
LabelsReader should implement the io.ReadSeekCloser interface and only ever open one file on the disk at a time. NewLabelsReader should receive the directory of containing the PoST data, do some basic checks of the existing files against the postmeta_data.json and then abstract the directory for the user of the object to treat it as if it was a single file.
Read and Seek should only ever open one file and if the file cannot be found or is smaller then expected return io.ErrUnexpectedEOF.
Writer
Similar to the Reader LabelsWriter should implement the io.WriteSeekCloser interface and transparently handle the writing of data to multiple files.
This would among others remove the need to handle individual files by the initializer.
Additional note
At the moment Diskstate does not stat files to get their file size but rather uses fs.DirEntry::Info() which reports an incorrect size if the PoST data directory contains soft-links to the files (e.g. on other disks). On linux this problem can be solved by instead stating the files with os.Stat to get their correct size. On other OSes this might work differently and needs to be tested.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status