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

Side by Side Diff: logdog/common/storage/bigtable/initialize.go

Issue 2435113002: LogDog: Add Storage-layer data caching. (Closed)
Patch Set: Fix byteLimit bug. Created 4 years, 1 month 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 | « logdog/common/storage/bigtable/cache.go ('k') | logdog/common/storage/bigtable/storage.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 LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package bigtable 5 package bigtable
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "time" 9 "time"
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // If, however, the table or table's schema doesn't exist, Initialize will 64 // If, however, the table or table's schema doesn't exist, Initialize will
65 // create and configure it. 65 // create and configure it.
66 // 66 //
67 // If nil is returned, the table is ready for use as a Storage via New. 67 // If nil is returned, the table is ready for use as a Storage via New.
68 func Initialize(ctx context.Context, o Options) error { 68 func Initialize(ctx context.Context, o Options) error {
69 adminClient, err := o.adminClient(ctx) 69 adminClient, err := o.adminClient(ctx)
70 if err != nil { 70 if err != nil {
71 return err 71 return err
72 } 72 }
73 73
74 » st := newBTStorage(ctx, o, nil, adminClient) 74 » st := newBTStorage(ctx, o, nil, adminClient, nil)
75 defer st.Close() 75 defer st.Close()
76 76
77 exists, err := tableExists(ctx, st.adminClient, o.LogTable) 77 exists, err := tableExists(ctx, st.adminClient, o.LogTable)
78 if err != nil { 78 if err != nil {
79 return fmt.Errorf("failed to test for table: %s", err) 79 return fmt.Errorf("failed to test for table: %s", err)
80 } 80 }
81 if !exists { 81 if !exists {
82 log.Fields{ 82 log.Fields{
83 "table": o.LogTable, 83 "table": o.LogTable,
84 }.Infof(ctx, "Storage table does not exist. Creating...") 84 }.Infof(ctx, "Storage table does not exist. Creating...")
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 cfg := storage.Config{ 126 cfg := storage.Config{
127 MaxLogAge: DefaultMaxLogAge, 127 MaxLogAge: DefaultMaxLogAge,
128 } 128 }
129 if err := st.Config(cfg); err != nil { 129 if err := st.Config(cfg); err != nil {
130 log.WithError(err).Errorf(ctx, "Failed to push default configura tion.") 130 log.WithError(err).Errorf(ctx, "Failed to push default configura tion.")
131 return err 131 return err
132 } 132 }
133 133
134 return nil 134 return nil
135 } 135 }
OLDNEW
« no previous file with comments | « logdog/common/storage/bigtable/cache.go ('k') | logdog/common/storage/bigtable/storage.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698