pivotal-jbarrett commented on a change in pull request #893:
URL: https://github.com/apache/geode-native/pull/893#discussion_r747751294
##########
File path: cppcache/include/geode/DataInput.hpp
##########
@@ -381,7 +381,7 @@ class APACHE_GEODE_EXPORT DataInput {
} else {
int8_t** tmpArray;
int32_t* tmpLengtharr;
- _GEODE_NEW(tmpArray, int8_t* [arrLen]);
+ _GEODE_NEW(tmpArray, int8_t * [arrLen]);
Review comment:
Unrelated incorrect format change.
##########
File path: cppcache/include/geode/CacheableString.hpp
##########
@@ -54,11 +54,11 @@ class APACHE_GEODE_EXPORT CacheableString
: m_str(std::move(value)), m_hashcode(0) {
bool ascii = isAscii(m_str);
- m_type = m_str.length() > (std::numeric_limits<uint16_t>::max)()
- ? ascii ? DSCode::CacheableASCIIStringHuge
- : DSCode::CacheableStringHuge
- : ascii ? DSCode::CacheableASCIIString
- : DSCode::CacheableString;
+ m_type =
Review comment:
Unrelated formatting change.
##########
File path: cppcache/integration-test/testThinClientClearRegion.cpp
##########
@@ -79,7 +80,30 @@ DUNIT_TASK(CLIENT1, SetupClient1)
auto wter = std::make_shared<MyCacheWriter>();
mtor->setCacheListener(lster);
mtor->setCacheWriter(wter);
- regPtr->registerAllKeys();
+ // regPtr->registerAllKeys();
Review comment:
Commented out code needs to be deleted.
##########
File path: cppcache/integration-test/testThinClientPdxTests.cpp
##########
@@ -4435,12 +4435,14 @@ DUNIT_MAIN
// PDXReaderWriterInvalidUsage
{
- // disable see bug 999 for more details.
- // testReaderWriterInvalidUsage();
+ // disable see bug 999 for more details.
Review comment:
Incorrect formatting changes.
##########
File path: cppcache/integration-test/testThinClientSecurityPostAuthorization.cpp
##########
@@ -89,9 +89,7 @@ void initClientAuth(char userType, int clientNum = 1) {
config->insert("security-password", "geode1");
break;
}
- default: {
- break;
- }
+ default: { break; }
Review comment:
Incorrect formatting changes.
##########
File path: cppcache/integration-test/testThinClientClearRegion.cpp
##########
@@ -79,7 +80,30 @@ DUNIT_TASK(CLIENT1, SetupClient1)
auto wter = std::make_shared<MyCacheWriter>();
mtor->setCacheListener(lster);
mtor->setCacheWriter(wter);
- regPtr->registerAllKeys();
+ // regPtr->registerAllKeys();
+
+ //*** Mike
+ int NUMKEYS = 500;
+ int BLKSIZE = 500;
+ // auto keyPtr = CacheableKey::create("key01");
+ // auto valPtr = CacheableBytes::create(
+ // std::vector<int8_t>{'v', 'a', 'l', 'u', 'e', '0', '1'});
+ // for (int i = 0; i < NUMKEYS; i++) {
+ // auto keyPtr = CacheableKey::create(i);
+ // regPtr->put(keyPtr, valPtr);
+ //}
+
+ HashMapOfCacheable map0;
+ map0.clear();
+ auto valPtr = CacheableBytes::create(
Review comment:
This change appears unrelated to the issue being addressed. What is the
purpose of this modified legacy test?
##########
File path: cppcache/integration/test/RegisterKeysTest.cpp
##########
@@ -575,4 +581,257 @@ TEST(RegisterKeysTest, RegisterAnyWithProxyRegion) {
cache.close();
}
+apache::geode::client::Cache createCache() {
+ return apache::geode::client::CacheFactory()
+ .set("log-level", "none")
+ .set("statistic-sampling-enabled", "false")
+ .create();
+}
+
+std::shared_ptr<apache::geode::client::Pool> createPool(
+ Cluster& cluster, apache::geode::client::Cache& cache) {
+ auto poolFactory = cache.getPoolManager().createFactory();
+ cluster.applyLocators(poolFactory);
+ poolFactory.setSubscriptionEnabled(true); // Per the customer.
+ return poolFactory.create("default");
+}
+
+std::shared_ptr<apache::geode::client::Region> setupRegion(
+ apache::geode::client::Cache& cache,
+ const std::shared_ptr<apache::geode::client::Pool>& pool) {
+ auto region =
+ cache
+ .createRegionFactory(apache::geode::client::RegionShortcut::
+ CACHING_PROXY) // Per the customer.
+ .setPoolName(pool->getName())
+ .create("region");
+
+ return region;
+}
+
+TEST(RegisterKeysTest, DontReceiveValues) {
+ Cluster cluster{LocatorCount{1}, ServerCount{1}};
+
+ cluster.start();
+
+ cluster.getGfsh()
+ .create()
+ .region()
+ .withName("region")
+ .withType("PARTITION")
+ .execute();
+
+ auto cache1 = createCache();
+ auto pool1 = createPool(cluster, cache1);
+ auto region1 = setupRegion(cache1, pool1);
+ auto attrMutator = region1->getAttributesMutator();
+
+ // put key/value pairs in the region using cache2
+
+ auto cache2 = createCache();
+ auto pool2 = createPool(cluster, cache2);
+ auto region2 = setupRegion(cache2, pool2);
+
+ const int NUMKEYS = 100;
+ for (int i = 0; i < NUMKEYS; i++) {
+ region2->put(apache::geode::client::CacheableInt32::create(i),
+ apache::geode::client::CacheableInt32::create(i));
+ }
+
+ // register for all keys, but don't get any data
Review comment:
If you have to comment on a block of code to understand what it does it
either needs to be refactored to be self explanatory or moved to a stand alone
method that is appropriately named to describe the action.
##########
File path: cppcache/integration/test/RegisterKeysTest.cpp
##########
@@ -575,4 +581,257 @@ TEST(RegisterKeysTest, RegisterAnyWithProxyRegion) {
cache.close();
}
+apache::geode::client::Cache createCache() {
+ return apache::geode::client::CacheFactory()
+ .set("log-level", "none")
+ .set("statistic-sampling-enabled", "false")
+ .create();
+}
+
+std::shared_ptr<apache::geode::client::Pool> createPool(
+ Cluster& cluster, apache::geode::client::Cache& cache) {
+ auto poolFactory = cache.getPoolManager().createFactory();
+ cluster.applyLocators(poolFactory);
+ poolFactory.setSubscriptionEnabled(true); // Per the customer.
+ return poolFactory.create("default");
+}
+
+std::shared_ptr<apache::geode::client::Region> setupRegion(
+ apache::geode::client::Cache& cache,
+ const std::shared_ptr<apache::geode::client::Pool>& pool) {
+ auto region =
+ cache
+ .createRegionFactory(apache::geode::client::RegionShortcut::
+ CACHING_PROXY) // Per the customer.
Review comment:
Unhelpful comments.
##########
File path: cppcache/integration/framework/Cluster.cpp
##########
@@ -441,9 +441,10 @@ void Cluster::start(std::function<void()>
extraGfshCommands) {
servers_.reserve(initialServers_.size());
std::string xmlFile;
for (size_t i = 0; i < initialServers_.size(); i++) {
- xmlFile = (cacheXMLFiles_.size() == 0) ? ""
- : cacheXMLFiles_.size() == 1 ? cacheXMLFiles_[0]
- : cacheXMLFiles_[i];
+ xmlFile = (cacheXMLFiles_.size() == 0)
Review comment:
Unrelated formatting changes?
##########
File path: netcore/shared/Config.cs
##########
@@ -15,20 +15,32 @@
* limitations under the License.
Review comment:
Unrelated generated files checked in?
##########
File path: cppcache/src/ExceptionTypes.cpp
##########
@@ -73,8 +73,8 @@ using apache::geode::client::UnknownException;
throw NotConnectedException{message};
}
-[[noreturn]] void messageException(std::string message, std::string& exMsg,
- GfErrType, std::string) {
+ [[noreturn]] void messageException(std::string message, std::string& exMsg,
Review comment:
Incorrect and unrelated formatting changes.
##########
File path: cppcache/src/VersionedCacheableObjectPartList.cpp
##########
@@ -234,9 +234,7 @@ void VersionedCacheableObjectPartList::fromData(DataInput&
input) {
versionTag->setInternalMemID(ids.at(idNumber));
break;
}
- default: {
- break;
- }
+ default: { break; }
Review comment:
Unrelated and incorrect formatting change.
##########
File path: netcore/netcore-lib/CacheablePrimitives.cs
##########
@@ -0,0 +1,10 @@
+using System;
Review comment:
Unrelated changes.
##########
File path: cppcache/integration-test/testThinClientClearRegion.cpp
##########
@@ -95,14 +119,14 @@ DUNIT_TASK(CLIENT2, SetupClient2)
auto valPtr = CacheableBytes::create(
std::vector<int8_t>{'v', 'a', 'l', 'u', 'e', '0', '1'});
regPtr->put(keyPtr, valPtr);
- ASSERT(regPtr->size() == 1, "size incorrect");
+ // ASSERT(regPtr->size() == 1, "size incorrect");
Review comment:
Delete commented out code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]