Skip to content

Commit d617383

Browse files
committed
Catch up with API changes on the go-cdc side
It's now the caller's responsibility to create an instance of bufio.
1 parent f077995 commit d617383

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/bluekeyes/go-gitdiff v0.8.1
1818
github.com/buildbarn/bb-remote-execution v0.0.0-20260130092441-749fb408bd30
1919
github.com/buildbarn/bb-storage v0.0.0-20260202202412-d7d4116607ae
20-
github.com/buildbarn/go-cdc v0.0.3
20+
github.com/buildbarn/go-cdc v0.0.4
2121
github.com/ericlagergren/siv v0.0.0-20220507050439-0b757b3aa5f1
2222
github.com/google/uuid v1.6.0
2323
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ github.com/buildbarn/bb-remote-execution v0.0.0-20260130092441-749fb408bd30 h1:p
8787
github.com/buildbarn/bb-remote-execution v0.0.0-20260130092441-749fb408bd30/go.mod h1:B0+2MQn6iGZ9i+wX54tLBfsyKLl3EPKSWgAQ6SRorhk=
8888
github.com/buildbarn/bb-storage v0.0.0-20260202202412-d7d4116607ae h1:2DHW0Ul8rT47OImD3hXLJk1xV/tlEm7aCqDtR8+tAms=
8989
github.com/buildbarn/bb-storage v0.0.0-20260202202412-d7d4116607ae/go.mod h1:96kqnkrdkHHi94Agje3NM8qwrYMxJRSkAqsb7oXRhNI=
90-
github.com/buildbarn/go-cdc v0.0.3 h1:9Wyl3ZZCUynp/ciAuCQxkG6T5GAuQO4+W5L+ETm3aa8=
91-
github.com/buildbarn/go-cdc v0.0.3/go.mod h1:fKDR6j7wx1beugY52Psk5/Oe61fsr4vn2YpnPYXWDOM=
90+
github.com/buildbarn/go-cdc v0.0.4 h1:Q5tKgdwXd3KPuTAwbat7KYioOu4jNOQIe0VhKrjUwCE=
91+
github.com/buildbarn/go-cdc v0.0.4/go.mod h1:fKDR6j7wx1beugY52Psk5/Oe61fsr4vn2YpnPYXWDOM=
9292
github.com/buildbarn/go-sha256tree v0.0.0-20250310211320-0f70f20e855b h1:IKUxixGBm9UxobU7c248z0BF0ojG19uoSLz8MFZM/KA=
9393
github.com/buildbarn/go-sha256tree v0.0.0-20250310211320-0f70f20e855b/go.mod h1:e7g3/yWApcg+PpDqd4eQEEV8pexQmfCgK3frP+1Wuvk=
9494
github.com/buildbarn/go-xdr v0.0.0-20240702182809-236788cf9e89 h1:Wtpgk4CIkoEJ7Qx3BwjaMp3TOVv834heqyCC9jMKStM=

pkg/model/filesystem/create_file_merkle_tree.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package filesystem
22

33
import (
4+
"bufio"
45
"context"
56
"io"
67
"math"
@@ -63,8 +64,13 @@ func maybeWriteHole[T model_core.ReferenceMetadata](treeBuilder btree.Builder[*m
6364
// Merkle trees for sparse files.
6465
func CreateFileMerkleTree[T model_core.ReferenceMetadata](ctx context.Context, parameters *FileCreationParameters, f io.Reader, capturer FileMerkleTreeCapturer[T]) (model_core.PatchedMessage[*model_filesystem_pb.FileContents, T], error) {
6566
chunker := cdc.NewRepMaxContentDefinedChunker(
66-
f,
67-
/* bufferSizeBytes = */ max(parameters.referenceFormat.GetMaximumObjectSizeBytes(), 2*parameters.chunkMinimumSizeBytes+parameters.chunkHorizonSizeBytes),
67+
bufio.NewReaderSize(
68+
f,
69+
max(
70+
parameters.referenceFormat.GetMaximumObjectSizeBytes(),
71+
2*parameters.chunkMinimumSizeBytes+parameters.chunkHorizonSizeBytes,
72+
),
73+
),
6874
parameters.chunkMinimumSizeBytes,
6975
parameters.chunkHorizonSizeBytes,
7076
)

0 commit comments

Comments
 (0)