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

Unified Diff: logdog/appengine/coordinator/service.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
Index: logdog/appengine/coordinator/service.go
diff --git a/logdog/appengine/coordinator/service.go b/logdog/appengine/coordinator/service.go
index 71acfafabef9a841efc34a8556fc7234cc313746..0b644d3c5e2f97a2aac4d51e8ee65719e90a986e 100644
--- a/logdog/appengine/coordinator/service.go
+++ b/logdog/appengine/coordinator/service.go
@@ -19,6 +19,7 @@ import (
"github.com/luci/luci-go/logdog/appengine/coordinator/config"
"github.com/luci/luci-go/logdog/common/storage"
"github.com/luci/luci-go/logdog/common/storage/bigtable"
+ "github.com/luci/luci-go/logdog/common/storage/caching"
"github.com/luci/luci-go/server/auth"
"github.com/luci/luci-go/server/router"
@@ -65,6 +66,10 @@ type Services interface {
// ArchivalPublisher returns an ArchivalPublisher instance.
ArchivalPublisher(context.Context) (ArchivalPublisher, error)
+
+ // StorageCache returns the storage cache instance to use, or nil for no
+ // caching.
+ StorageCache() caching.Cache
}
// ProdServices is middleware chain used by Coordinator services.
@@ -208,6 +213,7 @@ func (s *prodServicesInst) IntermediateStorage(c context.Context) (storage.Stora
ClientOptions: []option.ClientOption{
option.WithGRPCDialOption(grpc.WithPerRPCCredentials(creds)),
},
+ Cache: s.StorageCache(),
})
if err != nil {
log.WithError(err).Errorf(c, "Failed to create BigTable instance.")
@@ -275,3 +281,7 @@ func (s *prodServicesInst) nextArchiveIndex() uint64 {
}
return uint64(v)
}
+
+var storageCacheSingleton StorageCache
+
+func (s *prodServicesInst) StorageCache() caching.Cache { return &storageCacheSingleton }
« no previous file with comments | « logdog/appengine/coordinator/endpoints/logs/get_test.go ('k') | logdog/appengine/coordinator/storage_cache.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698