geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-3136) Replace all public API time values with std::chrono types
Date Tue, 07 Nov 2017 17:22:01 GMT

    [ https://issues.apache.org/jira/browse/GEODE-3136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16242451#comment-16242451
] 

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_r149443032
 
 

 ##########
 File path: cppcache/src/TcrConnection.cpp
 ##########
 @@ -672,65 +643,33 @@ inline ConnErrType TcrConnection::receiveData(char* buffer, int32_t
length,
                       : (length == startLen ? CONN_NODATA : CONN_TIMEOUT));
 }
 
-inline ConnErrType TcrConnection::sendData(const char* buffer, int32_t length,
-                                           uint32_t sendTimeoutSec,
-                                           bool checkConnected) {
-  uint32_t dummy = 0;
-  return sendData(dummy, buffer, length, sendTimeoutSec, checkConnected);
+inline ConnErrType TcrConnection::sendData(
+    const char* buffer, int32_t length, std::chrono::microseconds sendTimeout,
+    bool checkConnected) {
+  std::chrono::microseconds dummy{0};
+  return sendData(dummy, buffer, length, sendTimeout, checkConnected);
 }
 
-inline ConnErrType TcrConnection::sendData(uint32_t& timeSpent,
-                                           const char* buffer, int32_t length,
-                                           uint32_t sendTimeoutSec,
-                                           bool checkConnected,
-                                           int32_t notPublicApiWithTimeout) {
+inline ConnErrType TcrConnection::sendData(
+    std::chrono::microseconds& timeSpent, const char* buffer, int32_t length,
+    std::chrono::microseconds sendTimeout, bool checkConnected) {
   GF_DEV_ASSERT(buffer != nullptr);
   GF_DEV_ASSERT(m_conn != nullptr);
-  bool isPublicApiTimeout = false;
-  // if gfcpp property unit set then sendTimeoutSec will be in millisecond
-  // otherwise it will be in second
-  if (m_poolDM->getConnectionManager()
-          .getCacheImpl()
-          ->getDistributedSystem()
-          .getSystemProperties()
-          .readTimeoutUnitInMillis()) {
-    LOGFINER("sendData %d  %d", sendTimeoutSec, notPublicApiWithTimeout);
-    if (notPublicApiWithTimeout == TcrMessage::QUERY ||
 
 Review comment:
   Correct. All this code was figuring out if that “treat time as milliseconds” flag as
set and if message was of any of these types then treat a milliseconds otherwise seconds.
All goes away with strongly typed time units.

----------------------------------------------------------------
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:
users@infra.apache.org


> 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)

Mime
View raw message