00001 /* Copyright (C) 2003 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 #ifndef BACKUP_H 00018 #define BACKUP_H 00019 00020 #include <ndb_limits.h> 00021 #include <SimulatedBlock.hpp> 00022 00023 #include "FsBuffer.hpp" 00024 #include "BackupFormat.hpp" 00025 00026 #include <NodeBitmask.hpp> 00027 #include <SimpleProperties.hpp> 00028 00029 #include <SLList.hpp> 00030 #include <DLFifoList.hpp> 00031 #include <DLCFifoList.hpp> 00032 #include <SignalCounter.hpp> 00033 #include <blocks/mutexes.hpp> 00034 00035 #include <NdbTCP.h> 00036 #include <Array.hpp> 00037 00041 class Backup : public SimulatedBlock 00042 { 00043 public: 00044 Backup(Block_context& ctx); 00045 virtual ~Backup(); 00046 BLOCK_DEFINES(Backup); 00047 00048 protected: 00049 00050 void execSTTOR(Signal* signal); 00051 void execREAD_CONFIG_REQ(Signal* signal); 00052 void execDUMP_STATE_ORD(Signal* signal); 00053 void execREAD_NODESCONF(Signal* signal); 00054 void execNODE_FAILREP(Signal* signal); 00055 void execINCL_NODEREQ(Signal* signal); 00056 void execCONTINUEB(Signal* signal); 00057 00061 void execBACKUP_REF(Signal* signal); 00062 void execBACKUP_CONF(Signal* signal); 00063 void execBACKUP_ABORT_REP(Signal* signal); 00064 void execBACKUP_COMPLETE_REP(Signal* signal); 00065 00069 void execDEFINE_BACKUP_REQ(Signal* signal); 00070 void execBACKUP_DATA(Signal* signal); 00071 void execSTART_BACKUP_REQ(Signal* signal); 00072 void execBACKUP_FRAGMENT_REQ(Signal* signal); 00073 void execBACKUP_FRAGMENT_COMPLETE_REP(Signal* signal); 00074 void execSTOP_BACKUP_REQ(Signal* signal); 00075 void execBACKUP_STATUS_REQ(Signal* signal); 00076 void execABORT_BACKUP_ORD(Signal* signal); 00077 00081 void execSCAN_HBREP(Signal* signal); 00082 void execTRANSID_AI(Signal* signal); 00083 void execSCAN_FRAGREF(Signal* signal); 00084 void execSCAN_FRAGCONF(Signal* signal); 00085 00089 void execBACKUP_TRIG_REQ(Signal* signal); 00090 void execTRIG_ATTRINFO(Signal* signal); 00091 void execFIRE_TRIG_ORD(Signal* signal); 00092 00096 void execLIST_TABLES_CONF(Signal* signal); 00097 void execGET_TABINFOREF(Signal* signal); 00098 void execGET_TABINFO_CONF(Signal* signal); 00099 void execCREATE_TRIG_REF(Signal* signal); 00100 void execCREATE_TRIG_CONF(Signal* signal); 00101 void execDROP_TRIG_REF(Signal* signal); 00102 void execDROP_TRIG_CONF(Signal* signal); 00103 00107 void execDI_FCOUNTCONF(Signal* signal); 00108 void execDIGETPRIMCONF(Signal* signal); 00109 00113 void execFSOPENREF(Signal* signal); 00114 void execFSOPENCONF(Signal* signal); 00115 00116 void execFSCLOSEREF(Signal* signal); 00117 void execFSCLOSECONF(Signal* signal); 00118 00119 void execFSAPPENDREF(Signal* signal); 00120 void execFSAPPENDCONF(Signal* signal); 00121 00122 void execFSREMOVEREF(Signal* signal); 00123 void execFSREMOVECONF(Signal* signal); 00124 00128 void execBACKUP_REQ(Signal* signal); 00129 void execABORT_BACKUP_REQ(Signal* signal); 00130 00131 void execDEFINE_BACKUP_REF(Signal* signal); 00132 void execDEFINE_BACKUP_CONF(Signal* signal); 00133 00134 void execSTART_BACKUP_REF(Signal* signal); 00135 void execSTART_BACKUP_CONF(Signal* signal); 00136 00137 void execBACKUP_FRAGMENT_REF(Signal* signal); 00138 void execBACKUP_FRAGMENT_CONF(Signal* signal); 00139 00140 void execSTOP_BACKUP_REF(Signal* signal); 00141 void execSTOP_BACKUP_CONF(Signal* signal); 00142 00143 void execBACKUP_STATUS_CONF(Signal* signal); 00144 00145 void execUTIL_SEQUENCE_REF(Signal* signal); 00146 void execUTIL_SEQUENCE_CONF(Signal* signal); 00147 00148 void execWAIT_GCP_REF(Signal* signal); 00149 void execWAIT_GCP_CONF(Signal* signal); 00150 00151 void execLCP_PREPARE_REQ(Signal* signal); 00152 void execLCP_FRAGMENT_REQ(Signal*); 00153 void execEND_LCPREQ(Signal* signal); 00154 private: 00155 void defineBackupMutex_locked(Signal* signal, Uint32 ptrI,Uint32 retVal); 00156 void dictCommitTableMutex_locked(Signal* signal, Uint32 ptrI,Uint32 retVal); 00157 00158 public: 00159 struct Node { 00160 Uint32 nodeId; 00161 Uint32 alive; 00162 Uint32 nextList; 00163 union { Uint32 prevList; Uint32 nextPool; }; 00164 }; 00165 typedef Ptr<Node> NodePtr; 00166 00167 #define BACKUP_WORDS_PER_PAGE 8191 00168 struct Page32 { 00169 Uint32 data[BACKUP_WORDS_PER_PAGE]; 00170 Uint32 nextPool; 00171 }; 00172 typedef Ptr<Page32> Page32Ptr; 00173 00174 struct Attribute { 00175 enum Flags { 00176 COL_NULLABLE = 0x1, 00177 COL_FIXED = 0x2, 00178 COL_DISK = 0x4 00179 }; 00180 struct Data { 00181 Uint16 m_flags; 00182 Uint16 attrId; 00183 Uint32 sz32; // No of 32 bit words 00184 Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys 00185 Uint32 offsetNull; // In NullBitmask 00186 } data; 00187 union { 00188 Uint32 nextPool; 00189 Uint32 nextList; 00190 }; 00191 Uint32 prevList; 00192 }; 00193 typedef Ptr<Attribute> AttributePtr; 00194 00195 struct Fragment { 00196 Uint64 noOfRecords; 00197 Uint32 tableId; 00198 Uint16 node; 00199 Uint16 fragmentId; 00200 Uint8 scanned; // 0 = not scanned x = scanned by node x 00201 Uint8 scanning; // 0 = not scanning x = scanning on node x 00202 Uint8 lcp_no; 00203 Uint32 nextPool; 00204 }; 00205 typedef Ptr<Fragment> FragmentPtr; 00206 00207 struct Table { 00208 Table(ArrayPool<Attribute> &, ArrayPool<Fragment> &); 00209 00210 Uint64 noOfRecords; 00211 00212 Uint32 tableId; 00213 Uint32 schemaVersion; 00214 Uint32 tableType; 00215 Uint32 noOfNull; 00216 Uint32 noOfAttributes; 00217 Uint32 noOfVariable; 00218 Uint32 sz_FixedAttributes; 00219 Uint32 triggerIds[3]; 00220 bool triggerAllocated[3]; 00221 00222 DLFifoList<Attribute> attributes; 00223 Array<Fragment> fragments; 00224 00225 Uint32 nextList; 00226 union { Uint32 nextPool; Uint32 prevList; }; 00227 }; 00228 typedef Ptr<Table> TablePtr; 00229 00230 struct OperationRecord { 00231 public: 00232 OperationRecord(Backup & b) : backup(b) {} 00233 00237 void init(const TablePtr & ptr); 00238 00242 bool newFragment(Uint32 tableId, Uint32 fragNo); 00243 bool fragComplete(Uint32 tableId, Uint32 fragNo); 00244 00248 bool newScan(); 00249 bool scanConf(Uint32 noOfOps, Uint32 opLen); 00250 bool closeScan(); 00251 00255 void newRecord(Uint32 * base); 00256 bool finished(); 00257 00261 void nullVariable(); 00262 void nullAttribute(Uint32 nullOffset); 00263 Uint32 * newNullable(Uint32 attrId, Uint32 sz); 00264 Uint32 * newAttrib(Uint32 offset, Uint32 sz); 00265 Uint32 * newVariable(Uint32 id, Uint32 sz); 00266 00267 private: 00268 Uint32* base; 00269 Uint32* dst_Length; 00270 Uint32* dst_Bitmask; 00271 Uint32* dst_FixedAttribs; 00272 BackupFormat::DataFile::VariableData* dst_VariableData; 00273 00274 Uint32 noOfAttributes; // No of Attributes 00275 Uint32 attrLeft; // No of attributes left 00276 00277 Uint32 opNoDone; 00278 Uint32 opNoConf; 00279 Uint32 opLen; 00280 00281 public: 00282 Uint32* dst; 00283 Uint32 attrSzTotal; // No of AI words received 00284 Uint32 tablePtr; // Ptr.i to current table 00285 00286 FsBuffer dataBuffer; 00287 Uint64 noOfRecords; 00288 Uint64 noOfBytes; 00289 Uint32 maxRecordSize; 00290 00291 private: 00292 Uint32* scanStart; 00293 Uint32* scanStop; 00294 00298 Uint32 sz_Bitmask; 00299 Uint32 sz_FixedAttribs; 00300 00301 public: 00302 union { Uint32 nextPool; Uint32 nextList; }; 00303 Uint32 prevList; 00304 private: 00305 00306 Backup & backup; 00307 BlockNumber number() const { return backup.number(); } 00308 void progError(int line, int cause, const char * extra) { 00309 backup.progError(line, cause, extra); 00310 } 00311 }; 00312 friend struct OperationRecord; 00313 00314 struct TriggerRecord { 00315 TriggerRecord() { event = ~0;} 00316 OperationRecord * operation; 00317 BackupFormat::LogFile::LogEntry * logEntry; 00318 Uint32 maxRecordSize; 00319 Uint32 tableId; 00320 Uint32 tab_ptr_i; 00321 Uint32 event; 00322 Uint32 backupPtr; 00323 Uint32 errorCode; 00324 union { Uint32 nextPool; Uint32 nextList; }; 00325 }; 00326 typedef Ptr<TriggerRecord> TriggerPtr; 00327 00331 struct BackupFile { 00332 BackupFile(Backup & backup, ArrayPool<Page32> & pp) 00333 : operation(backup), pages(pp) {} 00334 00335 Uint32 backupPtr; // Pointer to backup record 00336 Uint32 tableId; 00337 Uint32 fragmentNo; 00338 Uint32 filePointer; 00339 Uint32 errorCode; 00340 BackupFormat::FileType fileType; 00341 OperationRecord operation; 00342 00343 Array<Page32> pages; 00344 Uint32 nextList; 00345 union { Uint32 prevList; Uint32 nextPool; }; 00346 00347 Uint8 fileOpened; 00348 Uint8 fileRunning; 00349 Uint8 fileClosing; 00350 Uint8 scanRunning; 00351 }; 00352 typedef Ptr<BackupFile> BackupFilePtr; 00353 00354 00358 enum State { 00359 INITIAL, 00360 DEFINING, // Defining backup content and parameters 00361 DEFINED, // DEFINE_BACKUP_CONF sent in slave, received all in master 00362 STARTED, // Creating triggers 00363 SCANNING, // Scanning fragments 00364 STOPPING, // Closing files 00365 CLEANING, // Cleaning resources 00366 ABORTING // Aborting backup 00367 }; 00368 00369 static const Uint32 validSlaveTransitionsCount; 00370 static const Uint32 validMasterTransitionsCount; 00371 static const State validSlaveTransitions[]; 00372 static const State validMasterTransitions[]; 00373 00374 class CompoundState { 00375 public: 00376 CompoundState(Backup & b, 00377 const State valid[], 00378 Uint32 count, Uint32 _id) 00379 : backup(b) 00380 , validTransitions(valid), 00381 noOfValidTransitions(count), id(_id) 00382 { 00383 state = INITIAL; 00384 abortState = state; 00385 } 00386 00387 void setState(State s); 00388 State getState() const { return state;} 00389 State getAbortState() const { return abortState;} 00390 00391 void forceState(State s); 00392 00393 BlockNumber number() const { return backup.number(); } 00394 void progError(int line, int cause, const char * extra) { 00395 backup.progError(line, cause, extra); 00396 } 00397 private: 00398 Backup & backup; 00399 State state; 00400 State abortState; 00404 const State * validTransitions; 00405 const Uint32 noOfValidTransitions; 00406 const Uint32 id; 00407 }; 00408 friend class CompoundState; 00409 00415 struct BackupRecord { 00416 BackupRecord(Backup& b, 00417 ArrayPool<Table> & tp, 00418 ArrayPool<BackupFile> & bp, 00419 ArrayPool<TriggerRecord> & trp) 00420 : slaveState(b, validSlaveTransitions, validSlaveTransitionsCount,1) 00421 , tables(tp), triggers(trp), files(bp) 00422 , masterData(b), backup(b) 00423 { 00424 } 00425 00426 Uint32 m_gsn; 00427 CompoundState slaveState; 00428 00429 Uint32 clientRef; 00430 Uint32 clientData; 00431 Uint32 flags; 00432 Uint32 signalNo; 00433 Uint32 backupId; 00434 Uint32 backupKey[2]; 00435 Uint32 masterRef; 00436 Uint32 errorCode; 00437 NdbNodeBitmask nodes; 00438 00439 Uint64 noOfBytes; 00440 Uint64 noOfRecords; 00441 Uint64 noOfLogBytes; 00442 Uint64 noOfLogRecords; 00443 00444 Uint32 startGCP; 00445 Uint32 currGCP; 00446 Uint32 stopGCP; 00447 DLCFifoList<Table> tables; 00448 SLList<TriggerRecord> triggers; 00449 00450 SLList<BackupFile> files; 00451 Uint32 ctlFilePtr; // Ptr.i to ctl-file 00452 Uint32 logFilePtr; // Ptr.i to log-file 00453 Uint32 dataFilePtr; // Ptr.i to first data-file 00454 00455 Uint32 backupDataLen; // Used for (un)packing backup request 00456 SimpleProperties props;// Used for (un)packing backup request 00457 00458 struct SlaveData { 00459 SignalCounter trigSendCounter; 00460 Uint32 gsn; 00461 struct { 00462 Uint32 tableId; 00463 } createTrig; 00464 struct { 00465 Uint32 tableId; 00466 } dropTrig; 00467 } slaveData; 00468 00469 struct MasterData { 00470 MasterData(Backup & b) 00471 { 00472 } 00473 MutexHandle2<BACKUP_DEFINE_MUTEX> m_defineBackupMutex; 00474 MutexHandle2<DICT_COMMIT_TABLE_MUTEX> m_dictCommitTableMutex; 00475 00476 Uint32 gsn; 00477 SignalCounter sendCounter; 00478 Uint32 errorCode; 00479 union { 00480 struct { 00481 Uint32 startBackup; 00482 } waitGCP; 00483 struct { 00484 Uint32 signalNo; 00485 Uint32 noOfSignals; 00486 Uint32 tablePtr; 00487 } startBackup; 00488 struct { 00489 Uint32 dummy; 00490 } stopBackup; 00491 }; 00492 } masterData; 00493 00494 Uint32 nextList; 00495 union { Uint32 prevList; Uint32 nextPool; }; 00496 00497 void setErrorCode(Uint32 errCode){ 00498 if(errorCode == 0) 00499 errorCode = errCode; 00500 } 00501 00502 bool checkError() const { 00503 return errorCode != 0; 00504 } 00505 00506 bool is_lcp() const { 00507 return backupDataLen == ~(Uint32)0; 00508 } 00509 00510 Backup & backup; 00511 BlockNumber number() const { return backup.number(); } 00512 void progError(int line, int cause, const char * extra) { 00513 backup.progError(line, cause, extra); 00514 } 00515 }; 00516 friend struct BackupRecord; 00517 typedef Ptr<BackupRecord> BackupRecordPtr; 00518 00519 struct Config { 00520 Uint32 m_dataBufferSize; 00521 Uint32 m_logBufferSize; 00522 Uint32 m_minWriteSize; 00523 Uint32 m_maxWriteSize; 00524 Uint32 m_lcp_buffer_size; 00525 }; 00526 00530 Uint32 * c_startOfPages; 00531 NodeId c_masterNodeId; 00532 SLList<Node> c_nodes; 00533 NdbNodeBitmask c_aliveNodes; 00534 DLList<BackupRecord> c_backups; 00535 Config c_defaults; 00536 Uint32 m_diskless; 00537 00538 STATIC_CONST(NO_OF_PAGES_META_FILE = MAX_WORDS_META_FILE/BACKUP_WORDS_PER_PAGE); 00539 00543 ArrayPool<Table> c_tablePool; 00544 ArrayPool<Attribute> c_attributePool; 00545 ArrayPool<BackupRecord> c_backupPool; 00546 ArrayPool<BackupFile> c_backupFilePool; 00547 ArrayPool<Page32> c_pagePool; 00548 ArrayPool<Fragment> c_fragmentPool; 00549 ArrayPool<Node> c_nodePool; 00550 ArrayPool<TriggerRecord> c_triggerPool; 00551 00552 void checkFile(Signal*, BackupFilePtr); 00553 void checkScan(Signal*, BackupFilePtr); 00554 void fragmentCompleted(Signal*, BackupFilePtr); 00555 00556 void backupAllData(Signal* signal, BackupRecordPtr); 00557 00558 void getFragmentInfo(Signal*, BackupRecordPtr, TablePtr, Uint32 fragNo); 00559 void getFragmentInfoDone(Signal*, BackupRecordPtr); 00560 00561 void openFiles(Signal* signal, BackupRecordPtr ptr); 00562 void openFilesReply(Signal*, BackupRecordPtr ptr, BackupFilePtr); 00563 void closeFiles(Signal*, BackupRecordPtr ptr); 00564 void closeFilesDone(Signal*, BackupRecordPtr ptr); 00565 00566 void sendDefineBackupReq(Signal *signal, BackupRecordPtr ptr); 00567 00568 void defineBackupReply(Signal* signal, BackupRecordPtr ptr, Uint32 nodeId); 00569 void createTrigReply(Signal* signal, BackupRecordPtr ptr); 00570 void alterTrigReply(Signal* signal, BackupRecordPtr ptr); 00571 void startBackupReply(Signal* signal, BackupRecordPtr ptr, Uint32); 00572 void stopBackupReply(Signal* signal, BackupRecordPtr ptr, Uint32 nodeId); 00573 00574 void defineBackupRef(Signal*, BackupRecordPtr, Uint32 errCode = 0); 00575 void backupFragmentRef(Signal * signal, BackupFilePtr filePtr); 00576 00577 void nextFragment(Signal*, BackupRecordPtr); 00578 00579 void sendCreateTrig(Signal*, BackupRecordPtr ptr, TablePtr tabPtr); 00580 void createAttributeMask(TablePtr tab, Bitmask<MAXNROFATTRIBUTESINWORDS>&); 00581 void sendStartBackup(Signal*, BackupRecordPtr, TablePtr); 00582 void sendAlterTrig(Signal*, BackupRecordPtr ptr); 00583 00584 void sendDropTrig(Signal*, BackupRecordPtr ptr); 00585 void sendDropTrig(Signal* signal, BackupRecordPtr ptr, TablePtr tabPtr); 00586 void dropTrigReply(Signal*, BackupRecordPtr ptr); 00587 00588 void sendSignalAllWait(BackupRecordPtr ptr, Uint32 gsn, Signal *signal, 00589 Uint32 signalLength, 00590 bool executeDirect = false); 00591 bool haveAllSignals(BackupRecordPtr ptr, Uint32 gsn, Uint32 nodeId); 00592 00593 void sendStopBackup(Signal*, BackupRecordPtr ptr); 00594 void sendAbortBackupOrd(Signal* signal, BackupRecordPtr ptr, Uint32 errCode); 00595 void sendAbortBackupOrdSlave(Signal* signal, BackupRecordPtr ptr, 00596 Uint32 errCode); 00597 void masterAbort(Signal*, BackupRecordPtr ptr); 00598 void masterSendAbortBackup(Signal*, BackupRecordPtr ptr); 00599 void slaveAbort(Signal*, BackupRecordPtr ptr); 00600 00601 void abortFile(Signal* signal, BackupRecordPtr ptr, BackupFilePtr filePtr); 00602 void abortFileHook(Signal* signal, BackupFilePtr filePtr, bool scanDone); 00603 00604 bool verifyNodesAlive(BackupRecordPtr, const NdbNodeBitmask& aNodeBitMask); 00605 bool checkAbort(BackupRecordPtr ptr); 00606 void checkNodeFail(Signal* signal, 00607 BackupRecordPtr ptr, 00608 NodeId newCoord, 00609 Uint32 theFailedNodes[NodeBitmask::Size]); 00610 void masterTakeOver(Signal* signal, BackupRecordPtr ptr); 00611 00612 00613 NodeId getMasterNodeId() const { return c_masterNodeId; } 00614 bool findTable(const BackupRecordPtr &, TablePtr &, Uint32 tableId) const; 00615 bool parseTableDescription(Signal*, BackupRecordPtr ptr, TablePtr, const Uint32*, Uint32); 00616 00617 bool insertFileHeader(BackupFormat::FileType, BackupRecord*, BackupFile*); 00618 void sendBackupRef(Signal* signal, BackupRecordPtr ptr, Uint32 errorCode); 00619 void sendBackupRef(BlockReference ref, Uint32 flags, Signal *signal, 00620 Uint32 senderData, Uint32 errorCode); 00621 void dumpUsedResources(); 00622 void cleanup(Signal*, BackupRecordPtr ptr); 00623 void abort_scan(Signal*, BackupRecordPtr ptr); 00624 void removeBackup(Signal*, BackupRecordPtr ptr); 00625 00626 void sendSTTORRY(Signal*); 00627 void createSequence(Signal* signal); 00628 void createSequenceReply(Signal*, class UtilSequenceConf *); 00629 00630 void lcp_open_file(Signal* signal, BackupRecordPtr ptr); 00631 void lcp_open_file_done(Signal*, BackupRecordPtr); 00632 void lcp_close_file_conf(Signal* signal, BackupRecordPtr); 00633 void lcp_send_end_lcp_conf(Signal* signal, BackupRecordPtr); 00634 }; 00635 00636 inline 00637 void 00638 Backup::OperationRecord::newRecord(Uint32 * p){ 00639 base = p; 00640 dst_Length = p; p += 1; 00641 dst_Bitmask = p; p += sz_Bitmask; 00642 dst_FixedAttribs = p; p += sz_FixedAttribs; 00643 dst_VariableData = (BackupFormat::DataFile::VariableData*)p; 00644 BitmaskImpl::clear(sz_Bitmask, dst_Bitmask); 00645 attrLeft = noOfAttributes; 00646 attrSzTotal = 0; 00647 } 00648 00649 inline 00650 Uint32 * 00651 Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){ 00652 attrLeft--; 00653 dst = dst_FixedAttribs + offset; 00654 return dst; 00655 } 00656 00657 inline 00658 void 00659 Backup::OperationRecord::nullAttribute(Uint32 offsetNull){ 00660 attrLeft --; 00661 BitmaskImpl::set(sz_Bitmask, dst_Bitmask, offsetNull); 00662 } 00663 00664 inline 00665 void 00666 Backup::OperationRecord::nullVariable() 00667 { 00668 attrLeft --; 00669 } 00670 00671 inline 00672 Uint32 * 00673 Backup::OperationRecord::newNullable(Uint32 id, Uint32 sz){ 00674 Uint32 sz32 = (sz + 3) >> 2; 00675 00676 attrLeft--; 00677 00678 dst = &dst_VariableData->Data[0]; 00679 dst_VariableData->Sz = htonl(sz); 00680 dst_VariableData->Id = htonl(id); 00681 00682 dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz32); 00683 00684 // Clear all bits on newRecord -> dont need to clear this 00685 // BitmaskImpl::clear(sz_Bitmask, dst_Bitmask, offsetNull); 00686 return dst; 00687 } 00688 00689 inline 00690 Uint32 * 00691 Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){ 00692 Uint32 sz32 = (sz + 3) >> 2; 00693 00694 attrLeft--; 00695 00696 dst = &dst_VariableData->Data[0]; 00697 dst_VariableData->Sz = htonl(sz); 00698 dst_VariableData->Id = htonl(id); 00699 00700 dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz32); 00701 return dst; 00702 } 00703 00704 inline 00705 bool 00706 Backup::OperationRecord::finished(){ 00707 if(attrLeft != 0){ 00708 return false; 00709 } 00710 00711 opLen += attrSzTotal; 00712 opNoDone++; 00713 00714 scanStop = dst = (Uint32 *)dst_VariableData; 00715 00716 const Uint32 len = (dst - base - 1); 00717 * dst_Length = htonl(len); 00718 00719 noOfRecords++; 00720 00721 return true; 00722 } 00723 00724 #endif
1.4.7

