Skip to content

Commit

Permalink
remove unnecessary namespace param (#8682)
Browse files Browse the repository at this point in the history
* remove unnecessary namespace param

* fix fake
  • Loading branch information
nadavsteindler authored Feb 19, 2025
1 parent f2847ad commit 04518de
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 45 deletions.
8 changes: 4 additions & 4 deletions pkg/graveler/committed/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,21 +374,21 @@ func (c *committedManager) Compare(ctx context.Context, storageID graveler.Stora
return NewCompareValueIterator(ctx, NewDiffIteratorWrapper(diffIt), baseIt), nil
}

func (c *committedManager) GetMetaRange(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, id graveler.MetaRangeID) (graveler.MetaRangeAddress, error) {
func (c *committedManager) GetMetaRange(ctx context.Context, storageID graveler.StorageID, id graveler.MetaRangeID) (graveler.MetaRangeAddress, error) {
metaRangeManager, err := c.getMetaRangeManager(storageID)
if err != nil {
return "", err
}
uri, err := metaRangeManager.GetMetaRangeURI(ctx, ns, id)
uri, err := metaRangeManager.GetMetaRangeURI(ctx, id)
return graveler.MetaRangeAddress(uri), err
}

func (c *committedManager) GetRange(ctx context.Context, storageID graveler.StorageID, ns graveler.StorageNamespace, id graveler.RangeID) (graveler.RangeAddress, error) {
func (c *committedManager) GetRange(ctx context.Context, storageID graveler.StorageID, id graveler.RangeID) (graveler.RangeAddress, error) {
metaRangeManager, err := c.getMetaRangeManager(storageID)
if err != nil {
return "", err
}
uri, err := metaRangeManager.GetRangeURI(ctx, ns, id)
uri, err := metaRangeManager.GetRangeURI(ctx, id)
return graveler.RangeAddress(uri), err
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/graveler/committed/meta_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ type MetaRangeManager interface {

// GetMetaRangeURI returns a URI with an object representing metarange ID. It may
// return a URI that does not resolve (rather than an error) if ID does not exist.
GetMetaRangeURI(ctx context.Context, ns graveler.StorageNamespace, metaRangeID graveler.MetaRangeID) (string, error)
GetMetaRangeURI(ctx context.Context, metaRangeID graveler.MetaRangeID) (string, error)

// GetRangeURI returns a URI with an object representing range ID. It may
// return a URI that does not resolve (rather than an error) if ID does not exist.
GetRangeURI(ctx context.Context, ns graveler.StorageNamespace, rangeID graveler.RangeID) (string, error)
GetRangeURI(ctx context.Context, rangeID graveler.RangeID) (string, error)

// GetRangeByKey returns the Range that contains key in the MetaRange with id.
GetRangeByKey(ctx context.Context, ns graveler.StorageNamespace, id graveler.MetaRangeID, key graveler.Key) (*Range, error)
Expand Down
8 changes: 4 additions & 4 deletions pkg/graveler/committed/meta_range_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ func (m *metaRangeManager) NewMetaRangeIterator(ctx context.Context, ns graveler
return NewIterator(ctx, m.rangeManager, StorageID(m.storageID), Namespace(ns), rangesIt), nil
}

func (m *metaRangeManager) GetMetaRangeURI(ctx context.Context, ns graveler.StorageNamespace, id graveler.MetaRangeID) (string, error) {
return m.metaManager.GetURI(ctx, Namespace(ns), ID(id))
func (m *metaRangeManager) GetMetaRangeURI(ctx context.Context, id graveler.MetaRangeID) (string, error) {
return m.metaManager.GetURI(ctx, ID(id))
}

func (m *metaRangeManager) GetRangeURI(ctx context.Context, ns graveler.StorageNamespace, id graveler.RangeID) (string, error) {
return m.rangeManager.GetURI(ctx, Namespace(ns), ID(id))
func (m *metaRangeManager) GetRangeURI(ctx context.Context, id graveler.RangeID) (string, error) {
return m.rangeManager.GetURI(ctx, ID(id))
}
16 changes: 8 additions & 8 deletions pkg/graveler/committed/mock/meta_range.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/graveler/committed/mock/range_manager.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/graveler/committed/range_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type RangeManager interface {

// GetURI returns a URI from which to read the contents of id. If id does not exist
// it may return a URI that resolves nowhere rather than an error.
GetURI(ctx context.Context, ns Namespace, id ID) (string, error)
GetURI(ctx context.Context, id ID) (string, error)
}

// WriteResult is the result of a completed write of a Range
Expand Down
8 changes: 4 additions & 4 deletions pkg/graveler/graveler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1049,9 +1049,9 @@ type CommittedManager interface {
Commit(ctx context.Context, storageID StorageID, ns StorageNamespace, baseMetaRangeID MetaRangeID, changes ValueIterator, allowEmpty bool, opts ...SetOptionsFunc) (MetaRangeID, DiffSummary, error)

// GetMetaRange returns information where metarangeID is stored.
GetMetaRange(ctx context.Context, storageID StorageID, ns StorageNamespace, metaRangeID MetaRangeID) (MetaRangeAddress, error)
GetMetaRange(ctx context.Context, storageID StorageID, metaRangeID MetaRangeID) (MetaRangeAddress, error)
// GetRange returns information where rangeID is stored.
GetRange(ctx context.Context, storageID StorageID, ns StorageNamespace, rangeID RangeID) (RangeAddress, error)
GetRange(ctx context.Context, storageID StorageID, rangeID RangeID) (RangeAddress, error)

// GetRangeIDByKey returns the RangeID that contains the given key.
GetRangeIDByKey(ctx context.Context, storageID StorageID, ns StorageNamespace, id MetaRangeID, key Key) (RangeID, error)
Expand Down Expand Up @@ -3400,11 +3400,11 @@ func (g *Graveler) LoadTags(ctx context.Context, repository *RepositoryRecord, m
}

func (g *Graveler) GetMetaRange(ctx context.Context, repository *RepositoryRecord, metaRangeID MetaRangeID) (MetaRangeAddress, error) {
return g.CommittedManager.GetMetaRange(ctx, repository.StorageID, repository.StorageNamespace, metaRangeID)
return g.CommittedManager.GetMetaRange(ctx, repository.StorageID, metaRangeID)
}

func (g *Graveler) GetRange(ctx context.Context, repository *RepositoryRecord, rangeID RangeID) (RangeAddress, error) {
return g.CommittedManager.GetRange(ctx, repository.StorageID, repository.StorageNamespace, rangeID)
return g.CommittedManager.GetRange(ctx, repository.StorageID, rangeID)
}

func (g *Graveler) DumpCommits(ctx context.Context, repository *RepositoryRecord) (*MetaRangeID, error) {
Expand Down
16 changes: 8 additions & 8 deletions pkg/graveler/mock/graveler.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/graveler/sstable/range_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ func (m *RangeManager) GetWriter(ctx context.Context, ns committed.Namespace, me
return NewDiskWriter(ctx, m.fs, m.storageID, ns, m.hash.New(), metadata)
}

func (m *RangeManager) GetURI(ctx context.Context, ns committed.Namespace, id committed.ID) (string, error) {
return m.fs.GetRemoteURI(ctx, string(ns), string(id))
func (m *RangeManager) GetURI(ctx context.Context, id committed.ID) (string, error) {
return m.fs.GetRemoteURI(ctx, string(id))
}

func (m *RangeManager) execAndLog(ctx context.Context, f func() error, msg string) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/graveler/testutil/fakes.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ func (c *CommittedFake) WriteMetaRange(context.Context, graveler.StorageID, grav
return &graveler.MetaRangeInfo{ID: c.MetaRangeID}, nil
}

func (c *CommittedFake) GetMetaRange(_ context.Context, _ graveler.StorageID, _ graveler.StorageNamespace, metaRangeID graveler.MetaRangeID) (graveler.MetaRangeAddress, error) {
func (c *CommittedFake) GetMetaRange(_ context.Context, _ graveler.StorageID, metaRangeID graveler.MetaRangeID) (graveler.MetaRangeAddress, error) {
return graveler.MetaRangeAddress(fmt.Sprintf("fake://prefix/%s(metarange)", metaRangeID)), nil
}

func (c *CommittedFake) GetRange(_ context.Context, _ graveler.StorageID, _ graveler.StorageNamespace, rangeID graveler.RangeID) (graveler.RangeAddress, error) {
func (c *CommittedFake) GetRange(_ context.Context, _ graveler.StorageID, rangeID graveler.RangeID) (graveler.RangeAddress, error) {
return graveler.RangeAddress(fmt.Sprintf("fake://prefix/%s(range)", rangeID)), nil
}

Expand Down
8 changes: 4 additions & 4 deletions pkg/pyramid/mock/pyramid.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/pyramid/pyramid.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type FS interface {

// GetRemoteURI returns the URI for filename on block storage. That URI might not
// resolve if filename does not exist.
GetRemoteURI(ctx context.Context, namespace, filename string) (string, error)
GetRemoteURI(ctx context.Context, filename string) (string, error)
}

// File is pyramid abstraction for an os.File
Expand Down
2 changes: 1 addition & 1 deletion pkg/pyramid/tier_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (tfs *TierFS) store(ctx context.Context, storageID, namespace, originalPath
}
}

func (tfs *TierFS) GetRemoteURI(_ context.Context, _, filename string) (string, error) {
func (tfs *TierFS) GetRemoteURI(_ context.Context, filename string) (string, error) {
return tfs.blockStoragePath(filename), nil
}

Expand Down

0 comments on commit 04518de

Please sign in to comment.