Skip to content

Commit

Permalink
Extract multipart upload implementation from mvcc cataloger (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
nopcoder authored Dec 2, 2020
1 parent 3aa396f commit a57e068
Show file tree
Hide file tree
Showing 23 changed files with 400 additions and 385 deletions.
3 changes: 1 addition & 2 deletions api/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"strconv"
"time"

"github.com/treeverse/lakefs/parade"

openapierr "github.com/go-openapi/errors"
"github.com/go-openapi/loads"
"github.com/go-openapi/runtime/middleware"
Expand All @@ -25,6 +23,7 @@ import (
"github.com/treeverse/lakefs/dedup"
"github.com/treeverse/lakefs/httputil"
"github.com/treeverse/lakefs/logging"
"github.com/treeverse/lakefs/parade"
"github.com/treeverse/lakefs/retention"
_ "github.com/treeverse/lakefs/statik"
"github.com/treeverse/lakefs/stats"
Expand Down
4 changes: 0 additions & 4 deletions catalog/cataloger.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ type Cataloger interface {

DedupReportChannel() chan *DedupReport

CreateMultipartUpload(ctx context.Context, repository, uploadID, path, physicalAddress string, creationTime time.Time) error
GetMultipartUpload(ctx context.Context, repository, uploadID string) (*MultipartUpload, error)
DeleteMultipartUpload(ctx context.Context, repository, uploadID string) error

Commit(ctx context.Context, repository, branch string, message string, committer string, metadata Metadata) (*CommitLog, error)
GetCommit(ctx context.Context, repository, reference string) (*CommitLog, error)
ListCommits(ctx context.Context, repository, branch string, fromReference string, limit int) ([]*CommitLog, bool, error)
Expand Down
1 change: 0 additions & 1 deletion catalog/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ var (
ErrBranchNotFound = fmt.Errorf("branch %w", db.ErrNotFound)
ErrCommitNotFound = fmt.Errorf("commit %w", db.ErrNotFound)
ErrRepositoryNotFound = fmt.Errorf("repository %w", db.ErrNotFound)
ErrMultipartUploadNotFound = fmt.Errorf("multipart upload %w", db.ErrNotFound)
ErrEntryNotFound = fmt.Errorf("entry %w", db.ErrNotFound)
ErrUnexpected = errors.New("unexpected error")
ErrReadEntryTimeout = errors.New("read entry timeout")
Expand Down
8 changes: 0 additions & 8 deletions catalog/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ type Branch struct {
Name string `db:"name"`
}

type MultipartUpload struct {
Repository string `db:"repository"`
UploadID string `db:"upload_id"`
Path string `db:"path"`
CreationDate time.Time `db:"creation_date"`
PhysicalAddress string `db:"physical_address"`
}

func (j Metadata) Value() (driver.Value, error) {
if j == nil {
return json.Marshal(struct{}{})
Expand Down
31 changes: 0 additions & 31 deletions catalog/mvcc/cataloger_create_multipart_upload.go

This file was deleted.

83 changes: 0 additions & 83 deletions catalog/mvcc/cataloger_create_multipart_upload_test.go

This file was deleted.

36 changes: 0 additions & 36 deletions catalog/mvcc/cataloger_delete_multipart_upload.go

This file was deleted.

41 changes: 0 additions & 41 deletions catalog/mvcc/cataloger_delete_multipart_upload_test.go

This file was deleted.

37 changes: 0 additions & 37 deletions catalog/mvcc/cataloger_get_multipart_upload.go

This file was deleted.

72 changes: 0 additions & 72 deletions catalog/mvcc/cataloger_get_multipart_upload_test.go

This file was deleted.

6 changes: 0 additions & 6 deletions catalog/mvcc/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ func IsValidReference(reference string) bool {
return true
}

func ValidateUploadID(uploadID string) ValidateFunc {
return func() bool {
return IsNonEmptyString(uploadID)
}
}

func ValidatePath(name string) ValidateFunc {
return func() bool {
return IsNonEmptyString(name)
Expand Down
13 changes: 0 additions & 13 deletions catalog/rocks/cataloger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package rocks

import (
"context"
"time"

"github.com/treeverse/lakefs/catalog"
"github.com/treeverse/lakefs/logging"
Expand Down Expand Up @@ -306,18 +305,6 @@ func (c *cataloger) DedupReportChannel() chan *catalog.DedupReport {
return c.dummyDedupCh
}

func (c *cataloger) CreateMultipartUpload(ctx context.Context, repository string, uploadID string, path string, physicalAddress string, creationTime time.Time) error {
panic("not implemented") // TODO: Implement
}

func (c *cataloger) GetMultipartUpload(ctx context.Context, repository string, uploadID string) (*catalog.MultipartUpload, error) {
panic("not implemented") // TODO: Implement
}

func (c *cataloger) DeleteMultipartUpload(ctx context.Context, repository string, uploadID string) error {
panic("not implemented") // TODO: Implement
}

func (c *cataloger) Commit(ctx context.Context, repository string, branch string, message string, committer string, metadata catalog.Metadata) (*catalog.CommitLog, error) {
repositoryID, err := NewRepositoryID(repository)
if err != nil {
Expand Down
Loading

0 comments on commit a57e068

Please sign in to comment.