[Box Backup-commit] COMMIT r3386 - in box/trunk: bin/bbackupd lib/backupstore

subversion at boxbackup.org subversion at boxbackup.org
Thu Sep 4 02:36:34 BST 2014


Author: chris
Date: 2014-09-04 02:36:34 +0100 (Thu, 04 Sep 2014)
New Revision: 3386

Modified:
   box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp
   box/trunk/bin/bbackupd/BackupDaemon.h
   box/trunk/bin/bbackupd/BackupDaemonInterface.h
   box/trunk/lib/backupstore/BackupStoreFileEncodeStream.h
Log:
Add EstimatedBytesToUpload to NotifyFileUploadingPatch.

Merged back changes from the test refactor branch to reduce diffs.

Modified: box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp	2014-09-04 01:36:30 UTC (rev 3385)
+++ box/trunk/bin/bbackupd/BackupClientDirectoryRecord.cpp	2014-09-04 01:36:34 UTC (rev 3386)
@@ -1745,8 +1745,6 @@
 			if(diffFromID != 0)
 			{
 				// Found an old version
-				rNotifier.NotifyFileUploadingPatch(this,
-					rNonVssFilePath);
 
 				// Get the index
 				std::auto_ptr<IOStream> blockIndexStream(connection.ReceiveStream());
@@ -1778,8 +1776,13 @@
 			}
 		}
 
-		if(!apStreamToUpload.get()) // No patch upload, so do a normal upload
+		if(apStreamToUpload.get())
 		{
+			rNotifier.NotifyFileUploadingPatch(this, rNonVssFilePath,
+				apStreamToUpload->GetBytesToUpload());
+		}
+		else // No patch upload, so do a normal upload
+		{
 			// below threshold or nothing to diff from, so upload whole
 			rNotifier.NotifyFileUploading(this, rNonVssFilePath);
 			

Modified: box/trunk/bin/bbackupd/BackupDaemon.h
===================================================================
--- box/trunk/bin/bbackupd/BackupDaemon.h	2014-09-04 01:36:30 UTC (rev 3385)
+++ box/trunk/bin/bbackupd/BackupDaemon.h	2014-09-04 01:36:34 UTC (rev 3386)
@@ -403,11 +403,14 @@
 	}
 	virtual void NotifyFileUploadingPatch(
 		const BackupClientDirectoryRecord* pDirRecord,
-		const std::string& rLocalPath)
+		const std::string& rLocalPath,
+		int64_t EstimatedBytesToUpload)
 	{
 		if (mLogAllFileAccess)
 		{
-			BOX_NOTICE("Uploading patch to file: " << rLocalPath);
+			BOX_NOTICE("Uploading patch to file: " << rLocalPath <<
+				", estimated upload size = " <<
+				EstimatedBytesToUpload);
 		}
 	}
 	virtual void NotifyFileUploadingAttributes(

Modified: box/trunk/bin/bbackupd/BackupDaemonInterface.h
===================================================================
--- box/trunk/bin/bbackupd/BackupDaemonInterface.h	2014-09-04 01:36:30 UTC (rev 3385)
+++ box/trunk/bin/bbackupd/BackupDaemonInterface.h	2014-09-04 01:36:34 UTC (rev 3386)
@@ -116,7 +116,8 @@
 		const std::string& rLocalPath) = 0;
 	virtual void NotifyFileUploadingPatch(
 		const BackupClientDirectoryRecord* pDirRecord,
-		const std::string& rLocalPath) = 0;
+		const std::string& rLocalPath,
+		int64_t EstimatedBytesToUpload) = 0;
 	virtual void NotifyFileUploadingAttributes(
  		const BackupClientDirectoryRecord* pDirRecord,
  		const std::string& rLocalPath) = 0;

Modified: box/trunk/lib/backupstore/BackupStoreFileEncodeStream.h
===================================================================
--- box/trunk/lib/backupstore/BackupStoreFileEncodeStream.h	2014-09-04 01:36:30 UTC (rev 3385)
+++ box/trunk/lib/backupstore/BackupStoreFileEncodeStream.h	2014-09-04 01:36:34 UTC (rev 3386)
@@ -87,6 +87,7 @@
 		int Timeout = IOStream::TimeOutInfinite);
 	virtual bool StreamDataLeft();
 	virtual bool StreamClosed();
+	int64_t GetBytesToUpload() { return mBytesToUpload; }
 	int64_t GetTotalBytesSent() { return mTotalBytesSent; }
 
 private:




More information about the Boxbackup-commit mailing list