| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Package bundler is responsible for efficiently transforming aggregate stream |
| 6 // data into Butler messages for export. |
| 7 // |
| 8 // A process will instantiate a single Bundler instance. The Bundler manages an |
| 9 // elastic set of Stream instances, each of which contains state for a single |
| 10 // log Stream. |
| 11 // |
| 12 // Each Stream instance will have sequential stream binary data appended to it |
| 13 // via Append, which it will collect and organize for export as a series of |
| 14 // ButlerLogBundle_Entry protobufs. Streams operate independently and buffer |
| 15 // data until it is consumed by their Bundler instance. If a Stream's buffer is |
| 16 // full, the Stream will block on appending data, which will, in turn, block its |
| 17 // data source. |
| 18 // |
| 19 // The Bundler owns the various Stream instances. When its Next() method is |
| 20 // called, it will sort through the stream instances to prepare an |
| 21 // optimally-sized ButlerLogBundle protobuf for export. The construction of this |
| 22 // bundle may block pending data, and may be subject to various data urgency |
| 23 // requests. |
| 24 // |
| 25 // The Bundler acknowledges the following constraints: |
| 26 // - Data enqueued into a Stream should be exported within a specific period |
| 27 // of time from its introduction |
| 28 // - The exported ButlerLogBundle protobuf must not exceed a maximum bundle |
| 29 // size constraint. |
| 30 // - Stream data may be added during the bundling process, and should be |
| 31 // acknowleged if possible. |
| 32 // |
| 33 // When a Stream is finished, its Close method should be called. This alerts the |
| 34 // Stream that it will receive no more data, causing it to export a terminal |
| 35 // ButlerLogBundle and unregister from the Bundler. |
| 36 // |
| 37 // The Bundler may block via its CloseAndFinish() method until all Streams are |
| 38 // drained and cleared. |
| 39 package bundler |
| OLD | NEW |