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

Side by Side Diff: appengine/logdog/coordinator/endpoints/logs/get.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
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 logs 5 package logs
6 6
7 import ( 7 import (
8 "net/url" 8 "net/url"
9 "time" 9 "time"
10 10
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 sreq := storage.GetRequest{ 226 sreq := storage.GetRequest{
227 Path: p, 227 Path: p,
228 Index: types.MessageIndex(req.Index), 228 Index: types.MessageIndex(req.Index),
229 Limit: logCount, 229 Limit: logCount,
230 } 230 }
231 231
232 count := 0 232 count := 0
233 err := retry.Retry(c, retry.TransientOnly(retry.Default), func() error { 233 err := retry.Retry(c, retry.TransientOnly(retry.Default), func() error {
234 // Issue the Get request. This may return a transient error, in which case 234 // Issue the Get request. This may return a transient error, in which case
235 // we will retry. 235 // we will retry.
236 » » return st.Get(&sreq, func(idx types.MessageIndex, ld []byte) boo l { 236 » » return st.Get(sreq, func(idx types.MessageIndex, ld []byte) bool {
237 if count > 0 && byteLimit-len(ld) < 0 { 237 if count > 0 && byteLimit-len(ld) < 0 {
238 // Not the first log, and we've exceeded our byt e limit. 238 // Not the first log, and we've exceeded our byt e limit.
239 return false 239 return false
240 } 240 }
241 byteLimit -= len(ld) 241 byteLimit -= len(ld)
242 242
243 if !(req.NonContiguous || idx == sreq.Index) { 243 if !(req.NonContiguous || idx == sreq.Index) {
244 return false 244 return false
245 } 245 }
246 logs = append(logs, ld) 246 logs = append(logs, ld)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 log.ErrorKey: err, 280 log.ErrorKey: err,
281 "delay": delay, 281 "delay": delay,
282 }.Warningf(c, "Transient error while fetching tail log; retrying .") 282 }.Warningf(c, "Transient error while fetching tail log; retrying .")
283 }) 283 })
284 if err != nil { 284 if err != nil {
285 log.WithError(err).Errorf(c, "Failed to fetch tail log.") 285 log.WithError(err).Errorf(c, "Failed to fetch tail log.")
286 return nil, err 286 return nil, err
287 } 287 }
288 return [][]byte{data}, err 288 return [][]byte{data}, err
289 } 289 }
OLDNEW
« no previous file with comments | « appengine/logdog/coordinator/config/bigTable.go ('k') | appengine/logdog/coordinator/endpoints/logs/get_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698