Skip to content

Commit

Permalink
create Collection.Update stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Preetam committed Aug 24, 2016
1 parent aa4b8c2 commit 1dcd1ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lm2.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ func (c *Collection) Delete(key string) error {
return nil
}

func (c *Collection) Update(wb *WriteBatch) error {
// Clean up.
wb.cleanup()

// TODO

return nil
}

func NewCollection(file string) (*Collection, error) {
f, err := os.OpenFile(file, os.O_CREATE|os.O_RDWR, 0666)
if err != nil {
Expand Down
6 changes: 6 additions & 0 deletions write_batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ func (wb *WriteBatch) Set(key, value string) {
func (wb *WriteBatch) Delete(key string) {
wb.deletes[key] = struct{}{}
}

func (wb *WriteBatch) cleanup() {
for key := range wb.deletes {
delete(wb.sets, key)
}
}

0 comments on commit 1dcd1ac

Please sign in to comment.