a bit more docs to etl #463

This commit is contained in:
Alex Sharov 2022-05-24 11:37:27 +07:00 committed by GitHub
parent 26e4d01d16
commit 2bfb6d70bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,7 @@ type LoadCommitHandler func(db kv.Putter, key []byte, isDone bool) error
type AdditionalLogArguments func(k, v []byte) (additionalLogArguments []interface{})
type TransformArgs struct {
// [ExtractStartKey, ExtractEndKey)
ExtractStartKey []byte
ExtractEndKey []byte
BufferType int
@ -106,6 +107,7 @@ func Transform(
return collector.Load(db, toBucket, loadFunc, args)
}
// extractBucketIntoFiles - [startkey, endkey)
func extractBucketIntoFiles(
logPrefix string,
db kv.Tx,
@ -148,7 +150,7 @@ func extractBucketIntoFiles(
log.Info(fmt.Sprintf("[%s] ETL [1/2] Extracting", logPrefix), logArs...)
}
if endkey != nil && bytes.Compare(k, endkey) >= 0 {
// endKey is exclusive bound
// endKey is exclusive bound: [startkey, endkey)
return nil
}
if err := extractFunc(k, v, collector.extractNextFunc); err != nil {