diff options
author | anskor <anskor@yandex-team.ru> | 2022-02-10 16:50:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:18 +0300 |
commit | dbfc9d8546687ce31ffd112c6c2d2f14be1bb4f0 (patch) | |
tree | 51436f0d49801f6430e492b4c472a80f98760a34 /library/cpp | |
parent | a1b790e06e8e99cffd5157a991259f9d0f993f66 (diff) | |
download | ydb-dbfc9d8546687ce31ffd112c6c2d2f14be1bb4f0.tar.gz |
Restoring authorship annotation for <anskor@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp')
-rw-r--r-- | library/cpp/mime/types/mime.cpp | 12 | ||||
-rw-r--r-- | library/cpp/mime/types/mime.h | 6 | ||||
-rw-r--r-- | library/cpp/retry/protos/retry_options.proto | 18 | ||||
-rw-r--r-- | library/cpp/retry/protos/ya.make | 28 | ||||
-rw-r--r-- | library/cpp/retry/retry.cpp | 16 | ||||
-rw-r--r-- | library/cpp/retry/retry.h | 6 | ||||
-rw-r--r-- | library/cpp/retry/retry_ut.cpp | 30 | ||||
-rw-r--r-- | library/cpp/retry/ya.make | 6 |
8 files changed, 61 insertions, 61 deletions
diff --git a/library/cpp/mime/types/mime.cpp b/library/cpp/mime/types/mime.cpp index 706d776b24..d6d3334bd3 100644 --- a/library/cpp/mime/types/mime.cpp +++ b/library/cpp/mime/types/mime.cpp @@ -91,9 +91,9 @@ const TMimeTypes::TRecord TMimeTypes::Records[] = { {MIME_DJVU, "image/vnd.djvu\0image/x-djvu\0", "djvu\0djv\0"}, {MIME_CHM, "application/x-chm\0application/vnd.ms-htmlhelp\0", "chm\0"}, {MIME_FB2ZIP, "application/zip\0", "fb2zip\0"}, - {MIME_IMAGE_TIFF, "image/tiff\0image/tiff-fx\0", "tif\0tiff\0"}, - {MIME_IMAGE_PNM, "image/x-portable-anymap\0", "pnm\0pgm\0ppm\0pbm\0"}, - {MIME_IMAGE_SVG, "image/svg+xml\0", "svg\0"}, + {MIME_IMAGE_TIFF, "image/tiff\0image/tiff-fx\0", "tif\0tiff\0"}, + {MIME_IMAGE_PNM, "image/x-portable-anymap\0", "pnm\0pgm\0ppm\0pbm\0"}, + {MIME_IMAGE_SVG, "image/svg+xml\0", "svg\0"}, {MIME_IMAGE_ICON, "image/x-icon\0image/vnd.microsoft.icon\0", "ico\0"}, {MIME_WOFF, "font/woff\0", "woff\0"}, {MIME_WOFF2, "font/woff2\0", "woff2\0"}, @@ -242,9 +242,9 @@ const char* MimeNames[MIME_MAX] = { "djvu", // MIME_DJVU // 36 "chm", // MIME_CHM // 37 "fb2zip", // MIME_FB2ZIP // 38 - "tiff", // MIME_IMAGE_TIFF // 39 - "pnm", // MIME_IMAGE_PNM // 40 - "svg", // MIME_IMAGE_SVG // 41 + "tiff", // MIME_IMAGE_TIFF // 39 + "pnm", // MIME_IMAGE_PNM // 40 + "svg", // MIME_IMAGE_SVG // 41 "ico", // MIME_IMAGE_ICON // 42 "woff", // MIME_WOFF // 43 "woff2", // MIME_WOFF2 // 44 diff --git a/library/cpp/mime/types/mime.h b/library/cpp/mime/types/mime.h index 05da389ea9..71c87c4e3d 100644 --- a/library/cpp/mime/types/mime.h +++ b/library/cpp/mime/types/mime.h @@ -50,9 +50,9 @@ enum MimeTypes { MIME_DJVU = 36, MIME_CHM = 37, MIME_FB2ZIP = 38, - MIME_IMAGE_TIFF = 39, - MIME_IMAGE_PNM = 40, - MIME_IMAGE_SVG = 41, + MIME_IMAGE_TIFF = 39, + MIME_IMAGE_PNM = 40, + MIME_IMAGE_SVG = 41, MIME_IMAGE_ICON = 42, MIME_WOFF = 43, MIME_WOFF2 = 44, diff --git a/library/cpp/retry/protos/retry_options.proto b/library/cpp/retry/protos/retry_options.proto index 063fff0141..1edf34df2e 100644 --- a/library/cpp/retry/protos/retry_options.proto +++ b/library/cpp/retry/protos/retry_options.proto @@ -1,9 +1,9 @@ -package NRetry; - -message TRetryOptionsPB { - optional uint32 MaxTries = 1 [default = 5]; - optional uint32 InitialSleepMs = 2 [default = 0]; - optional uint32 SleepIncrementMs = 3 [default = 0]; - optional uint32 RandomDeltaMs = 4 [default = 10]; - optional uint32 ExponentalMultiplierMs = 5 [default = 100]; -} +package NRetry; + +message TRetryOptionsPB { + optional uint32 MaxTries = 1 [default = 5]; + optional uint32 InitialSleepMs = 2 [default = 0]; + optional uint32 SleepIncrementMs = 3 [default = 0]; + optional uint32 RandomDeltaMs = 4 [default = 10]; + optional uint32 ExponentalMultiplierMs = 5 [default = 100]; +} diff --git a/library/cpp/retry/protos/ya.make b/library/cpp/retry/protos/ya.make index ad8ea2086a..6a8f99ac67 100644 --- a/library/cpp/retry/protos/ya.make +++ b/library/cpp/retry/protos/ya.make @@ -1,16 +1,16 @@ -PROTO_LIBRARY() - -OWNER( - anskor -) - -SRCS( - retry_options.proto -) - -PEERDIR() - +PROTO_LIBRARY() + +OWNER( + anskor +) + +SRCS( + retry_options.proto +) + +PEERDIR() + EXCLUDE_TAGS(GO_PROTO) -END() - +END() + diff --git a/library/cpp/retry/retry.cpp b/library/cpp/retry/retry.cpp index 92466cdeca..dee8b15730 100644 --- a/library/cpp/retry/retry.cpp +++ b/library/cpp/retry/retry.cpp @@ -16,11 +16,11 @@ bool DoWithRetryOnRetCode(std::function<bool()> func, TRetryOptions retryOptions } return false; } - -TRetryOptions MakeRetryOptions(const NRetry::TRetryOptionsPB& retryOptions) { - return TRetryOptions(retryOptions.GetMaxTries(), - TDuration::MilliSeconds(retryOptions.GetInitialSleepMs()), - TDuration::MilliSeconds(retryOptions.GetRandomDeltaMs()), - TDuration::MilliSeconds(retryOptions.GetSleepIncrementMs()), - TDuration::MilliSeconds(retryOptions.GetExponentalMultiplierMs())); -} + +TRetryOptions MakeRetryOptions(const NRetry::TRetryOptionsPB& retryOptions) { + return TRetryOptions(retryOptions.GetMaxTries(), + TDuration::MilliSeconds(retryOptions.GetInitialSleepMs()), + TDuration::MilliSeconds(retryOptions.GetRandomDeltaMs()), + TDuration::MilliSeconds(retryOptions.GetSleepIncrementMs()), + TDuration::MilliSeconds(retryOptions.GetExponentalMultiplierMs())); +} diff --git a/library/cpp/retry/retry.h b/library/cpp/retry/retry.h index c47ff5070f..fd87dcbf88 100644 --- a/library/cpp/retry/retry.h +++ b/library/cpp/retry/retry.h @@ -3,7 +3,7 @@ #include "utils.h" #include <library/cpp/retry/protos/retry_options.pb.h> - + #include <util/datetime/base.h> #include <util/generic/maybe.h> #include <util/generic/typetraits.h> @@ -129,5 +129,5 @@ void DoWithRetry(std::function<void()> func, TRetryOptions retryOptions); bool DoWithRetryOnRetCode(std::function<bool()> func, TRetryOptions retryOptions); Y_DECLARE_PODTYPE(TRetryOptions); - -TRetryOptions MakeRetryOptions(const NRetry::TRetryOptionsPB& retryOptions); + +TRetryOptions MakeRetryOptions(const NRetry::TRetryOptionsPB& retryOptions); diff --git a/library/cpp/retry/retry_ut.cpp b/library/cpp/retry/retry_ut.cpp index 92153e987e..4144746af9 100644 --- a/library/cpp/retry/retry_ut.cpp +++ b/library/cpp/retry/retry_ut.cpp @@ -99,19 +99,19 @@ Y_UNIT_TEST_SUITE(Retry) { Y_UNIT_TEST(RetryOnRetCodeFail) { UNIT_ASSERT(false == DoWithRetryOnRetCode(TDoOnSecondOrFail{}, TRetryOptions(0, TDuration::Zero()))); } - Y_UNIT_TEST(MakeRetryOptionsFromProto) { - NRetry::TRetryOptionsPB protoOptions; - protoOptions.SetMaxTries(1); - protoOptions.SetInitialSleepMs(2); - protoOptions.SetSleepIncrementMs(3); - protoOptions.SetRandomDeltaMs(4); - protoOptions.SetExponentalMultiplierMs(5); - - const TRetryOptions options = MakeRetryOptions(protoOptions); - UNIT_ASSERT_EQUAL(options.RetryCount, 1); - UNIT_ASSERT_EQUAL(options.SleepDuration, TDuration::MilliSeconds(2)); - UNIT_ASSERT_EQUAL(options.SleepIncrement, TDuration::MilliSeconds(3)); - UNIT_ASSERT_EQUAL(options.SleepRandomDelta, TDuration::MilliSeconds(4)); - UNIT_ASSERT_EQUAL(options.SleepExponentialMultiplier, TDuration::MilliSeconds(5)); - } + Y_UNIT_TEST(MakeRetryOptionsFromProto) { + NRetry::TRetryOptionsPB protoOptions; + protoOptions.SetMaxTries(1); + protoOptions.SetInitialSleepMs(2); + protoOptions.SetSleepIncrementMs(3); + protoOptions.SetRandomDeltaMs(4); + protoOptions.SetExponentalMultiplierMs(5); + + const TRetryOptions options = MakeRetryOptions(protoOptions); + UNIT_ASSERT_EQUAL(options.RetryCount, 1); + UNIT_ASSERT_EQUAL(options.SleepDuration, TDuration::MilliSeconds(2)); + UNIT_ASSERT_EQUAL(options.SleepIncrement, TDuration::MilliSeconds(3)); + UNIT_ASSERT_EQUAL(options.SleepRandomDelta, TDuration::MilliSeconds(4)); + UNIT_ASSERT_EQUAL(options.SleepExponentialMultiplier, TDuration::MilliSeconds(5)); + } } diff --git a/library/cpp/retry/ya.make b/library/cpp/retry/ya.make index 31e0c6a259..bded887703 100644 --- a/library/cpp/retry/ya.make +++ b/library/cpp/retry/ya.make @@ -10,8 +10,8 @@ SRCS( utils.cpp ) -PEERDIR( +PEERDIR( library/cpp/retry/protos -) - +) + END() |