Skip to content

Commit 665e694

Browse files
MBkktmbasmanova
authored andcommitted
use has_value instead of hasValue
1 parent b299e9f commit 665e694

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

presto-native-execution/presto_cpp/main/QueryContextManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void updateFromSystemConfigs(
7070
const auto& systemConfigName = configNameEntry.second;
7171
if (queryConfigs.count(veloxConfigName) == 0) {
7272
const auto propertyOpt = systemConfig->optionalProperty(systemConfigName);
73-
if (propertyOpt.hasValue()) {
73+
if (propertyOpt.has_value()) {
7474
queryConfigs[veloxConfigName] = propertyOpt.value();
7575
}
7676
}

presto-native-execution/presto_cpp/main/common/Configs.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ folly::Optional<std::string> ConfigBase::setValue(
110110
propertyName);
111111
auto oldValue = config_->get<std::string>(propertyName);
112112
config_->set(propertyName, value);
113-
if (oldValue.hasValue()) {
113+
if (oldValue.has_value()) {
114114
return oldValue;
115115
}
116116
return registeredProps_[propertyName];
@@ -372,7 +372,7 @@ SystemConfig::remoteFunctionServerLocation() const {
372372
// First check if there is a UDS path registered. If there's one, use it.
373373
auto remoteServerUdsPath =
374374
optionalProperty(kRemoteFunctionServerThriftUdsPath);
375-
if (remoteServerUdsPath.hasValue()) {
375+
if (remoteServerUdsPath.has_value()) {
376376
return folly::SocketAddress::makeFromPath(remoteServerUdsPath.value());
377377
}
378378

@@ -382,13 +382,13 @@ SystemConfig::remoteFunctionServerLocation() const {
382382
auto remoteServerPort =
383383
optionalProperty<uint16_t>(kRemoteFunctionServerThriftPort);
384384

385-
if (remoteServerPort.hasValue()) {
385+
if (remoteServerPort.has_value()) {
386386
// Fallback to localhost if address is not specified.
387-
return remoteServerAddress.hasValue()
387+
return remoteServerAddress.has_value()
388388
? folly::
389389
SocketAddress{remoteServerAddress.value(), remoteServerPort.value()}
390390
: folly::SocketAddress{"::1", remoteServerPort.value()};
391-
} else if (remoteServerAddress.hasValue()) {
391+
} else if (remoteServerAddress.has_value()) {
392392
VELOX_FAIL(
393393
"Remote function server port not provided using '{}'.",
394394
kRemoteFunctionServerThriftPort);
@@ -959,15 +959,15 @@ int NodeConfig::prometheusExecutorThreads() const {
959959
static constexpr int
960960
kNodePrometheusExecutorThreadsDefault = 2;
961961
auto resultOpt = optionalProperty<int>(kNodePrometheusExecutorThreads);
962-
if (resultOpt.hasValue()) {
962+
if (resultOpt.has_value()) {
963963
return resultOpt.value();
964964
}
965965
return kNodePrometheusExecutorThreadsDefault;
966966
}
967967

968968
std::string NodeConfig::nodeId() const {
969969
auto resultOpt = optionalProperty(kNodeId);
970-
if (resultOpt.hasValue()) {
970+
if (resultOpt.has_value()) {
971971
return resultOpt.value();
972972
}
973973
// Generate the nodeId which must be a UUID. nodeId must be a singleton.
@@ -985,7 +985,7 @@ std::string NodeConfig::nodeInternalAddress(
985985
auto resultOpt = optionalProperty(kNodeInternalAddress);
986986
/// node.ip(kNodeIp) is legacy config replaced with node.internal-address, but
987987
/// still valid config in Presto, so handling both.
988-
if (!resultOpt.hasValue()) {
988+
if (!resultOpt.has_value()) {
989989
resultOpt = optionalProperty(kNodeIp);
990990
}
991991
if (resultOpt.has_value()) {

presto-native-execution/presto_cpp/main/common/Configs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class ConfigBase {
9595
template <typename T>
9696
folly::Optional<T> optionalProperty(const std::string& propertyName) const {
9797
auto valOpt = config_->get<T>(propertyName);
98-
if (valOpt.hasValue()) {
98+
if (valOpt.has_value()) {
9999
return valOpt.value();
100100
}
101101
const auto it = registeredProps_.find(propertyName);

0 commit comments

Comments
 (0)