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

Unified Diff: logdog/common/storage/bigtable/storage.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/bigtable/storage.go
diff --git a/logdog/common/storage/bigtable/storage.go b/logdog/common/storage/bigtable/storage.go
index 1b0808ad731880b93a85ded2c31c32e072097622..4be49071382ab23974e3ef80a8019939933c3da2 100644
--- a/logdog/common/storage/bigtable/storage.go
+++ b/logdog/common/storage/bigtable/storage.go
@@ -267,7 +267,7 @@ func (s *btStorage) Get(r storage.GetRequest, cb storage.GetCallback) error {
row, records = records[0], records[1:]
}
- if !cb(types.MessageIndex(index), row) {
+ if !cb(storage.MakeEntry(row, types.MessageIndex(index))) {
return errStop
}
r.Index = types.MessageIndex(index + 1)
@@ -293,7 +293,7 @@ func (s *btStorage) Get(r storage.GetRequest, cb storage.GetCallback) error {
}
}
-func (s *btStorage) Tail(project config.ProjectName, path types.StreamPath) ([]byte, types.MessageIndex, error) {
+func (s *btStorage) Tail(project config.ProjectName, path types.StreamPath) (*storage.Entry, error) {
ctx := log.SetFields(s, log.Fields{
"project": project,
"path": path,
@@ -317,7 +317,7 @@ func (s *btStorage) Tail(project config.ProjectName, path types.StreamPath) ([]b
if latest == nil {
// No rows for the specified stream.
- return nil, 0, storage.ErrDoesNotExist
+ return nil, storage.ErrDoesNotExist
}
// Fetch the latest row's data.
@@ -339,7 +339,7 @@ func (s *btStorage) Tail(project config.ProjectName, path types.StreamPath) ([]b
}.Errorf(ctx, "Failed to retrieve tail row.")
}
- return d, types.MessageIndex(latest.index), nil
+ return storage.MakeEntry(d, types.MessageIndex(latest.index)), nil
}
// rowWriter facilitates writing several consecutive data values to a single

Powered by Google App Engine
This is Rietveld 408576698