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

Side by Side Diff: common/logdog/coordinator/stream.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Fix proto comment. 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 | « common/logdog/coordinator/query_test.go ('k') | common/logdog/coordinator/stream_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 coordinator 5 package coordinator
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 "time" 10 "time"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 } 63 }
64 64
65 func loadLogStream(p types.StreamPath, s *logdog.LogStreamState, d *logpb.LogStr eamDescriptor) *LogStream { 65 func loadLogStream(p types.StreamPath, s *logdog.LogStreamState, d *logpb.LogStr eamDescriptor) *LogStream {
66 ls := LogStream{ 66 ls := LogStream{
67 Path: p, 67 Path: p,
68 Desc: d, 68 Desc: d,
69 } 69 }
70 if s != nil { 70 if s != nil {
71 st := StreamState{ 71 st := StreamState{
72 Created: s.Created.Time(), 72 Created: s.Created.Time(),
73 Updated: s.Updated.Time(),
74 TerminalIndex: types.MessageIndex(s.TerminalIndex), 73 TerminalIndex: types.MessageIndex(s.TerminalIndex),
75 Purged: s.Purged, 74 Purged: s.Purged,
76 } 75 }
77 if a := s.Archive; a != nil { 76 if a := s.Archive; a != nil {
78 st.Archived = true 77 st.Archived = true
79 st.ArchiveIndexURL = a.IndexUrl 78 st.ArchiveIndexURL = a.IndexUrl
80 st.ArchiveStreamURL = a.StreamUrl 79 st.ArchiveStreamURL = a.StreamUrl
81 st.ArchiveDataURL = a.DataUrl 80 st.ArchiveDataURL = a.DataUrl
82 } 81 }
83 82
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if resp.Desc == nil { 173 if resp.Desc == nil {
175 return errors.New("Requested descriptor was not returned") 174 return errors.New("Requested descriptor was not returned")
176 } 175 }
177 if resp.State == nil { 176 if resp.State == nil {
178 return errors.New("Requested state was not returned") 177 return errors.New("Requested state was not returned")
179 } 178 }
180 ls := loadLogStream(resp.Desc.Path(), resp.State, resp.Desc) 179 ls := loadLogStream(resp.Desc.Path(), resp.State, resp.Desc)
181 *stateP = *ls 180 *stateP = *ls
182 return nil 181 return nil
183 } 182 }
OLDNEW
« no previous file with comments | « common/logdog/coordinator/query_test.go ('k') | common/logdog/coordinator/stream_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698