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

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

Issue 2611253005: Fix BigTable multi-entry row cached Tail. (Closed)
Patch Set: Created 3 years, 11 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/common/storage/bigtable/rowKey.go
diff --git a/logdog/common/storage/bigtable/rowKey.go b/logdog/common/storage/bigtable/rowKey.go
index fbd60f17747b4002c5a67cef6ef2f11d989c94b9..a358a8275f322d9e3bdd28e23d9491bafc2f0229 100644
--- a/logdog/common/storage/bigtable/rowKey.go
+++ b/logdog/common/storage/bigtable/rowKey.go
@@ -91,6 +91,9 @@ func (rkb *rowKeyBuffers) value() string {
// - Rows with the same path should be clustered.
// - Rows with the same path should be sorted according to index.
//
+// The row key index is the index of the LAST entry in the row. Therefore, a
+// row for a given row key will span log indexes [index-count+1..index].
+//
// Since BigTable rows must be valid UTF8, and since paths are effectively
// unbounded, the row key will be formed by composing:
//
@@ -199,6 +202,9 @@ func (rk *rowKey) pathPrefixUpperBound() (v string) {
return
}
+// firstIndex returns the first log entry index represented by this row key.
+func (rk *rowKey) firstIndex() int64 { return rk.index - rk.count + 1 }
+
// sharesPrefixWith tests if the "path" component of the row key "rk" matches
// the "path" component of "o".
func (rk *rowKey) sharesPathWith(o *rowKey) bool {

Powered by Google App Engine
This is Rietveld 408576698