Skip to content

Commit

Permalink
Correcting spelling mistakes
Browse files Browse the repository at this point in the history
Summary: Correcting spelling mistakes

Reviewed By: @​ldemailly

Differential Revision: D2395896
  • Loading branch information
uddipta authored and ldemailly committed Aug 30, 2015
1 parent 1d7ffc0 commit ba71c65
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion ByteSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ByteSource {
*/
virtual char *read(int64_t &size) = 0;

/// Advances ByteSource offet by numBytes
/// Advances ByteSource offset by numBytes
virtual void advanceOffset(int64_t numBytes) = 0;

/// open the source for reading
Expand Down
2 changes: 1 addition & 1 deletion DirectorySourceQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ bool DirectorySourceQueue::explore() {
}
// http://elliotth.blogspot.com/2012/10/how-not-to-use-readdirr3.html
// tl;dr readdir is actually better than readdir_r ! (because of the
// nastyness of calculating correctly buffer size and race conditions there)
// nastiness of calculating correctly buffer size and race conditions there)
struct dirent *dirEntryRes = nullptr;
while (true) {
if (abortChecker_->shouldAbort()) {
Expand Down
6 changes: 3 additions & 3 deletions DirectorySourceQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class DirectorySourceQueue : public SourceQueue {
* slash is automatically added if missing. Can be relative.
* if follow symlink is set the directory will be resolved as absolute
* path.
* @return true if succesfull, false on error (logged)
* @return true if successful, false on error (logged)
*/
bool setRootDir(const std::string &newRootDir);

Expand Down Expand Up @@ -252,7 +252,7 @@ class DirectorySourceQueue : public SourceQueue {

/**
* when adding multiple files, we have the option of using notify_one multiple
* times or notify_all once. depending on number of added sources, this
* times or notify_all once. Depending on number of added sources, this
* function uses either notify_one or notify_all
*
* @param addedSource number of sources added
Expand Down Expand Up @@ -347,7 +347,7 @@ class DirectorySourceQueue : public SourceQueue {
/// Whether to follow symlinks or not
bool followSymlinks_{false};

/// shared file data. this are used during transfer to add blocks
/// shared file data. This are used during transfer to add blocks
/// contribution
std::vector<SourceMetaData *> sharedFileData_;

Expand Down
2 changes: 1 addition & 1 deletion FileByteSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ char *FileByteSource::read(int64_t &size) {
toRead =
((expectedRead + kDiskBlockSize - 1) / kDiskBlockSize) * kDiskBlockSize;
}
// actualRead is guranteed to be <= buffer_->size_
// actualRead is guaranteed to be <= buffer_->size_
WDT_CHECK(toRead <= buffer_->size_) << "Attempting to read " << toRead
<< " while buffer size is "
<< buffer_->size_;
Expand Down
4 changes: 2 additions & 2 deletions FileCreator.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class FileCreator {
* @param fd file descriptor
* @param fileSize size of the file
*
* @return true for suzzess, false otherwise
* @return true for success, false otherwise
*/
bool setFileSize(int fd, int64_t fileSize);

Expand Down Expand Up @@ -142,7 +142,7 @@ class FileCreator {
*
* @param dir dir to create recursively, should end with
* '/' and not start with '/'
* @parm force whether to force trying to create/skip
* @param force whether to force trying to create/skip
* checking the cache
*
* @return true iff successful
Expand Down
4 changes: 2 additions & 2 deletions FileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ ErrorCode FileWriter::write(char *buf, int64_t size) {
if (fsync(fd_) != 0) {
PLOG(ERROR) << "fsync failed for " << blockDetails_->fileName
<< " offset " << blockDetails_->offset << " file-size "
<< blockDetails_->fileSize
<< " data-size << blockDetails_->dataSize";
<< blockDetails_->fileSize << " data-size "
<< blockDetails_->dataSize;
return FILE_WRITE_ERROR;
}
RECORD_PERF_RESULT(PerfStatReport::FSYNC)
Expand Down
4 changes: 2 additions & 2 deletions ProtocolTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void testHeader() {
off, sizeof(buf), bd);
EXPECT_EQ(off,
bd.fileName.size() + 1 + 1 + 1 + 1 + 1 +
1); // 1 byte varint for seqId, len, size, offset and filesize
1); // 1 byte variant for seqId, len, size, offset and filesize
BlockDetails nbd;
int64_t noff = 0;
bool success =
Expand Down Expand Up @@ -77,7 +77,7 @@ void testHeader() {
off, sizeof(buf), bd);
EXPECT_EQ(off,
bd.fileName.size() + 1 + 1 + 6 + 1 + 2 + 1 +
1); // 1 byte varint for id len and size
1); // 1 byte variant for id len and size
noff = 0;
success =
Protocol::decodeHeader(Protocol::HEADER_FLAG_AND_PREV_SEQ_ID_VERSION, buf,
Expand Down
8 changes: 4 additions & 4 deletions Receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ void Receiver::startNewGlobalSession(ThreadData &data) {
auto &socket = data.socket_;
if (throttler_) {
// If throttler is configured/set then register this session
// in the throttler. This is guranteed to work in either of the
// in the throttler. This is guaranteed to work in either of the
// modes long running or not. We will de register from the throttler
// when the current session ends
throttler_->registerTransfer();
Expand Down Expand Up @@ -603,7 +603,7 @@ Receiver::ReceiverState Receiver::acceptFirstConnection(ThreadData &data) {
<< " connection. Num attempts " << acceptAttempts;
// Even though there is a transition FAILED here
// getCurAbortCode() is going to be checked again in the receiveOne.
// So this is pretty much irrelavant
// So this is pretty much irrelevant
return FAILED;
}

Expand Down Expand Up @@ -636,7 +636,7 @@ Receiver::ReceiverState Receiver::acceptWithTimeout(ThreadData &data) {

auto timeout = options.accept_window_millis;
if (senderReadTimeout > 0) {
// transfer is in progress and we have alreay got sender settings
// transfer is in progress and we have already got sender settings
timeout =
std::max(senderReadTimeout, senderWriteTimeout) + kTimeoutBufferMillis;
}
Expand Down Expand Up @@ -982,7 +982,7 @@ Receiver::ReceiverState Receiver::processFileCmd(ThreadData &data) {
// if we need to read more anyway, let's move the data
numRead = remainingData;
if ((remainingData < Protocol::kMaxHeader) && (off > (bufferSize / 2))) {
// rare so inneficient is ok
// rare so inefficient is ok
VLOG(3) << "copying extra " << remainingData << " leftover bytes @ "
<< off;
memmove(/* dst */ buf,
Expand Down
12 changes: 6 additions & 6 deletions Receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace wdt {
* accepts connections, receives the files and writes to the destination
* directory. Receiver has two modes of operation : You can spawn a receiver
* for one transfer or alternatively it can also be used in a long running
* mode where it accepts subsequent transfers and runs in an infinte loop.
* mode where it accepts subsequent transfers and runs in an infinite loop.
*/
class Receiver : public WdtBase {
public:
Expand Down Expand Up @@ -106,8 +106,8 @@ class Receiver : public WdtBase {

/**
* Wdt receiver has logic to maintain the consistency of the
* the transfers through connection errors. All threads are run by the logic
* defined as a state machine. These are the all the stataes in that
* transfers through connection errors. All threads are run by the logic
* defined as a state machine. These are the all the states in that
* state machine
*/
enum ReceiverState {
Expand Down Expand Up @@ -171,8 +171,8 @@ class Receiver : public WdtBase {
int checkpointIndex_{0};

/**
* Pending value of checkpoint count. since write call success does not
* gurantee actual transfer, we do not apply checkpoint count update after
* Pending value of checkpoint count. Since write call success does not
* guarantee actual transfer, we do not apply checkpoint count update after
* the write. Only after receiving next cmd from sender, we apply the
* update
*/
Expand Down Expand Up @@ -289,7 +289,7 @@ class Receiver : public WdtBase {
*/
ReceiverState sendLocalCheckpoint(ThreadData &data);
/**
* Reads next cmd and transistions to the state accordingly.
* Reads next cmd and transitions to the state accordingly.
* Previous states : SEND_LOCAL_CHECKPOINT,
* ACCEPT_FIRST_CONNECTION,
* ACCEPT_WITH_TIMEOUT,
Expand Down
4 changes: 2 additions & 2 deletions Reporting.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class PerfStatReport {
FILE_SEEK,
THROTTLER_SLEEP,
RECEIVER_WAIT_SLEEP, // receiver sleep duration between sending wait cmd to
// sender. A high sum for this suggestes threads
// sender. A high sum for this suggests threads
// were not properly load balanced
END
};
Expand All @@ -483,7 +483,7 @@ class PerfStatReport {

/**
* @param statType stat-type
* @param timeInMicros time taken by the operatin in microseconds
* @param timeInMicros time taken by the operation in microseconds
*/
void addPerfStat(StatType statType, int64_t timeInMicros);

Expand Down
14 changes: 7 additions & 7 deletions Sender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool ThreadTransferHistory::addSource(std::unique_ptr<ByteSource> &source) {
folly::SpinLockGuard guard(lock_);
if (globalCheckpoint_) {
// already received an error for this thread
VLOG(1) << "adding source after global checkpoint is received. returning "
VLOG(1) << "adding source after global checkpoint is received. Returning "
"the source to the queue";
markSourceAsFailed(source, lastBlockReceivedBytes_);
lastBlockReceivedBytes_ = 0;
Expand All @@ -65,7 +65,7 @@ int64_t ThreadTransferHistory::setCheckpointAndReturnToQueue(
const int64_t historySize = history_.size();
if (numReceivedSources > historySize) {
LOG(ERROR)
<< "checkpoint is greater than total number of sources transfereed "
<< "checkpoint is greater than total number of sources transfered "
<< history_.size() << " " << numReceivedSources;
return -1;
}
Expand Down Expand Up @@ -352,7 +352,7 @@ std::unique_ptr<TransferReport> Sender::finish() {
<< transferReport->getThroughputMBps() << " Mbytes/sec ("
<< transferReport->getSummary().getEffectiveTotalBytes() /
(totalTime - directoryTime) / kMbToB
<< " Mbytes/sec pure transf rate)";
<< " Mbytes/sec pure transfer rate)";
areThreadsJoined_ = true;
return transferReport;
}
Expand Down Expand Up @@ -390,8 +390,8 @@ ErrorCode Sender::start() {
configureThrottler();
}

// WARNING: Do not MERGE the follwing two loops. ThreadTransferHistory keeps a
// reference of TransferStats. And, any emplace operation on a vector
// WARNING: Do not MERGE the following two loops. ThreadTransferHistory keeps
// a reference of TransferStats. And, any emplace operation on a vector
// invalidates all its references
const int64_t numPorts = ports_.size();
for (int64_t i = 0; i < numPorts; i++) {
Expand Down Expand Up @@ -533,8 +533,8 @@ Sender::SenderState Sender::connect(ThreadData &data) {
threadStats.setErrorCode(code);
return END;
}
// clearing the totalSizeSent_ flag. This way if anything breaks, we resendthe
// total size.
// clearing the totalSizeSent_ flag. This way if anything breaks, we resend
// the total size.
data.totalSizeSent_ = false;
auto nextState =
threadStats.getErrorCode() == OK ? SEND_SETTINGS : READ_LOCAL_CHECKPOINT;
Expand Down
4 changes: 2 additions & 2 deletions Sender.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class Sender : public WdtBase {
*/
void setProgressReportIntervalMillis(const int progressReportIntervalMillis);

/// @retun minimal transfer report using transfer stats of the thread
/// @return minimal transfer report using transfer stats of the thread
std::unique_ptr<TransferReport> getTransferReport();

typedef std::unique_ptr<ClientSocket> (*SocketCreator)(
Expand Down Expand Up @@ -405,7 +405,7 @@ class Sender : public WdtBase {
* due to version mismatch. Also performs various sanity checks.
* Previous states : Almost all threads, abort flags is checked between every
* state transition
* Next states : CONNECT(Abort was due to version kismatch),
* Next states : CONNECT(Abort was due to version mismatch),
* END(if abort was not due to version mismatch or some sanity
* check failed)
*/
Expand Down
4 changes: 2 additions & 2 deletions Throttler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void Throttler::setThrottlerRates(double& avgRateBytesPerSec,
folly::SpinLockGuard lock(throttlerMutex_);
if (refCount_ > 0 && avgRateBytesPerSec < avgRateBytesPerSec_) {
LOG(INFO) << "new avg rate : " << avgRateBytesPerSec
<< " curr avg rate : " << avgRateBytesPerSec_
<< " cur avg rate : " << avgRateBytesPerSec_
<< " Average throttler rate can't be "
<< "lowered mid transfer. Ignoring the new value";
avgRateBytesPerSec = avgRateBytesPerSec_;
Expand Down Expand Up @@ -133,7 +133,7 @@ double Throttler::calculateSleep(double deltaProgress,
if (willSleep) {
return avgThrottlerSleep;
}
// we stilll hold the lock if peak throttler can come into effect
// we still hold the lock if peak throttler can come into effect
if ((bucketRateBytesPerSec_ > 0) && (bytesTokenBucketLimit_ > 0)) {
std::chrono::duration<double> elapsedDuration = now - lastFillTime_;
lastFillTime_ = now;
Expand Down
10 changes: 5 additions & 5 deletions Throttler.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace wdt {
* Attempts to limit the rate in two ways.
* 1. Limit average rate by calling averageThrottler()
* 2. Limit the peak rate by calling limitByTokenBucket
* Generally average throttler would be mainting the rate to avgRate_
* Generally average throttler would be maintaining the rate to avgRate_
* although at times the actual rate might fall behind and in those
* circumstances the rate at which you will catch up is limited
* with respect to the peak rate and the bucket limit using the
Expand Down Expand Up @@ -100,7 +100,7 @@ class Throttler {
/// Get the bucket rate in bytes per sec
double getPeakRateBytesPerSec();

/// Get the bucket limit in byttes
/// Get the bucket limit in bytes
double getBucketLimitBytes();

/// Get the throttler logging time period in millis
Expand All @@ -125,9 +125,9 @@ class Throttler {
/**
* This method periodically prints logs.
* The period is defined by FLAGS_peak_log_time_ms
* @params deltaProgress Progress since last call to limit()
* @params now The time point caller has
* @params sleepTimeSeconds Duration of sleep caused by limit()
* @param deltaProgress Progress since last call to limit()
* @param now The time point caller has
* @param sleepTimeSeconds Duration of sleep caused by limit()
*/
void printPeriodicLogs(const Clock::time_point& now, double deltaProgress);
/// Records the time the throttler was started
Expand Down
2 changes: 1 addition & 1 deletion TransferLogManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ bool TransferLogManager::openAndStartWriter(const std::string &curSenderIp) {
WDT_CHECK(fd_ == -1) << "Trying to open wdt log multiple times";

const auto &options = WdtOptions::get();
if (!options.disable_sender_verfication_during_resumption) {
if (!options.disable_sender_verification_during_resumption) {
if (!senderIp_.empty() && senderIp_ != curSenderIp) {
LOG(ERROR) << "Current sender ip does not match ip in the "
"transfer log "
Expand Down
10 changes: 5 additions & 5 deletions TransferLogManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class TransferLogManager {
*/
bool unlink();

/// @rootDir root directory of the receiver
/// @param rootDir root directory of the receiver
void setRootDir(const std::string &rootDir);

private:
Expand Down Expand Up @@ -162,7 +162,7 @@ class TransferLogManager {
void writeEntriesToDisk();

/**
* Enocodes invalidation entry
* Encodes invalidation entry
*
* @param dest buffer to encode into
* @param off offset in the buffer, this moved to end of the encoding
Expand Down Expand Up @@ -201,14 +201,14 @@ class TransferLogManager {
int64_t &seqId);

/**
* Parses the transfer log. Veifies if all the file exists or not(This is
* Parses the transfer log. Verifies if all the file exists or not(This is
* done to verify whether directory entries were synced to disk before or
* not). Also writes invalidation entries for files with verification failure.
*
* @param recoveryId recovery-id, this is verified against the logged
* recovey-id
* recovery-id
* @param parseOnly If true, all parsed entries are logged, and the
* log is not midified or verified
* log is not modified or verified
* @param parsedInfo vector to populate with parsed data, only
* populated if parseOnly is false
*
Expand Down
6 changes: 3 additions & 3 deletions WdtBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class WdtUri {
/// Prefix of the wdt url
const std::string WDT_URL_PREFIX{"wdt://"};

/// Hostname where the receiever is running
/// Hostname where the receiver is running
std::string hostName_{""};

/// Error code that reflects that status of parsing url
Expand Down Expand Up @@ -119,7 +119,7 @@ struct WdtTransferRequest {
/// Only required for the sender
std::vector<FileInfo> fileInfo;

/// Any error assosciated with this transfer request upon processing
/// Any error associated with this transfer request upon processing
ErrorCode errorCode{OK};

/// Constructor with list of ports
Expand Down Expand Up @@ -216,7 +216,7 @@ class WdtBase {
/// Basic setup for throttler using options
void configureThrottler();

/// Utility to generate a random transer id
/// Utility to generate a random transfer id
static std::string generateTransferId();

protected:
Expand Down
Loading

0 comments on commit ba71c65

Please sign in to comment.