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

Unified Diff: logdog/server/archivist/storageSource.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/server/archivist/storageSource.go
diff --git a/logdog/server/archivist/storageSource.go b/logdog/server/archivist/storageSource.go
index 43206fbb6b4ea5d6a526d422f417b54c9e67677b..0f85a7a2d578065eeeab6351c0657d5d55d35d8a 100644
--- a/logdog/server/archivist/storageSource.go
+++ b/logdog/server/archivist/storageSource.go
@@ -7,7 +7,6 @@ package archivist
import (
"io"
- "github.com/golang/protobuf/proto"
"github.com/luci/luci-go/common/config"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/logdog/api/logpb"
@@ -39,19 +38,16 @@ func (s *storageSource) bufferEntries(start types.MessageIndex) error {
Path: s.path,
Index: start,
}
- return s.st.Get(req, func(idx types.MessageIndex, d []byte) bool {
- le := logpb.LogEntry{}
- if err := proto.Unmarshal(d, &le); err != nil {
- log.Fields{
- log.ErrorKey: err,
- "streamIndex": idx,
- }.Errorf(s, "Failed to unmarshal LogEntry.")
+ return s.st.Get(req, func(e *storage.Entry) bool {
+ le, err := e.GetLogEntry()
+ if err != nil {
+ log.WithError(err).Errorf(s, "Failed to unmarshal LogEntry.")
return false
}
- s.buf = append(s.buf, &le)
+ s.buf = append(s.buf, le)
// Stop loading if we've reached or exceeded our buffer size.
- bytes += len(d)
+ bytes += len(e.D)
return bytes < storageBufferSize
})
}

Powered by Google App Engine
This is Rietveld 408576698