MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / flush

Method flush

src/jrd/replication/Replicator.cpp:49–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void Replicator::flush(BatchBlock& block, FlushReason reason, ULONG flags)
50{
51 const auto traNumber = block.header.traNumber;
52
53 const auto length = (ULONG) (block.buffer->getCount() - sizeof(Block));
54 fb_assert(length);
55
56 block.header.protocol = PROTOCOL_CURRENT_VERSION;
57 block.header.flags |= flags;
58 block.header.length = length;
59
60 // Re-write the updated header
61
62 memcpy(block.buffer->begin(), &block.header, sizeof(Block));
63
64 // Pass the buffer to the replication manager and setup the new one
65
66 const auto sync = (reason == FLUSH_SYNC);
67 const auto prepare = (reason == FLUSH_PREPARE);
68 m_manager->flush(block.buffer, sync, prepare);
69
70 memset(&block.header, 0, sizeof(Block));
71 block.header.traNumber = traNumber;
72
73 block.atoms.clear();
74 block.lastAtom = MAX_ULONG;
75 block.buffer = m_manager->getBuffer();
76 block.flushes++;
77}
78
79void Replicator::storeBlob(Transaction* transaction, ISC_QUAD blobId)
80{

Callers

nothing calls this directly

Calls 4

getCountMethod · 0.45
beginMethod · 0.45
clearMethod · 0.45
getBufferMethod · 0.45

Tested by

no test coverage detected