/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * \file TransactionHeader.h * * List of journal record structs: * struct DequeueHeader * struct EnqueueHeader * struct EventHeader * struct FileHeader * struct RecordHeader * struct RecordTail * struct TransactionHeader <-- This file * * Overview of journal record structs: * *
* +------------+ +--------------+ * | RecordTail | | RecordHeader | * +------------+ | (abstract) | * +--------------+ * ^ * | * +----------------+---------+-------+-------------------+ * | | | | * +------------+ +-------------+ +---------------+ +-------------------+ * | FileHeader | | EventHeader | | DequeueHeader | | TransactionHeader | * +------------+ +-------------+ +---------------+ +-------------------+ * ^ * | * +---------------+ * | EnqueueHeader | * +---------------+ **/ #ifndef qpid_asyncStore_jrnl2_TransactionHeader_h_ #define qpid_asyncStore_jrnl2_TransactionHeader_h_ #include "qpid/asyncStore/jrnl2/RecordHeader.h" namespace qpid { namespace asyncStore { namespace jrnl2 { #pragma pack(1) /** * \brief Struct for transaction commit and abort records. * * Struct for DTX commit and abort records. Only the magic distinguishes between them. Since * this record must be used in the context of a valid XID, the xidsize field must not be zero. * Immediately following this record is the XID itself which is xidsize bytes long, followed by * a rec_tail. * * Note that this record had its own rid distinct from the rids of the record(s) making up the * transaction it is committing or aborting. * * Record layout in binary format (24 bytes): *
* 0x0 0x7 * +-----+-----+-----+-----+-----+-----+-----+-----+ -+ * 0x00 | _magic | v | e | _flags | | * +-----+-----+-----+-----+-----+-----+-----+-----+ | struct RecordHeader * 0x08 | _recordId | | * +-----+-----+-----+-----+-----+-----+-----+-----+ -+ * 0x10 | _xidSize | * +-----+-----+-----+-----+-----+-----+-----+-----+ **
v | *file version [ _version ] (If the format or encoding of
* this file changes, then this number should be incremented) |
*
e | *endian flag [ _bigEndianFlag ], false (0x00) for
* little endian, true (0x01) for big endian |
*