// CompressBefore compresses all data prior to the given offset on disk.
CompressBefore compresses all data prior to the given offset on disk.
// CompressBefore compresses all data prior to the given offset on disk .
func (wal *WAL) CompressBefore(o Offset) error {
	cutoff := sequenceToFilename(o.FileSequence())
	return wal.forEachSegment(func(file os.FileInfo, first bool, last bool) (bool, error) {
		if last || file.Name() >= cutoff {
			return false, nil
		}
		return wal.compress(file)
	})
}
func ( wal * WAL ) CompressBefore ( o Offset ) error { cutoff := sequenceToFilename ( o . FileSequence ( ) ) return wal . forEachSegment ( func ( file os . FileInfo , first bool , last bool ) ( bool , error ) { if last || file . Name ( ) >= cutoff { return false , nil } return wal . compress ( file ) } ) }
CompressBefore compresses all data prior to the given offset on disk.
CompressBefore compresses all data prior to the given offset on disk .
// Files are sorted by name, if we've gotten past the cutoff or // encountered the last (active) file, don't bother continuing.