Skip to content

Commit

Permalink
Revert changes related to batching and dedup
Browse files Browse the repository at this point in the history
  • Loading branch information
roger2hk committed Dec 10, 2024
1 parent 0c8d873 commit c517744
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions cmd/conformance/aws/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"time"

tessera "github.com/transparency-dev/trillian-tessera"
"github.com/transparency-dev/trillian-tessera/api/layout"
"github.com/transparency-dev/trillian-tessera/storage/aws"
"golang.org/x/mod/sumdb/note"
"golang.org/x/net/http2"
Expand Down Expand Up @@ -73,7 +72,7 @@ func main() {
if err != nil {
klog.Exitf("Failed to create new AWS storage: %v", err)
}
dedupeAdd := tessera.InMemoryDedupe(storage.Add, layout.TileWidth)
dedupeAdd := tessera.InMemoryDedupe(storage.Add, 256)

// Expose a HTTP handler for the conformance test writes.
// This should accept arbitrary bytes POSTed to /add, and return an ascii
Expand Down
3 changes: 1 addition & 2 deletions cmd/conformance/gcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"time"

tessera "github.com/transparency-dev/trillian-tessera"
"github.com/transparency-dev/trillian-tessera/api/layout"
"github.com/transparency-dev/trillian-tessera/storage/gcp"
"golang.org/x/mod/sumdb/note"
"golang.org/x/net/http2"
Expand Down Expand Up @@ -78,7 +77,7 @@ func main() {
klog.Exitf("Failed to create new GCP dedupe: %v", err)
}
}
dedupeAdd := tessera.InMemoryDedupe(addDelegate, layout.TileWidth)
dedupeAdd := tessera.InMemoryDedupe(addDelegate, 256)

// Expose a HTTP handler for the conformance test writes.
// This should accept arbitrary bytes POSTed to /add, and return an ascii
Expand Down
2 changes: 1 addition & 1 deletion cmd/conformance/mysql/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {
if err != nil {
klog.Exitf("Failed to create new MySQL storage: %v", err)
}
dedupeAdd := tessera.InMemoryDedupe(storage.Add, layout.TileWidth)
dedupeAdd := tessera.InMemoryDedupe(storage.Add, 256)

// Set up the handlers for the tlog-tiles GET methods, and a custom handler for HTTP POSTs to /add
configureTilesReadAPI(http.DefaultServeMux, storage)
Expand Down
5 changes: 2 additions & 3 deletions cmd/conformance/posix/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"golang.org/x/mod/sumdb/note"

tessera "github.com/transparency-dev/trillian-tessera"
"github.com/transparency-dev/trillian-tessera/api/layout"
"github.com/transparency-dev/trillian-tessera/storage/posix"
"k8s.io/klog/v2"
)
Expand Down Expand Up @@ -59,11 +58,11 @@ func main() {
s, a := getSignersOrDie()

// Create the Tessera POSIX storage, using the directory from the --storage_dir flag
storage, err := posix.New(ctx, *storageDir, *initialise, tessera.WithCheckpointSigner(s, a...), tessera.WithBatching(layout.TileWidth, time.Second))
storage, err := posix.New(ctx, *storageDir, *initialise, tessera.WithCheckpointSigner(s, a...), tessera.WithBatching(256, time.Second))
if err != nil {
klog.Exitf("Failed to construct storage: %v", err)
}
dedupeAdd := tessera.InMemoryDedupe(storage.Add, layout.TileWidth)
dedupeAdd := tessera.InMemoryDedupe(storage.Add, 256)

// Define a handler for /add that accepts POST requests and adds the POST body to the log
http.HandleFunc("POST /add", func(w http.ResponseWriter, r *http.Request) {
Expand Down
3 changes: 1 addition & 2 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import (
"time"

f_log "github.com/transparency-dev/formats/log"
"github.com/transparency-dev/trillian-tessera/api/layout"
"github.com/transparency-dev/trillian-tessera/internal/options"
"golang.org/x/mod/sumdb/note"
"k8s.io/klog/v2"
)

const (
// DefaultBatchMaxSize is used by storage implementations if no WithBatching option is provided when instantiating it.
DefaultBatchMaxSize = layout.TileWidth
DefaultBatchMaxSize = 256
// DefaultBatchMaxAge is used by storage implementations if no WithBatching option is provided when instantiating it.
DefaultBatchMaxAge = 250 * time.Millisecond
// DefaultCheckpointInterval is used by storage implementations if no WithCheckpointInterval option is provided when instantiating it.
Expand Down

0 comments on commit c517744

Please sign in to comment.