Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions db/commits/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type Patch struct {
base View
diff *Snapshot
deletedObjects []ksuid.KSUID
deletedVectors []ksuid.KSUID
}

var _ View = (*Patch)(nil)
Expand All @@ -39,10 +38,6 @@ func (p *Patch) Lookup(id ksuid.KSUID) (*data.Object, error) {
return p.base.Lookup(id)
}

func (p *Patch) HasVector(id ksuid.KSUID) bool {
return p.diff.HasVector(id) || p.base.HasVector(id)
}

func (p *Patch) Select(span extent.Span, o order.Which) DataObjects {
objects := p.base.Select(span, o)
objects.Append(p.diff.Select(span, o))
Expand Down Expand Up @@ -83,26 +78,6 @@ func (p *Patch) DeleteObject(id ksuid.KSUID) error {
return nil
}

func (p *Patch) AddVector(id ksuid.KSUID) error {
if p.HasVector(id) {
return ErrExists
}
return p.diff.AddVector(id)
}

func (p *Patch) DeleteVector(id ksuid.KSUID) error {
if p.diff.HasVector(id) {
return p.diff.DeleteVector(id)
}
if !p.base.HasVector(id) {
return ErrNotFound
}
// Keep track of the deletions from the base so we can add the
// needed delete Actions when building the transaction patch.
p.deletedVectors = append(p.deletedVectors, id)
return nil
}

func (p *Patch) NewCommitObject(parent ksuid.KSUID, retries int, author, message string, meta super.Value) *Object {
o := NewObject(parent, author, message, meta, retries)
for _, id := range p.deletedObjects {
Expand Down
13 changes: 0 additions & 13 deletions db/commits/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ var ErrWriteConflict = errors.New("write conflict")

type View interface {
Lookup(ksuid.KSUID) (*data.Object, error)
HasVector(ksuid.KSUID) bool
Select(extent.Span, order.Which) DataObjects
SelectAll() DataObjects
}
Expand All @@ -26,8 +25,6 @@ type Writeable interface {
View
AddDataObject(*data.Object) error
DeleteObject(ksuid.KSUID) error
AddVector(ksuid.KSUID) error
DeleteVector(ksuid.KSUID) error
}

// A snapshot summarizes the pool state at any point in
Expand Down Expand Up @@ -196,13 +193,3 @@ func Play(w Writeable, o *Object) error {
}
return nil
}

func Vectors(view View) *Snapshot {
snap := NewSnapshot()
for _, o := range view.SelectAll() {
if view.HasVector(o.ID) {
snap.AddDataObject(o)
}
}
return snap
}
1 change: 0 additions & 1 deletion db/commits/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ func (s *Store) Vacuumable(ctx context.Context, leaf ksuid.KSUID, out chan<- *da
case <-ctx.Done():
}
}
// XXX Support *AddVector, but currently Vector only has an ID and descriptive object.
default:
continue
}
Expand Down
1 change: 0 additions & 1 deletion db/ztests/meta-empty-pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ script: |
super db -c 'from test@main:objects'
super db -c 'from test@main:partitions'
super db -c 'from test@main:rawlog'
super db -c 'from test@main:vectors'

outputs:
- name: stdout
Expand Down
11 changes: 0 additions & 11 deletions runtime/sam/op/meta/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,6 @@ func NewCommitMetaScanner(ctx context.Context, sctx *super.Context, r *db.Root,
return nil, err
}
return sbuf.NewScanner(ctx, reader, nil)
case "vectors":
snap, err := p.Snapshot(ctx, commit)
if err != nil {
return nil, err
}
vectors := commits.Vectors(snap)
reader, err := objectReader(sctx, vectors, p.SortKeys.Primary().Order)
if err != nil {
return nil, err
}
return sbuf.NewScanner(ctx, reader, nil)
default:
return nil, fmt.Errorf("unknown commit metadata type: %q", meta)
}
Expand Down
1 change: 0 additions & 1 deletion service/ztests/meta-empty-pool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ script: |
super db -c 'from test@main:objects'
super db -c 'from test@main:partitions'
super db -c 'from test@main:rawlog'
super db -c 'from test@main:vectors'

inputs:
- name: service.sh
Expand Down
Loading