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

Unified Diff: logdog/appengine/coordinator/coordinatorTest/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/coordinatorTest/service.go
diff --git a/logdog/appengine/coordinator/coordinatorTest/service.go b/logdog/appengine/coordinator/coordinatorTest/service.go
index 87f421250c2716265fdd4552ea607ca10dafbace..57a92fd732eef1c20866ed15dd9eb83d35c454c5 100644
--- a/logdog/appengine/coordinator/coordinatorTest/service.go
+++ b/logdog/appengine/coordinator/coordinatorTest/service.go
@@ -11,6 +11,7 @@ import (
"github.com/luci/luci-go/logdog/appengine/coordinator"
"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/caching"
"golang.org/x/net/context"
)
@@ -35,6 +36,10 @@ type Services struct {
// ArchivalPublisher returns an ArchivalPublisher instance.
AP func() (coordinator.ArchivalPublisher, error)
+
+ // SC returns a storage caching.Cache instance. If nil, a nil cache value
+ // will be returned.
+ SC func() caching.Cache
}
var _ coordinator.Services = (*Services)(nil)
@@ -56,7 +61,7 @@ func (s *Services) ProjectConfig(c context.Context, project luciConfig.ProjectNa
}
// IntermediateStorage implements coordinator.Services.
-func (s *Services) IntermediateStorage(context.Context) (storage.Storage, error) {
+func (s *Services) IntermediateStorage(c context.Context) (storage.Storage, error) {
if s.IS != nil {
return s.IS()
}
@@ -78,3 +83,11 @@ func (s *Services) ArchivalPublisher(context.Context) (coordinator.ArchivalPubli
}
panic("not implemented")
}
+
+// StorageCache implements coordinator.Services.
+func (s *Services) StorageCache() caching.Cache {
+ if s.SC != nil {
+ return s.SC()
+ }
+ return nil
+}
« no previous file with comments | « logdog/appengine/coordinator/coordinatorTest/context.go ('k') | logdog/appengine/coordinator/coordinatorTest/storage_cache.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698