Skip to content

Commit

Permalink
Missing flag
Browse files Browse the repository at this point in the history
Reviewed By: @ldemailly, @uddipta

Differential Revision: D1886993
  • Loading branch information
nikunjy authored and ldemailly committed Jul 17, 2015
1 parent 20f589f commit 449e901
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions DirectorySourceQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ void DirectorySourceQueue::createIntoQueue(const std::string &fullPath,
// b) if filesize > blocksize, we can use send filename only in the first
// block and use a shorter header for subsequent blocks. Also, we can remove
// block size once negotiated, since blocksize is sort of fixed.

bool enableBlockTransfer = options_.block_size > 0;
int64_t blockSizeBytes = options_.block_size_mbytes * 1024 * 1024;
bool enableBlockTransfer = blockSizeBytes > 0;
if (!enableBlockTransfer) {
VLOG(2) << "Block transfer disabled for this transfer";
}
// if block transfer is disabled, treating fileSize as block size. This
// ensures that we create a single block
auto blockSize = enableBlockTransfer ? options_.block_size : fileSize;
auto blockSize = enableBlockTransfer ? blockSizeBytes : fileSize;

FileMetaData *fileData = new FileMetaData(fullPath, relPath, fileSize);
sharedFileData_.emplace_back(fileData);
Expand Down
3 changes: 3 additions & 0 deletions WdtFlags.cpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ WDT_OPT(buffer_size, int32, "Buffer size (per thread/socket)");
WDT_OPT(max_retries, int32, "how many attempts to connect/listen");
WDT_OPT(max_transfer_retries, int32, "Max number of retries for a source");
WDT_OPT(sleep_millis, int32, "how many ms to wait between attempts");
WDT_OPT(block_size_mbytes, double,
"Size of the blocks that files will be divided in, specify negative "
"to disable the file splitting mode");
WDT_OPT(retry_interval_mult_factor, double,
"Factor to multiply with the retry interval for connnecting");
WDT_OPT(avg_mbytes_per_sec, double,
Expand Down
4 changes: 2 additions & 2 deletions WdtOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class WdtOptions {
std::string prune_dir_regex{""};

/**
* Maximu number of retries for transferring a file
* Maximum number of retries for transferring a file
*/
int max_transfer_retries{3};

Expand Down Expand Up @@ -152,7 +152,7 @@ class WdtOptions {
* block size, it is used to break bigger files into smaller chunks
* block_size of <= 0 disables block transfer
*/
int64_t block_size{16 * 1024 * 1024};
double block_size_mbytes{16};

/**
* Since this is a singelton copy constructor
Expand Down

0 comments on commit 449e901

Please sign in to comment.