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

Side by Side Diff: server/internal/logdog/archivist/archivist.go

Issue 1838803002: LogDog: BigTable batching schema. (Closed) Base URL: https://github.com/luci/luci-go@recordio-split
Patch Set: Minor comments and quality of code tweaks. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « server/cmd/logdog_collector/main.go ('k') | server/internal/logdog/archivist/archivist_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package archivist 5 package archivist
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 9
10 "github.com/golang/protobuf/proto" 10 "github.com/golang/protobuf/proto"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 hasMissingEntries bool // true if some log entries were missing. 348 hasMissingEntries bool // true if some log entries were missing.
349 } 349 }
350 350
351 func (s *storageSource) bufferEntries(start types.MessageIndex) error { 351 func (s *storageSource) bufferEntries(start types.MessageIndex) error {
352 bytes := 0 352 bytes := 0
353 353
354 req := storage.GetRequest{ 354 req := storage.GetRequest{
355 Path: s.path, 355 Path: s.path,
356 Index: start, 356 Index: start,
357 } 357 }
358 » return s.st.Get(&req, func(idx types.MessageIndex, d []byte) bool { 358 » return s.st.Get(req, func(idx types.MessageIndex, d []byte) bool {
359 le := logpb.LogEntry{} 359 le := logpb.LogEntry{}
360 if err := proto.Unmarshal(d, &le); err != nil { 360 if err := proto.Unmarshal(d, &le); err != nil {
361 log.Fields{ 361 log.Fields{
362 log.ErrorKey: err, 362 log.ErrorKey: err,
363 "streamIndex": idx, 363 "streamIndex": idx,
364 }.Errorf(s, "Failed to unmarshal LogEntry.") 364 }.Errorf(s, "Failed to unmarshal LogEntry.")
365 return false 365 return false
366 } 366 }
367 s.buf = append(s.buf, &le) 367 s.buf = append(s.buf, &le)
368 368
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 log.Fields{ 418 log.Fields{
419 "index": sidx, 419 "index": sidx,
420 "terminalIndex": s.terminalIndex, 420 "terminalIndex": s.terminalIndex,
421 }.Warningf(s, "Discarding log entries beyond expected terminal i ndex.") 421 }.Warningf(s, "Discarding log entries beyond expected terminal i ndex.")
422 return nil, archive.ErrEndOfStream 422 return nil, archive.ErrEndOfStream
423 } 423 }
424 424
425 s.lastIndex = sidx 425 s.lastIndex = sidx
426 return le, nil 426 return le, nil
427 } 427 }
OLDNEW
« no previous file with comments | « server/cmd/logdog_collector/main.go ('k') | server/internal/logdog/archivist/archivist_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698