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

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

Issue 2435113002: LogDog: Add Storage-layer data caching. (Closed)
Patch Set: Fix byteLimit bug. Created 4 years, 2 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 | « logdog/common/storage/archive/storage_test.go ('k') | logdog/common/storage/bigtable/bigtable_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/common/storage/bigtable/bigtable.go
diff --git a/logdog/common/storage/bigtable/bigtable.go b/logdog/common/storage/bigtable/bigtable.go
index b3b62d10cb008c5b6ed1fd7674dcaaa14b771691..773d074c0ad2cde9d0761105fe884d19fd25454d 100644
--- a/logdog/common/storage/bigtable/bigtable.go
+++ b/logdog/common/storage/bigtable/bigtable.go
@@ -65,7 +65,7 @@ type btTable interface {
// btTableProd is an implementation of the btTable interface that uses a real
// production BigTable connection.
type btTableProd struct {
- *btStorage
+ base *btStorage
}
func (t *btTableProd) putLogData(c context.Context, rk *rowKey, data []byte) error {
@@ -74,7 +74,7 @@ func (t *btTableProd) putLogData(c context.Context, rk *rowKey, data []byte) err
cm := bigtable.NewCondMutation(bigtable.RowKeyFilter(rk.encode()), nil, m)
rowExists := false
- if err := t.logTable.Apply(c, rk.encode(), cm, bigtable.GetCondMutationResult(&rowExists)); err != nil {
+ if err := t.base.logTable.Apply(c, rk.encode(), cm, bigtable.GetCondMutationResult(&rowExists)); err != nil {
return grpcutil.WrapIfTransient(err)
}
if rowExists {
@@ -102,7 +102,7 @@ func (t *btTableProd) getLogData(c context.Context, rk *rowKey, limit int, keysO
rng := bigtable.NewRange(rk.encode(), rk.pathPrefixUpperBound())
var innerErr error
- err := t.logTable.ReadRows(c, rng, func(row bigtable.Row) bool {
+ err := t.base.logTable.ReadRows(c, rng, func(row bigtable.Row) bool {
data, err := getLogRowData(row)
if err != nil {
innerErr = storage.ErrBadData
@@ -135,7 +135,7 @@ func (t *btTableProd) setMaxLogAge(c context.Context, d time.Duration) error {
if d > 0 {
logGCPolicy = bigtable.MaxAgePolicy(d)
}
- if err := t.adminClient.SetGCPolicy(c, t.LogTable, logColumnFamily, logGCPolicy); err != nil {
+ if err := t.base.adminClient.SetGCPolicy(c, t.base.LogTable, logColumnFamily, logGCPolicy); err != nil {
return grpcutil.WrapIfTransient(err)
}
return nil
« no previous file with comments | « logdog/common/storage/archive/storage_test.go ('k') | logdog/common/storage/bigtable/bigtable_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698