~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/transaction_writer.cc

  • Committer: Eric Day
  • Date: 2009-10-31 21:53:33 UTC
  • mfrom: (1200 staging)
  • mto: This revision was merged to the branch mainline in revision 1202.
  • Revision ID: eday@oddments.org-20091031215333-j94bjoanwmi68p6f
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22
22
 */
23
23
 
24
 
#include <drizzled/global.h>
25
 
#include <drizzled/gettext.h>
 
24
#include "drizzled/global.h"
 
25
#include "drizzled/hash/crc32.h"
 
26
#include "drizzled/gettext.h"
 
27
#include "drizzled/replication_services.h"
 
28
 
26
29
#include <sys/types.h>
27
30
#include <sys/stat.h>
28
31
#include <fcntl.h>
34
37
#include <google/protobuf/io/coded_stream.h>
35
38
#include <google/protobuf/io/zero_copy_stream_impl.h>
36
39
 
 
40
#include "drizzled/gettext.h"
 
41
 
37
42
/** 
38
43
 * @file Example script for writing transactions to a log file.
39
44
 */
274
279
  record1->add_key_value("1");
275
280
  record2->add_key_value("2");
276
281
 
277
 
 
278
282
  statement->set_end_timestamp(getNanoTimestamp());
279
283
}
280
284
 
286
290
 
287
291
  size_t length= buffer.length();
288
292
 
289
 
  output->WriteLittleEndian64(static_cast<uint64_t>(length));
 
293
  output->WriteLittleEndian32(static_cast<uint32_t>(ReplicationServices::TRANSACTION));
 
294
  output->WriteLittleEndian32(static_cast<uint32_t>(length));
290
295
  output->WriteString(buffer);
 
296
  output->WriteLittleEndian32(drizzled::hash::crc32(buffer.c_str(), length)); /* checksum */
291
297
}
292
298
 
293
299
int main(int argc, char* argv[])