Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Unified Diff: logdog/common/storage/memory/memory.go

Issue 2435883002: LogDog: Fix archival Get/Tail implementations. (Closed)
Patch Set: LogDog: Fix archival Get/Tail implementations. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: logdog/common/storage/memory/memory.go
diff --git a/logdog/common/storage/memory/memory.go b/logdog/common/storage/memory/memory.go
index 4aa4df2b29a6fac81fe1b7544378aed5baddc651..f5826f46cd3e63bc8e71bea97ebc3f2f38c60216 100644
--- a/logdog/common/storage/memory/memory.go
+++ b/logdog/common/storage/memory/memory.go
@@ -132,7 +132,7 @@ func (s *Storage) Get(req storage.GetRequest, cb storage.GetCallback) error {
dataCopy = make([]byte, len(r.data))
copy(dataCopy, r.data)
}
- if !cb(r.index, dataCopy) {
+ if !cb(storage.MakeEntry(dataCopy, r.index)) {
break
}
}
@@ -141,7 +141,7 @@ func (s *Storage) Get(req storage.GetRequest, cb storage.GetCallback) error {
}
// Tail implements storage.Storage.
-func (s *Storage) Tail(project config.ProjectName, path types.StreamPath) ([]byte, types.MessageIndex, error) {
+func (s *Storage) Tail(project config.ProjectName, path types.StreamPath) (*storage.Entry, error) {
var r *rec
// Find the latest log, then return it.
@@ -158,9 +158,9 @@ func (s *Storage) Tail(project config.ProjectName, path types.StreamPath) ([]byt
return nil
})
if err != nil {
- return nil, 0, err
+ return nil, err
}
- return r.data, r.index, nil
+ return storage.MakeEntry(r.data, r.index), nil
}
// Count returns the number of log records for the given stream.

Powered by Google App Engine
This is Rietveld 408576698