Exemple #1
0
        /** we will build an output buffer ourself and then use O_DIRECT
            we could be in read lock for this
            caller handles locking
            @return partially populated sectheader and _ab set
        */
        static void _PREPLOGBUFFER(JSectHeader& h, AlignedBuilder& bb) {
            verify(storageGlobalParams.dur);

            resetLogBuffer(h, bb); // adds JSectHeader

            // ops other than basic writes (DurOp's)
            {
                for( vector< shared_ptr<DurOp> >::iterator i = commitJob.ops().begin(); i != commitJob.ops().end(); ++i ) {
                    (*i)->serialize(bb);
                }
            }

            prepBasicWrites(bb);

            return;
        }
Exemple #2
0
        /** we will build an output buffer ourself and then use O_DIRECT
            we could be in read lock for this
            caller handles locking
            @return partially populated sectheader and _ab set
        */
        static void _PREPLOGBUFFER(JSectHeader& h, AlignedBuilder& bb) {
            assert( cmdLine.dur );
            assertLockedForCommitting();

            resetLogBuffer(h, bb); // adds JSectHeader

            // ops other than basic writes (DurOp's)
            {
                for( vector< shared_ptr<DurOp> >::iterator i = commitJob.ops().begin(); i != commitJob.ops().end(); ++i ) {
                    (*i)->serialize(bb);
                }
            }

            prepBasicWrites(bb);

            return;
        }
Exemple #3
0
/** we will build an output buffer ourself and then use O_DIRECT
    we could be in read lock for this
    caller handles locking
    @return partially populated sectheader and _ab set
*/
static void _PREPLOGBUFFER(JSectHeader& h, AlignedBuilder& bb) {
    // Add the JSectHeader

    // Invalidate the total length, we will fill it in later.
    h.setSectionLen(0xffffffff);
    h.seqNumber = getLastDataFileFlushTime();
    h.fileId = j.curFileId();

    // Ops other than basic writes (DurOp's) go first
    const std::vector<std::shared_ptr<DurOp>>& durOps = commitJob.ops();
    for (std::vector<std::shared_ptr<DurOp>>::const_iterator i = durOps.begin(); i != durOps.end();
         i++) {
        (*i)->serialize(bb);
    }

    // Write intents
    const std::vector<WriteIntent>& intents = commitJob.getIntentsSorted();
    if (!intents.empty()) {
        prepBasicWrites(bb, intents);
    }
}