Changeset 1940
- Timestamp:
- 06/12/2007 08:50:32 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/lib/backupclient/BackupStoreFileDiff.cpp
r1191 r1940 19 19 #endif 20 20 21 #include "BackupStoreConstants.h" 22 #include "BackupStoreException.h" 21 23 #include "BackupStoreFile.h" 24 #include "BackupStoreFileCryptVar.h" 25 #include "BackupStoreFileEncodeStream.h" 22 26 #include "BackupStoreFileWire.h" 23 #include "BackupStoreFileCryptVar.h"24 27 #include "BackupStoreObjectMagic.h" 25 #include "BackupStoreException.h" 26 #include "BackupStoreFileEncodeStream.h" 27 #include "BackupStoreConstants.h" 28 #include "CommonException.h" 28 29 #include "FileStream.h" 30 #include "MD5Digest.h" 29 31 #include "RollingChecksum.h" 30 #include "MD5Digest.h"31 #include "CommonException.h"32 32 #include "Timer.h" 33 33 … … 486 486 } 487 487 488 // TODO: Use buffered file class 489 // Because we read in the file a scanned block size at a time, it is likely to be 490 // inefficient. Probably will be much better to use a buffering IOStream class which 491 // reads data in at the size of the filesystem block size. 488 // TODO: Because we read in the file a scanned block size at a time, 489 // it is likely to be inefficient. Probably will be much better to 490 // calculate checksums for all block sizes in a single pass. 492 491 493 492 // Allocate the buffers. … … 514 513 { 515 514 ASSERT(Sizes[s] <= bufSize); 516 //TRACE2("Diff pass %d, for block size %d\n", s, Sizes[s]); 515 BOX_TRACE("Diff pass " << s << ", for block size " << 516 Sizes[s]); 517 517 518 518 // Check we haven't finished … … 553 553 { 554 554 ASSERT(pDiffTimer != NULL); 555 TRACE0("MaximumDiffingTime reached - "556 "suspending file diff \n");555 BOX_INFO("MaximumDiffingTime reached - " 556 "suspending file diff"); 557 557 abortSearch = true; 558 558 break; … … 622 622 if(SecondStageMatch(phashTable[hash], rolling, beginnings, endings, offset, Sizes[s], fileBlockNumber, pIndex, rFoundBlocks)) 623 623 { 624 BOX_TRACE("Found block match for " << hash << " of " << Sizes[s] << " bytes at offset " << fileOffset); 624 625 goodnessOfFit[fileOffset] = Sizes[s]; 625 626 … … 646 647 // End this loop, so the final byte isn't used again 647 648 break; 649 } 650 else 651 { 652 BOX_TRACE("False alarm match for " << hash << " of " << Sizes[s] << " bytes at offset " << fileOffset); 648 653 } 649 654 … … 723 728 { 724 729 // Trace out the found blocks in debug mode 725 TRACE0("Diff: list of found blocks\n======== ======== ======== ========\n Offset BlkIdx Size Movement\n"); 730 BOX_TRACE("Diff: list of found blocks"); 731 BOX_TRACE("======== ======== ======== ========"); 732 BOX_TRACE(" Offset BlkIdx Size Movement"); 726 733 for(std::map<int64_t, int64_t>::const_iterator i(rFoundBlocks.begin()); i != rFoundBlocks.end(); ++i) 727 734 { … … 731 738 orgLoc += pIndex[b].mSize; 732 739 } 733 TRACE4("%8lld %8lld %8lld %8lld\n", i->first, i->second, 734 (int64_t)(pIndex[i->second].mSize), i->first - orgLoc); 735 } 736 TRACE0("======== ======== ======== ========\n"); 740 BOX_TRACE(std::setw(8) << i->first << " " << 741 std::setw(8) << i->second << " " << 742 std::setw(8) << pIndex[i->second].mSize << 743 " " << 744 std::setw(8) << (i->first - orgLoc)); 745 } 746 BOX_TRACE("======== ======== ======== ========"); 737 747 } 738 748 #endif
