@@ -8,13 +8,25 @@ import (
88 "github.com/prequel-dev/plz4/internal/pkg/opts"
99)
1010
11+ // OptT is a function that sets an option on the processor.
1112type OptT func (* opts.OptsT )
13+
14+ // WorkerPool is an interface for a worker pool implementation.
1215type WorkerPool = opts.WorkerPool
16+
17+ // BlockIdxT is a type for block size index.
1318type BlockIdxT = descriptor.BlockIdxT
19+
20+ // LevelT is a type for compression level.
1421type LevelT = compress.LevelT
1522
23+ // Progress callback function type.
1624type CbProgressT = opts.ProgressFuncT
25+
26+ // Skip callback function type.
1727type CbSkipT = opts.SkipCallbackT
28+
29+ // Dictionary callback function type.
1830type CbDictT = opts.DictCallbackT
1931
2032const (
@@ -73,7 +85,7 @@ func WithParallel(n int) OptT {
7385// This option only applies to the asynchronous case.
7486// It is ignored in the synchronous case.
7587//
76- // Setting the size to -1 forces auto mode, where the processor will automatically
88+ // Setting the pending size to -1 enables auto mode. In auto mode, the processor will automatically
7789// scale the pending size for maximum speed based on the block size and nParallel.
7890func WithPendingSize (n int ) OptT {
7991 return func (o * opts.OptsT ) {
@@ -91,15 +103,15 @@ func WithContentChecksum(enable bool) OptT {
91103 }
92104}
93105
94- // Optional worker pool for both compress and decompress mode .
106+ // Optional worker pool for both compress and decompress modes .
95107func WithWorkerPool (wp WorkerPool ) OptT {
96108 return func (o * opts.OptsT ) {
97109 o .WorkerPool = wp
98110 }
99111}
100112
101113// Processor will emit tuple (src_block_offset, dst_blk_offset) on each
102- // block boundary. Applies to both compress and decompress mode .
114+ // block boundary. Applies to both compress and decompress modes .
103115//
104116// Offsets are relative to the start of the frame.
105117//
@@ -181,7 +193,7 @@ func WithDictionaryId(id uint32) OptT {
181193
182194// Read block starting at byte 'offset'.
183195//
184- // The offset is the first byte of the block relative to the start of the frame.
196+ // The offset is the first byte of the data block relative to the start of the frame.
185197func WithReadOffset (offset int64 ) OptT {
186198 return func (o * opts.OptsT ) {
187199 o .ReadOffset = offset
0 commit comments