Doing bulkd writes instead of individual writes now.

Also slight change to Writer API, going back to how the rotate methods
were before.
This commit is contained in:
Robin Sommer 2012-02-01 00:34:18 -08:00
parent a428645b2a
commit 4f0fc571ef
9 changed files with 155 additions and 67 deletions

View file

@ -34,6 +34,7 @@ public:
void Write(int num_fields, Value** vals);
void SetBuf(bool enabled);
void Flush();
void FlushWriteBuffer();
void Rotate(string rotated_path, double open, double close, bool terminating);
void Finish();
@ -49,18 +50,22 @@ public:
protected:
friend class Manager;
WriterBackend* backend;
bool disabled;
bool initialized;
bool buf;
string path;
int num_fields;
const Field* const * fields;
// Buffer for bulk writes.
static const int WRITER_BUFFER_SIZE = 50;
int write_buffer_pos;
Value*** write_buffer;
};
}
#endif