Project

General

Profile

CommonFormatter - make it streamable » History » Version 2

Jessica Mack, 05/28/2015 05:57 PM

1 1 Jessica Mack
h1. CommonFormatter - make it streamable
2
3
h3. Task Name: 
4
5
make Formatter streamable
6
7
h3. Size:
8
 
9
S
10
11
h3. Skill:
12
 
13
intermediate
14
15
h3. Mentor(s):
16
17 2 Jessica Mack
"Sage Weil":mailto:sage@inktank.com
18 1 Jessica Mack
 
19
h3. Components:
20
 
21
common/Formatter
22
optionally adjust users
23
24
h3. Description:
25
26
The current Formatter interface accumulates everything in an in-memory buffer (or buffers, even), which makes it unusable in cases where we are dumping/formatter large amounts of memory (e.g., a significant portion of the allocate memory).  We should make an alternative interface that lets you specify an ostream for the Formatter and emits output as it goes (instead of appending to the buffer).
27
28
h3. External Documentation:
29
30
Edit section
31
 http://stackoverflow.com/questions/524641/how-do-i-create-my-own-ostream-streambuf
32
 
33
there is also an ostream stream_buf in tree; see https://github.com/ceph/ceph/blob/master/src/common/PrebufferedStreambuf.h