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

Side by Side Diff: logdog/appengine/coordinator/mutations/createArchiveTask.go

Issue 2592753002: Create unbuffered Tumble entry point for LogDog. (Closed)
Patch Set: Add bench, update. Created 3 years, 12 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 unified diff | Download patch
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 mutations 5 package mutations
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "time" 9 "time"
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 return ds.KeyForObj(c, m.logStream()) 95 return ds.KeyForObj(c, m.logStream())
96 } 96 }
97 97
98 // ProcessAfter implements tumble.DelayedMutation. 98 // ProcessAfter implements tumble.DelayedMutation.
99 func (m *CreateArchiveTask) ProcessAfter() time.Time { return m.Expiration } 99 func (m *CreateArchiveTask) ProcessAfter() time.Time { return m.Expiration }
100 100
101 // HighPriority implements tumble.DelayedMutation. 101 // HighPriority implements tumble.DelayedMutation.
102 func (m *CreateArchiveTask) HighPriority() bool { return false } 102 func (m *CreateArchiveTask) HighPriority() bool { return false }
103 103
104 // TaskName returns the task's name, which is derived from its log stream ID. 104 // TaskName returns the task's name, which is derived from its log stream ID.
105 func (m *CreateArchiveTask) TaskName(c context.Context) (*ds.Key, string) { 105 func (m *CreateArchiveTask) TaskName(c context.Context) string {
106 » return ds.KeyForObj(c, m.logStream()), fmt.Sprintf("archive-expired-%s", m.ID) 106 » return fmt.Sprintf("archive-expired-%s", m.ID)
107 } 107 }
108 108
109 // logStream returns the log stream associated with this task. 109 // logStream returns the log stream associated with this task.
110 func (m *CreateArchiveTask) logStream() *coordinator.LogStream { 110 func (m *CreateArchiveTask) logStream() *coordinator.LogStream {
111 return &coordinator.LogStream{ 111 return &coordinator.LogStream{
112 ID: m.ID, 112 ID: m.ID,
113 } 113 }
114 } 114 }
115 115
116 func init() { 116 func init() {
117 tumble.Register((*CreateArchiveTask)(nil)) 117 tumble.Register((*CreateArchiveTask)(nil))
118 } 118 }
OLDNEW
« no previous file with comments | « logdog/appengine/coordinator/endpoints/services/terminateStream_test.go ('k') | tumble/process.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698