[
https://issues.apache.org/jira/browse/GEODE-3136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16247709#comment-16247709
]
ASF GitHub Bot commented on GEODE-3136:
---------------------------------------
pivotal-jbarrett commented on a change in pull request #144: GEODE-3136:
Convert time values to std::chrono::duration.
URL: https://github.com/apache/geode-native/pull/144#discussion_r150272880
##########
File path: cppcache/src/LocalRegion.cpp
##########
@@ -346,15 +348,16 @@ void LocalRegion::localPut(const CacheableKeyPtr& key,
GfErrTypeToException("Region::localPut", err);
}
-void LocalRegion::putAll(const HashMapOfCacheable& map, uint32_t timeout,
+void LocalRegion::putAll(const HashMapOfCacheable& map,
+ std::chrono::milliseconds timeout,
const SerializablePtr& aCallbackArgument) {
- if ((timeout * 1000) >= 0x7fffffff) {
- throw IllegalArgumentException(
- "Region::putAll: timeout parameter "
- "greater than maximum allowed (2^31/1000 i.e 2147483).");
- }
- int64_t sampleStartNanos = startStatOpTime();
- GfErrType err = putAllNoThrow(map, timeout, aCallbackArgument);
+ // if ((timeout * 1000) >= 0x7fffffff) {
Review comment:
@dgkimura I had really hoped that redefining the parameter as
`std::chrono::duration<int32_t, std::milli> timeout` would have solved it
compile time but strangely it doesn't. I was able to compile a call at passed
in64_t max seconds, which is WAY over the limit. I feel like this is compiler
bug but we will just have to check at runtime now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Replace all public API time values with std::chrono types
> ---------------------------------------------------------
>
> Key: GEODE-3136
> URL: https://issues.apache.org/jira/browse/GEODE-3136
> Project: Geode
> Issue Type: Improvement
> Components: native client
> Reporter: Jacob S. Barrett
> Assignee: Jacob S. Barrett
>
> Remove ambiguity of time values by using
> [{{std::chrono}}|http://en.cppreference.com/w/cpp/chrono] types in the public
> API.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)