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

Unified Diff: server/logdog/storage/bigtable/bigtable.go

Issue 1610993002: LogDog: Add collector service implementation. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Comments, rebase. Created 4 years, 10 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
« no previous file with comments | « server/internal/logdog/service/service.go ('k') | server/logdog/storage/bigtable/bigtable_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/logdog/storage/bigtable/bigtable.go
diff --git a/server/logdog/storage/bigtable/bigtable.go b/server/logdog/storage/bigtable/bigtable.go
index b1038b8dfb640f82a6950a0be9b066201d37eb06..27efd7a96e07faf9f992b37859e1cba12edfa149 100644
--- a/server/logdog/storage/bigtable/bigtable.go
+++ b/server/logdog/storage/bigtable/bigtable.go
@@ -6,9 +6,9 @@ package bigtable
import (
"fmt"
- "strings"
"github.com/luci/luci-go/common/errors"
+ "github.com/luci/luci-go/common/grpcutil"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/server/logdog/storage"
"golang.org/x/net/context"
@@ -29,9 +29,6 @@ type btGetCallback func(*rowKey, []byte) error
// btTable is a general interface for BigTable operations intended to enable
// unit tests to stub out BigTable without adding runtime inefficiency.
-//
-// If any of these methods fails with a transient error, it will be wrapped
-// as an errors.Transient error.
type btTable interface {
// putLogData adds new log data to BigTable.
//
@@ -52,14 +49,6 @@ type btTable interface {
getLogData(c context.Context, rk *rowKey, limit int, keysOnly bool, cb btGetCallback) error
}
-// btTransientSubstrings is the set of known error substrings returned by
-// BigTable that indicate failures that aren't related to the specific data
-// content.
-var btTransientSubstrings = []string{
- "Internal error encountered",
- "interactive login is required",
-}
-
// btTableProd is an implementation of the btTable interface that uses a real
// production BigTable connection.
type btTableProd struct {
@@ -150,20 +139,8 @@ func wrapTransient(err error) error {
//
// Since the BigTable API doesn't give us this information, we will identify
// transient errors by parsing their error string :(
-//
-// TODO(dnj): File issue to add error qualifier functions to BigTable API.
func isTransient(err error) bool {
- if err == nil {
- return false
- }
-
- msg := err.Error()
- for _, s := range btTransientSubstrings {
- if strings.Contains(msg, s) {
- return true
- }
- }
- return false
+ return grpcutil.IsTransient(err)
}
// getLogData loads the "data" column from the "log" column family and returns
« no previous file with comments | « server/internal/logdog/service/service.go ('k') | server/logdog/storage/bigtable/bigtable_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698