aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortolich <tolich@yandex-team.ru>2022-02-10 16:48:42 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:42 +0300
commit9e8a8cd0f33ded91ed66671e388f3af06dd2249e (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8
parentc662862405cbda305d8b2ff7693adf2595e3edc2 (diff)
downloadydb-9e8a8cd0f33ded91ed66671e388f3af06dd2249e.tar.gz
Restoring authorship annotation for <tolich@yandex-team.ru>. Commit 2 of 2.
-rw-r--r--build/rules/go/vendor.policy10
-rw-r--r--contrib/python/ya.make2
-rw-r--r--library/cpp/retry/retry.h40
-rw-r--r--library/cpp/retry/utils.cpp22
-rw-r--r--library/cpp/retry/utils.h6
-rw-r--r--util/system/file.cpp10
6 files changed, 45 insertions, 45 deletions
diff --git a/build/rules/go/vendor.policy b/build/rules/go/vendor.policy
index 7eb322fc566..3e9c0acadaa 100644
--- a/build/rules/go/vendor.policy
+++ b/build/rules/go/vendor.policy
@@ -474,9 +474,9 @@ ALLOW .* -> vendor/github.com/vmihailenco/msgpack
# Generate fancy REST API from grpc api
ALLOW .* -> vendor/github.com/grpc-ecosystem/grpc-gateway
-# tus: the open protocol for resumable file uploads
-ALLOW .* -> vendor/github.com/tus/tusd
-
+# tus: the open protocol for resumable file uploads
+ALLOW .* -> vendor/github.com/tus/tusd
+
# Fast, fully fledged murmur3 in Go.
ALLOW .* -> vendor/github.com/twmb/murmur3
@@ -588,8 +588,8 @@ ALLOW .* -> vendor/github.com/pariz/gountries
ALLOW .* -> vendor/github.com/intel/govmm/qemu
# CONTRIB-1650 golang ftp server library with a sample implementation
-ALLOW .* -> vendor/github.com/fclairamb/ftpserver
-
+ALLOW .* -> vendor/github.com/fclairamb/ftpserver
+
# CONTRIB-1647 golang binlog replication implementation
ALLOW .* -> vendor/github.com/siddontang/go-mysql/replication
ALLOW .* -> vendor/github.com/siddontang/go-mysql/canal
diff --git a/contrib/python/ya.make b/contrib/python/ya.make
index 2d903de3fcb..d01ced9f3aa 100644
--- a/contrib/python/ya.make
+++ b/contrib/python/ya.make
@@ -404,7 +404,7 @@ RECURSE(
Flask-PyMongo
Flask-RESTful
flask-restplus
- flask-restx
+ flask-restx
Flask-Script
flask-shell-ipython
Flask-Shelve
diff --git a/library/cpp/retry/retry.h b/library/cpp/retry/retry.h
index d4f1648dec2..c47ff5070fe 100644
--- a/library/cpp/retry/retry.h
+++ b/library/cpp/retry/retry.h
@@ -12,23 +12,23 @@
struct TRetryOptions {
ui32 RetryCount;
-
- // TotalDuration = SleepDuration +/- SleepRandomDelta + (attempt * SleepIncrement) + (2**attempt * SleepExponentialMultiplier)
+
+ // TotalDuration = SleepDuration +/- SleepRandomDelta + (attempt * SleepIncrement) + (2**attempt * SleepExponentialMultiplier)
TDuration SleepDuration;
- TDuration SleepRandomDelta;
- TDuration SleepIncrement;
- TDuration SleepExponentialMultiplier;
+ TDuration SleepRandomDelta;
+ TDuration SleepIncrement;
+ TDuration SleepExponentialMultiplier;
std::function<void(TDuration)> SleepFunction;
- TRetryOptions(ui32 retryCount = 3, TDuration sleepDuration = TDuration::Seconds(1), TDuration sleepRandomDelta = TDuration::Zero(),
+ TRetryOptions(ui32 retryCount = 3, TDuration sleepDuration = TDuration::Seconds(1), TDuration sleepRandomDelta = TDuration::Zero(),
TDuration sleepIncrement = TDuration::Zero(), TDuration sleepExponentialMultiplier = TDuration::Zero(),
std::function<void(TDuration)> sleepFunction = [](TDuration d) { Sleep(d); }) // can't use Sleep itself due to Win compilation error
: RetryCount(retryCount)
, SleepDuration(sleepDuration)
, SleepRandomDelta(sleepRandomDelta)
- , SleepIncrement(sleepIncrement)
- , SleepExponentialMultiplier(sleepExponentialMultiplier)
+ , SleepIncrement(sleepIncrement)
+ , SleepExponentialMultiplier(sleepExponentialMultiplier)
, SleepFunction(sleepFunction)
{
}
@@ -48,26 +48,26 @@ struct TRetryOptions {
return *this;
}
- TRetryOptions& WithIncrement(TDuration sleepIncrement) {
- SleepIncrement = sleepIncrement;
- return *this;
+ TRetryOptions& WithIncrement(TDuration sleepIncrement) {
+ SleepIncrement = sleepIncrement;
+ return *this;
+ }
+
+ TRetryOptions& WithExponentialMultiplier(TDuration sleepExponentialMultiplier) {
+ SleepExponentialMultiplier = sleepExponentialMultiplier;
+ return *this;
}
- TRetryOptions& WithExponentialMultiplier(TDuration sleepExponentialMultiplier) {
- SleepExponentialMultiplier = sleepExponentialMultiplier;
- return *this;
- }
-
TRetryOptions& WithSleepFunction(std::function<void(TDuration)> sleepFunction) {
SleepFunction = sleepFunction;
return *this;
}
- // for compatibility attempt == 0 by default
- TDuration GetTimeToSleep(ui32 attempt = 0) const {
+ // for compatibility attempt == 0 by default
+ TDuration GetTimeToSleep(ui32 attempt = 0) const {
return SleepDuration + NRetryPrivate::AddRandomDelta(SleepRandomDelta) + NRetryPrivate::AddIncrement(attempt, SleepIncrement) + NRetryPrivate::AddExponentialMultiplier(attempt, SleepExponentialMultiplier);
- }
-
+ }
+
static TRetryOptions Count(ui32 retryCount) {
return TRetryOptions(retryCount);
}
diff --git a/library/cpp/retry/utils.cpp b/library/cpp/retry/utils.cpp
index e425e282afc..24d943f5185 100644
--- a/library/cpp/retry/utils.cpp
+++ b/library/cpp/retry/utils.cpp
@@ -2,19 +2,19 @@
#include <util/random/random.h>
-TDuration NRetryPrivate::AddRandomDelta(TDuration maxDelta) {
+TDuration NRetryPrivate::AddRandomDelta(TDuration maxDelta) {
if (maxDelta == TDuration::Zero()) {
- return TDuration::Zero();
+ return TDuration::Zero();
}
const TDuration delta = TDuration::MicroSeconds(RandomNumber(2 * maxDelta.MicroSeconds()));
- return delta - maxDelta;
+ return delta - maxDelta;
+}
+
+TDuration NRetryPrivate::AddIncrement(ui32 attempt, TDuration increment) {
+ return TDuration::MicroSeconds(attempt * increment.MicroSeconds());
+}
+
+TDuration NRetryPrivate::AddExponentialMultiplier(ui32 attempt, TDuration exponentialMultiplier) {
+ return TDuration::MicroSeconds((1ull << Min(63u, attempt)) * exponentialMultiplier.MicroSeconds());
}
-
-TDuration NRetryPrivate::AddIncrement(ui32 attempt, TDuration increment) {
- return TDuration::MicroSeconds(attempt * increment.MicroSeconds());
-}
-
-TDuration NRetryPrivate::AddExponentialMultiplier(ui32 attempt, TDuration exponentialMultiplier) {
- return TDuration::MicroSeconds((1ull << Min(63u, attempt)) * exponentialMultiplier.MicroSeconds());
-}
diff --git a/library/cpp/retry/utils.h b/library/cpp/retry/utils.h
index 7d67fd6de09..a8fd3d1a898 100644
--- a/library/cpp/retry/utils.h
+++ b/library/cpp/retry/utils.h
@@ -3,8 +3,8 @@
#include <util/datetime/base.h>
namespace NRetryPrivate {
- TDuration AddRandomDelta(TDuration delta);
- TDuration AddIncrement(ui32 attempt, TDuration increment);
- TDuration AddExponentialMultiplier(ui32 attempt, TDuration exponentialMultiplier);
+ TDuration AddRandomDelta(TDuration delta);
+ TDuration AddIncrement(ui32 attempt, TDuration increment);
+ TDuration AddExponentialMultiplier(ui32 attempt, TDuration exponentialMultiplier);
}
diff --git a/util/system/file.cpp b/util/system/file.cpp
index b5b15b507d5..4a261d020cb 100644
--- a/util/system/file.cpp
+++ b/util/system/file.cpp
@@ -53,11 +53,11 @@
#include <sys/param.h>
#define HAVE_POSIX_FADVISE (__FreeBSD_version >= 900501)
#define HAVE_SYNC_FILE_RANGE 0
-#else
+#else
#define HAVE_POSIX_FADVISE 0
#define HAVE_SYNC_FILE_RANGE 0
-#endif
-
+#endif
+
static bool IsStupidFlagCombination(EOpenMode oMode) {
// ForAppend will actually not be applied in the following combinations:
return (oMode & (CreateAlways | ForAppend)) == (CreateAlways | ForAppend) || (oMode & (TruncExisting | ForAppend)) == (TruncExisting | ForAppend) || (oMode & (CreateNew | ForAppend)) == (CreateNew | ForAppend);
@@ -246,11 +246,11 @@ TFileHandle::TFileHandle(const TString& fName, EOpenMode oMode) noexcept {
if (Fd_ >= 0) {
if (oMode & NoReuse) {
::posix_fadvise(Fd_, 0, 0, POSIX_FADV_NOREUSE);
- }
+ }
if (oMode & Seq) {
::posix_fadvise(Fd_, 0, 0, POSIX_FADV_SEQUENTIAL);
- }
+ }
if (oMode & NoReadAhead) {
::posix_fadvise(Fd_, 0, 0, POSIX_FADV_RANDOM);