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

Unified Diff: client/internal/logdog/butler/bundler/doc.go

Issue 1412063008: logdog: Add bundler library. (Closed) Base URL: https://github.com/luci/luci-go@logdog-review-streamserver
Patch Set: Enhanced doc.go. Created 5 years, 1 month 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: client/internal/logdog/butler/bundler/doc.go
diff --git a/client/internal/logdog/butler/bundler/doc.go b/client/internal/logdog/butler/bundler/doc.go
new file mode 100644
index 0000000000000000000000000000000000000000..23964d1a90d1c9edd751a27477451070217a0003
--- /dev/null
+++ b/client/internal/logdog/butler/bundler/doc.go
@@ -0,0 +1,39 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Package bundler is responsible for efficiently transforming aggregate stream
+// data into Butler messages for export.
+//
+// A process will instantiate a single Bundler instance. The Bundler manages an
+// elastic set of Stream instances, each of which containts state for a single
estaab 2015/11/13 04:02:47 contains
dnj 2015/11/14 00:30:36 Done.
+// log Stream.
+//
+// Each Stream instance will have sequential stream binary data appended to it
+// via Append, which it will collect and organize for export as a series of
+// ButlerLogBundle_Entry protobufs. Streams operate independently and buffer
+// data until it is consumed by their Bundler instance. If a Stream's buffer is
+// full, the Stream will block on appending data, whih will, in turn, block its
estaab 2015/11/13 04:02:47 which
dnj 2015/11/14 00:30:36 Done.
+// data source.
+//
+// The Bundler owns the various Stream instances. When its Next() method is
+// called, it will sort through the stream instances to prepare an
+// optimally-sized ButlerLogBundle protobuf for export. The construction of this
+// bundle may block pending data, and may be subject to various data urgency
+// requests.
+//
+// The Bundler acknowledges the following constraints:
+// - Data enqueued into a Stream should be exported within a specific period
+// of time from its introduction
+// - The exported ButlerLogBundle protobuf must not exceed a maximum bundle
+// size constraint.
+// - Stream data may be added during the bundling process, and should be
+// acknowleged if possible.
+//
+// When a Stream is finished, its Close method should be called. This alerts the
+// Stream that it will receive no more data, causing it to export a terminal
+// ButlerLogBundle and unregister from the Bundler.
+//
+// The Bundler may block via its CloseAndFinish() method until all Streams are
+// drained and cleared.
+package bundler

Powered by Google App Engine
This is Rietveld 408576698