diff --git a/lib/Backoff.cc b/lib/Backoff.cc index 4d954220..fdb13592 100644 --- a/lib/Backoff.cc +++ b/lib/Backoff.cc @@ -21,7 +21,6 @@ #include /* time */ #include -#include namespace pulsar { @@ -47,7 +46,7 @@ TimeDuration Backoff::next() { } } // Add Randomness - boost::random::uniform_int_distribution dist; + std::uniform_int_distribution dist; int randomNumber = dist(rng_); current = current - (current * (randomNumber % 10) / 100); diff --git a/lib/Backoff.h b/lib/Backoff.h index 4bcebc75..a59c00f5 100644 --- a/lib/Backoff.h +++ b/lib/Backoff.h @@ -21,7 +21,7 @@ #include #include -#include +#include namespace pulsar { @@ -39,7 +39,7 @@ class PULSAR_PUBLIC Backoff { TimeDuration next_; TimeDuration mandatoryStop_; boost::posix_time::ptime firstBackoffTime_; - boost::random::mt19937 rng_; + std::mt19937 rng_; bool mandatoryStopMade_ = false; friend class PulsarFriend; diff --git a/lib/RoundRobinMessageRouter.cc b/lib/RoundRobinMessageRouter.cc index e33f8d95..9693cc25 100644 --- a/lib/RoundRobinMessageRouter.cc +++ b/lib/RoundRobinMessageRouter.cc @@ -18,8 +18,7 @@ */ #include "RoundRobinMessageRouter.h" -#include -#include +#include #include "Hash.h" #include "TimeUtils.h" @@ -37,8 +36,8 @@ RoundRobinMessageRouter::RoundRobinMessageRouter(ProducerConfiguration::HashingS lastPartitionChange_(TimeUtils::currentTimeMillis()), msgCounter_(0), cumulativeBatchSize_(0) { - boost::random::mt19937 rng(time(nullptr)); - boost::random::uniform_int_distribution dist; + std::mt19937 rng(time(nullptr)); + std::uniform_int_distribution dist; currentPartitionCursor_ = dist(rng); } diff --git a/vcpkg.json b/vcpkg.json index 1f9ed97f..d023a406 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -36,10 +36,6 @@ "name": "boost-property-tree", "version>=": "1.83.0" }, - { - "name": "boost-random", - "version>=": "1.83.0" - }, { "name": "boost-serialization", "version>=": "1.83.0"