瀏覽代碼

wip code review

Alex Meijer 1 月之前
父節點
當前提交
df12063922
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      core/pkg/storage/s3storage.go

+ 6 - 0
core/pkg/storage/s3storage.go

@@ -663,6 +663,12 @@ type s3ChunkReader struct {
 	fetch     func(off, length int64) ([]byte, error)
 	fetch     func(off, length int64) ([]byte, error)
 }
 }
 
 
+
+// s3 chunk reader has following features over minio: 
+// It enforces fixed-size ranged reads (defaultS3ReadChunkSize) instead of one long-lived stream.
+// It keeps error mapping consistent (DoesNotExistError, range validation, SSE options via getRange()).
+// It gives predictable io.Reader semantics around EOF/partial reads while hiding S3 range mechanics.
+//
 func newS3ChunkReader(size, chunkSize int64, fetch func(off, length int64) ([]byte, error)) io.ReadCloser {
 func newS3ChunkReader(size, chunkSize int64, fetch func(off, length int64) ([]byte, error)) io.ReadCloser {
 	if chunkSize <= 0 {
 	if chunkSize <= 0 {
 		chunkSize = defaultS3ReadChunkSize
 		chunkSize = defaultS3ReadChunkSize