[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16253823#comment-16253823 ] ASF subversion and git services commented on GEODE-3392: Commit 8aa2c413c05e360ae0e97601ef05762359d7ea8a in geode-native's branch refs/heads/develop from Jacob Barrett [ https://gitbox.apache.org/repos/asf?p=geode-native.git;h=8aa2c41 ] GEODE-3392: Converts CacheStatistics to std::chrono. (#150) - Convert .NET CacheStatistics to DateTime. > Migrate CacheStatistics to use std::chrono > -- > > Key: GEODE-3392 > URL: https://issues.apache.org/jira/browse/GEODE-3392 > Project: Geode > Issue Type: Improvement > Components: native client >Reporter: Ernest Burghardt > > virtual std::chrono::time_point getLastModifiedTime() const; > /** >* For an entry, returns the last time it was accessed via >* @see Region::get >* @see getLastModifiedTime >*/ > virtual std::chrono::time_point getLastAccessedTime() const; > private: > virtual void setLastAccessedTime(std::chrono::time_point lat); > virtual void setLastModifiedTime(std::chrono::time_point lmt); > std::atomic m_lastAccessTime; > std::atomic m_lastModifiedTime; -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16253822#comment-16253822 ] ASF GitHub Bot commented on GEODE-3392: --- pivotal-jbarrett closed pull request #150: GEODE-3392: Converts CacheStatistics to std::chrono. URL: https://github.com/apache/geode-native/pull/150 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/clicache/src/AttributesFactory.cpp b/clicache/src/AttributesFactory.cpp index 1627150f..98c4efc5 100644 --- a/clicache/src/AttributesFactory.cpp +++ b/clicache/src/AttributesFactory.cpp @@ -36,7 +36,7 @@ #include "IFixedPartitionResolver.hpp" #include "impl/SafeConvert.hpp" #include "ExceptionTypes.hpp" -#include "TimeSpanUtils.hpp" +#include "TimeUtils.hpp" #include "begin_native.hpp" #include @@ -227,7 +227,7 @@ namespace Apache { try { - m_nativeptr->get()->setEntryIdleTimeout(static_cast( action ), TimeSpanUtils::TimeSpanToDurationCeil(idleTimeout) ); + m_nativeptr->get()->setEntryIdleTimeout(static_cast( action ), TimeUtils::TimeSpanToDurationCeil(idleTimeout) ); } finally { @@ -240,7 +240,7 @@ namespace Apache { try { - m_nativeptr->get()->setEntryTimeToLive( static_cast( action ), TimeSpanUtils::TimeSpanToDurationCeil(timeToLive) ); + m_nativeptr->get()->setEntryTimeToLive( static_cast( action ), TimeUtils::TimeSpanToDurationCeil(timeToLive) ); } finally { @@ -253,7 +253,7 @@ namespace Apache { try { - m_nativeptr->get()->setRegionIdleTimeout( static_cast( action ), TimeSpanUtils::TimeSpanToDurationCeil(idleTimeout) ); + m_nativeptr->get()->setRegionIdleTimeout( static_cast( action ), TimeUtils::TimeSpanToDurationCeil(idleTimeout) ); } finally { @@ -266,7 +266,7 @@ namespace Apache { try { - m_nativeptr->get()->setRegionTimeToLive( static_cast( action ), TimeSpanUtils::TimeSpanToDurationCeil(timeToLive) ); + m_nativeptr->get()->setRegionTimeToLive( static_cast( action ), TimeUtils::TimeSpanToDurationCeil(timeToLive) ); } finally { diff --git a/clicache/src/AttributesMutator.cpp b/clicache/src/AttributesMutator.cpp index aa106ca1..9bf74380 100644 --- a/clicache/src/AttributesMutator.cpp +++ b/clicache/src/AttributesMutator.cpp @@ -23,7 +23,7 @@ #include "impl/CacheLoader.hpp" #include "impl/CacheWriter.hpp" #include "impl/CacheListener.hpp" -#include "TimeSpanUtils.hpp" +#include "TimeUtils.hpp" namespace Apache { @@ -40,7 +40,7 @@ namespace Apache { try { - return TimeSpanUtils::DurationToTimeSpan(m_nativeptr->get()->setEntryIdleTimeout( TimeSpanUtils::TimeSpanToDurationCeil(idleTimeout) )); + return TimeUtils::DurationToTimeSpan(m_nativeptr->get()->setEntryIdleTimeout( TimeUtils::TimeSpanToDurationCeil(idleTimeout) )); } finally { @@ -69,7 +69,7 @@ namespace Apache { try { - return TimeSpanUtils::DurationToTimeSpan(m_nativeptr->get()->setEntryTimeToLive( TimeSpanUtils::TimeSpanToDurationCeil(timeToLive) )); + return TimeUtils::DurationToTimeSpan(m_nativeptr->get()->setEntryTimeToLive( TimeUtils::TimeSpanToDurationCeil(timeToLive) )); } finally { @@ -98,7 +98,7 @@ namespace Apache { try { - return TimeSpanUtils::DurationToTimeSpan(m_nativeptr->get()->setRegionIdleTimeout( TimeSpanUtils::TimeSpanToDurationCeil(idleTimeout) )); + return TimeUtils::DurationToTimeSpan(m_nativeptr->get()->setRegionIdleTimeout( TimeUtils::TimeSpanToDurationCeil(idleTimeout) )); } finally { @@ -127,7 +127,7 @@ namespace Apache { try { - return TimeSpanUtils::DurationToTimeSpan(m_nativeptr->get()->setRegionTimeToLive( TimeSpanUtils::TimeSpanToDurationCeil(timeToLive) )); + return TimeUtils::DurationToTimeSpan(m_nativeptr->get()->setRegionTimeToLive( TimeUtils::TimeSpanToDurationCeil(timeToLive) )); } finally { diff --git a/clicache/src/CacheStatistics.cpp b/clicache/src/CacheStatistics.cpp index 42592460..c053a3dc 100644 --- a/clicache/src/CacheStatistics.cpp +++ b/clicache/src/CacheStatistics.cpp @@ -16,7 +16,7 @@ */ #include "CacheStatistics.hpp" - +#include "TimeUtils.hpp" namespace Apache { @@ -27,11 +27,11 @@ namespace Apache using namespace System; - System::UInt32 CacheStatistics::LastModifiedTime::get( ) +
[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16253731#comment-16253731 ] ASF GitHub Bot commented on GEODE-3392: --- pivotal-jbarrett commented on issue #150: GEODE-3392: Converts CacheStatistics to std::chrono. URL: https://github.com/apache/geode-native/pull/150#issuecomment-344646193 @dgkimura Please have another look. 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: us...@infra.apache.org > Migrate CacheStatistics to use std::chrono > -- > > Key: GEODE-3392 > URL: https://issues.apache.org/jira/browse/GEODE-3392 > Project: Geode > Issue Type: Improvement > Components: native client >Reporter: Ernest Burghardt > > virtual std::chrono::time_point getLastModifiedTime() const; > /** >* For an entry, returns the last time it was accessed via >* @see Region::get >* @see getLastModifiedTime >*/ > virtual std::chrono::time_point getLastAccessedTime() const; > private: > virtual void setLastAccessedTime(std::chrono::time_point lat); > virtual void setLastModifiedTime(std::chrono::time_point lmt); > std::atomic m_lastAccessTime; > std::atomic m_lastModifiedTime; -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16253627#comment-16253627 ] ASF GitHub Bot commented on GEODE-3392: --- pivotal-jbarrett commented on a change in pull request #150: GEODE-3392: Converts CacheStatistics to std::chrono. URL: https://github.com/apache/geode-native/pull/150#discussion_r151159426 ## File path: cppcache/src/ExpiryTaskManager.cpp ## @@ -61,20 +61,6 @@ long ExpiryTaskManager::scheduleExpiryTask(ACE_Event_Handler* handler, return m_reactor->schedule_timer(handler, 0, expTimeValue, intervalValue); } -long ExpiryTaskManager::scheduleExpiryTask( Review comment: Still some internal usage. Focusing on external APIs first. 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: us...@infra.apache.org > Migrate CacheStatistics to use std::chrono > -- > > Key: GEODE-3392 > URL: https://issues.apache.org/jira/browse/GEODE-3392 > Project: Geode > Issue Type: Improvement > Components: native client >Reporter: Ernest Burghardt > > virtual std::chrono::time_point getLastModifiedTime() const; > /** >* For an entry, returns the last time it was accessed via >* @see Region::get >* @see getLastModifiedTime >*/ > virtual std::chrono::time_point getLastAccessedTime() const; > private: > virtual void setLastAccessedTime(std::chrono::time_point lat); > virtual void setLastModifiedTime(std::chrono::time_point lmt); > std::atomic m_lastAccessTime; > std::atomic m_lastModifiedTime; -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16253607#comment-16253607 ] ASF GitHub Bot commented on GEODE-3392: --- pivotal-jbarrett commented on a change in pull request #150: GEODE-3392: Converts CacheStatistics to std::chrono. URL: https://github.com/apache/geode-native/pull/150#discussion_r151157956 ## File path: clicache/test/TimeUtilsTests.cpp ## @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "begin_native.hpp" +#include +#include "end_native.hpp" +#include "TimeUtils.hpp" + +using namespace System; +using namespace System::Text; +using namespace System::Collections::Generic; +using namespace Microsoft::VisualStudio::TestTools::UnitTesting; + +using namespace std::chrono; + +using namespace Apache::Geode::Client; + +namespace cliunittests +{ + [TestClass] + public ref class TimeUtilsTests + { + private: + TestContext^ testContextInstance; + + public: + /// + ///Gets or sets the test context which provides + ///information about and functionality for the current test run. + /// + property Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ TestContext + { + Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ get() + { + return testContextInstance; + } + System::Void set(Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ value) + { + testContextInstance = value; + } + }; + + #pragma region Additional test attributes + // + //You can use the following additional attributes as you write your tests: + // + //Use ClassInitialize to run code before running the first test in the class + //[ClassInitialize()] + //static void MyClassInitialize(TestContext^ testContext) {}; + // + //Use ClassCleanup to run code after all tests in a class have run + //[ClassCleanup()] + //static void MyClassCleanup() {}; + // + //Use TestInitialize to run code before running each test + //[TestInitialize()] + //void MyTestInitialize() {}; + // + //Use TestCleanup to run code after each test has run + //[TestCleanup()] + //void MyTestCleanup() {}; + // + #pragma endregion + + [TestMethod] Review comment: Grrr! Let me look into what VS is doing there. Wish we could find a good C++/CLR formatter. 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: us...@infra.apache.org > Migrate CacheStatistics to use std::chrono > -- > > Key: GEODE-3392 > URL: https://issues.apache.org/jira/browse/GEODE-3392 > Project: Geode > Issue Type: Improvement > Components: native client >Reporter: Ernest Burghardt > > virtual std::chrono::time_point getLastModifiedTime() const; > /** >* For an entry, returns the last time it was accessed via >* @see Region::get >* @see getLastModifiedTime >*/ > virtual std::chrono::time_point getLastAccessedTime() const; > private: > virtual void setLastAccessedTime(std::chrono::time_point lat); > virtual void setLastModifiedTime(std::chrono::time_point lmt); > std::atomic m_lastAccessTime; > std::atomic m_lastModifiedTime; -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16253592#comment-16253592 ] ASF GitHub Bot commented on GEODE-3392: --- dgkimura commented on a change in pull request #150: GEODE-3392: Converts CacheStatistics to std::chrono. URL: https://github.com/apache/geode-native/pull/150#discussion_r151154153 ## File path: clicache/test/TimeUtilsTests.cpp ## @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "begin_native.hpp" +#include +#include "end_native.hpp" +#include "TimeUtils.hpp" + +using namespace System; +using namespace System::Text; +using namespace System::Collections::Generic; +using namespace Microsoft::VisualStudio::TestTools::UnitTesting; + +using namespace std::chrono; + +using namespace Apache::Geode::Client; + +namespace cliunittests +{ + [TestClass] + public ref class TimeUtilsTests + { + private: + TestContext^ testContextInstance; + + public: + /// + ///Gets or sets the test context which provides + ///information about and functionality for the current test run. + /// + property Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ TestContext + { + Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ get() + { + return testContextInstance; + } + System::Void set(Microsoft::VisualStudio::TestTools::UnitTesting::TestContext^ value) + { + testContextInstance = value; + } + }; + + #pragma region Additional test attributes + // + //You can use the following additional attributes as you write your tests: + // + //Use ClassInitialize to run code before running the first test in the class + //[ClassInitialize()] + //static void MyClassInitialize(TestContext^ testContext) {}; + // + //Use ClassCleanup to run code after all tests in a class have run + //[ClassCleanup()] + //static void MyClassCleanup() {}; + // + //Use TestInitialize to run code before running each test + //[TestInitialize()] + //void MyTestInitialize() {}; + // + //Use TestCleanup to run code after each test has run + //[TestCleanup()] + //void MyTestCleanup() {}; + // + #pragma endregion + + [TestMethod] Review comment: Nit - mixing spaces/tabs in this file 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: us...@infra.apache.org > Migrate CacheStatistics to use std::chrono > -- > > Key: GEODE-3392 > URL: https://issues.apache.org/jira/browse/GEODE-3392 > Project: Geode > Issue Type: Improvement > Components: native client >Reporter: Ernest Burghardt > > virtual std::chrono::time_point getLastModifiedTime() const; > /** >* For an entry, returns the last time it was accessed via >* @see Region::get >* @see getLastModifiedTime >*/ > virtual std::chrono::time_point getLastAccessedTime() const; > private: > virtual void setLastAccessedTime(std::chrono::time_point lat); > virtual void setLastModifiedTime(std::chrono::time_point lmt); > std::atomic m_lastAccessTime; > std::atomic m_lastModifiedTime; -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16253593#comment-16253593 ] ASF GitHub Bot commented on GEODE-3392: --- dgkimura commented on a change in pull request #150: GEODE-3392: Converts CacheStatistics to std::chrono. URL: https://github.com/apache/geode-native/pull/150#discussion_r151152356 ## File path: cppcache/src/ExpiryTaskManager.cpp ## @@ -61,20 +61,6 @@ long ExpiryTaskManager::scheduleExpiryTask(ACE_Event_Handler* handler, return m_reactor->schedule_timer(handler, 0, expTimeValue, intervalValue); } -long ExpiryTaskManager::scheduleExpiryTask( Review comment: I thought we were trying to get rid of the other scheduleExpiryTask above that took `uint32_t`? 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: us...@infra.apache.org > Migrate CacheStatistics to use std::chrono > -- > > Key: GEODE-3392 > URL: https://issues.apache.org/jira/browse/GEODE-3392 > Project: Geode > Issue Type: Improvement > Components: native client >Reporter: Ernest Burghardt > > virtual std::chrono::time_point getLastModifiedTime() const; > /** >* For an entry, returns the last time it was accessed via >* @see Region::get >* @see getLastModifiedTime >*/ > virtual std::chrono::time_point getLastAccessedTime() const; > private: > virtual void setLastAccessedTime(std::chrono::time_point lat); > virtual void setLastModifiedTime(std::chrono::time_point lmt); > std::atomic m_lastAccessTime; > std::atomic m_lastModifiedTime; -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (GEODE-3392) Migrate CacheStatistics to use std::chrono
[ https://issues.apache.org/jira/browse/GEODE-3392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16252970#comment-16252970 ] ASF GitHub Bot commented on GEODE-3392: --- pivotal-jbarrett opened a new pull request #150: GEODE-3392: Converts CacheStatistics to std::chrono. URL: https://github.com/apache/geode-native/pull/150 - Convert .NET CacheStatistics to DateTime. 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: us...@infra.apache.org > Migrate CacheStatistics to use std::chrono > -- > > Key: GEODE-3392 > URL: https://issues.apache.org/jira/browse/GEODE-3392 > Project: Geode > Issue Type: Improvement > Components: native client >Reporter: Ernest Burghardt > > virtual std::chrono::time_point getLastModifiedTime() const; > /** >* For an entry, returns the last time it was accessed via >* @see Region::get >* @see getLastModifiedTime >*/ > virtual std::chrono::time_point getLastAccessedTime() const; > private: > virtual void setLastAccessedTime(std::chrono::time_point lat); > virtual void setLastModifiedTime(std::chrono::time_point lmt); > std::atomic m_lastAccessTime; > std::atomic m_lastModifiedTime; -- This message was sent by Atlassian JIRA (v6.4.14#64029)