[jira] [Created] (GEODE-5025) Update remaining CacheableBuiltins macros into templates

2018-04-06 Thread David Kimura (JIRA)
David Kimura created GEODE-5025:
---

 Summary: Update remaining CacheableBuiltins macros into templates
 Key: GEODE-5025
 URL: https://issues.apache.org/jira/browse/GEODE-5025
 Project: Geode
  Issue Type: Improvement
  Components: native client
Reporter: David Kimura


Templates are more C++ style than macros and easier to debug.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (GEODE-4412) Cache should not extend std::enable_shared_from_this

2018-02-07 Thread David Kimura (JIRA)

 [ 
https://issues.apache.org/jira/browse/GEODE-4412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Kimura resolved GEODE-4412.
-
Resolution: Fixed

> Cache should not extend std::enable_shared_from_this
> 
>
> Key: GEODE-4412
> URL: https://issues.apache.org/jira/browse/GEODE-4412
> Project: Geode
>  Issue Type: Task
>  Components: native client
>Reporter: Jacob S. Barrett
>Priority: Major
>  Labels: pull-request-available
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> Cache is not returned as a shared pointer and does not need to be shared from 
> this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GEODE-4449) Replace macro-templates with plain templates

2018-01-31 Thread David Kimura (JIRA)
David Kimura created GEODE-4449:
---

 Summary: Replace macro-templates with plain templates
 Key: GEODE-4449
 URL: https://issues.apache.org/jira/browse/GEODE-4449
 Project: Geode
  Issue Type: Improvement
  Components: native client
Reporter: David Kimura


Replace macro-templates in CacheableBuiltins.hpp from...

_GEODE_CACHEABLE_ARRAY_TYPE_(int8_t, CacheableBytes);
_GEODE_CACHEABLE_ARRAY_TYPE_(std::shared_ptr, 
CacheableStringArray);

into...

using CacheableBytes = CacheableArray;
using CacheableStringArray = CacheableArray;

It also makes the code debuggable since most debuggers can step through 
templates, but not macros.  It also removes an unnecessary level of indirection 
by the preprocessor.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (GEODE-4032) Investigate enum types being used as integer values

2017-11-29 Thread David Kimura (JIRA)
David Kimura created GEODE-4032:
---

 Summary: Investigate enum types being used as integer values
 Key: GEODE-4032
 URL: https://issues.apache.org/jira/browse/GEODE-4032
 Project: Geode
  Issue Type: Improvement
  Components: native client
Reporter: David Kimura


DiskPolicyType and ExpirationAction have enums being used as integers.  
Evaluate whether enum is the correct data type to use here.  Consider change to 
use {{enum class DiskPolicy}} and {{enum class ExpirationAction}} which would 
throw compiler errors unless {{static_cast}} is made.

Example in {{ExpirationAction.hpp}}:
{noformat}
class CPPCACHE_EXPORT ExpirationAction {
 public:
  typedef enum { INVALIDATE = 0, LOCAL_INVALIDATE, DESTROY, LOCAL_DESTROY, 
INVALID_ACTION } Action;
  // ...
};
{noformat}

With usages in {{ExpirationAction.cpp}} like...
{noformat}
const char* ExpirationAction::fromOrdinal(const int ordinal) {
  if (INVALIDATE <= ordinal && ordinal <= LOCAL_DESTROY) {
return names[ordinal];
  }
  return nullptr;
}
{noformat}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (GEODE-3625) Remove platform specific stacktrace implementation

2017-11-20 Thread David Kimura (JIRA)

 [ 
https://issues.apache.org/jira/browse/GEODE-3625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Kimura closed GEODE-3625.
---

> Remove platform specific stacktrace implementation
> --
>
> Key: GEODE-3625
> URL: https://issues.apache.org/jira/browse/GEODE-3625
> Project: Geode
>  Issue Type: Improvement
>  Components: native client
>Reporter: David Kimura
>
> Current stacktrace implementation is unnecessarily hard to maintain (4 
> implementations - 1 per platform: mac, linux, windows, solaris) and 
> incomplete (solaris isn't fully implemented).  We should move to a platform 
> agnostic implementation leveraging boost::stacktrace library.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3972) Disambiguate the Region interface template resolutions

2017-11-13 Thread David Kimura (JIRA)
David Kimura created GEODE-3972:
---

 Summary: Disambiguate the Region interface template resolutions
 Key: GEODE-3972
 URL: https://issues.apache.org/jira/browse/GEODE-3972
 Project: Geode
  Issue Type: Improvement
  Components: native client
Reporter: David Kimura


Region interface has unintuitive template type resolution.  For example: 
{{Region::put}} has following signatures:

{noformat}
virtual void put(const CacheableKeyPtr& key, const CacheablePtr& value, 
const SerializablePtr& aCallbackArgument = nullptr) = 0;

template 
inline void put(const KEYTYPE& key, const VALUETYPE& value, const 
SerializablePtr& arg = nullptr) {
  put(createKey(key), createValue(value), arg);
}
  
template 
inline void put(const KEYTYPE& key, const CacheablePtr& value, const 
SerializablePtr& arg = nullptr) {
  put(createKey(key), value, arg);
}
  
template 
inline void put(const CacheableKeyPtr& key, const VALUETYPE& value, const 
SerializablePtr& arg = nullptr) {
  put(key, createValue(value), arg);
}
{noformat}

If user calls {{region.put(a_key, CacheableString::create("a_value"), ...)}} 
they might expect it to call non-templated put since CacheableString derives 
from Cacheable.  Instead it seems to call the templated method.  Ideally, we 
should probably have our API match non-templated method signature in this 
particular case.

One solution may be to use type traits.  So, template signature on put 
interface may look something like:

{noformat}
template 
inline void put(
  const typename std::enable_if::type& 
key = 0,
  const typename 
std::enable_if::type& value = 0,
  const SerializablePtr& arg = nullptr) {
{noformat}

And then implement {{is_integral_or_char_ptr}}.  We should then evaluate 
whether {{createValue}} and {{createKey}} templates are needed any longer.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (GEODE-3852) Fix race condition causing intermittent test failure

2017-10-17 Thread David Kimura (JIRA)

 [ 
https://issues.apache.org/jira/browse/GEODE-3852?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Kimura updated GEODE-3852:

Attachment: SampleFailureTest.cs

Sample testcase that causes seemingly similar issues.

> Fix race condition causing intermittent test failure
> 
>
> Key: GEODE-3852
> URL: https://issues.apache.org/jira/browse/GEODE-3852
> Project: Geode
>  Issue Type: Bug
>  Components: native client
>Reporter: David Kimura
> Attachments: SampleFailureTest.cs
>
>
> ThinClientQueryTestsN fails intermittently.  Hypothesis is garbage collection 
> race-condition leading to access violations of deleted data.
> Here's an example stacktrace:
> {noformat}
>   [Managed to Native Transition]  
>   Apache.Geode.dll!std::shared_ptr::`scalar 
> deleting destructor' + 0x6b bytes   
> > 
> > Apache.Geode.dll!Apache::Geode::Client::native_shared_ptr::!native_shared_ptr()
> >  Line 27 + 0x13 bytesC++
>   
> Apache.Geode.dll!Apache::Geode::Client::native_shared_ptr::Dispose(bool
>  A_0) + 0x1e bytes C++
>   [Native to Managed Transition]  
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3852) Fix race condition causing intermittent test failure

2017-10-17 Thread David Kimura (JIRA)
David Kimura created GEODE-3852:
---

 Summary: Fix race condition causing intermittent test failure
 Key: GEODE-3852
 URL: https://issues.apache.org/jira/browse/GEODE-3852
 Project: Geode
  Issue Type: Bug
  Components: native client
Reporter: David Kimura


ThinClientQueryTestsN fails intermittently.  Hypothesis is garbage collection 
race-condition leading to access violations of deleted data.

Here's an example stacktrace:

{noformat}
[Managed to Native Transition]  
Apache.Geode.dll!std::shared_ptr::`scalar 
deleting destructor' + 0x6b bytes   
>   
> Apache.Geode.dll!Apache::Geode::Client::native_shared_ptr::!native_shared_ptr()
>  Line 27 + 0x13 bytesC++

Apache.Geode.dll!Apache::Geode::Client::native_shared_ptr::Dispose(bool
 A_0) + 0x1e bytes C++
[Native to Managed Transition]  
{noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3832) Add cleanup to .NET tests

2017-10-13 Thread David Kimura (JIRA)
David Kimura created GEODE-3832:
---

 Summary: Add cleanup to .NET tests
 Key: GEODE-3832
 URL: https://issues.apache.org/jira/browse/GEODE-3832
 Project: Geode
  Issue Type: Test
  Components: native client
Reporter: David Kimura


Flaky test ThinClientPoolTestsN sometimes leaves lingering java processes 
(server/locator).  If we cleanup after the test then the thought is that we can 
do a clean retry.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3674) Fix testThinClientSecurityMultiUserTest

2017-09-19 Thread David Kimura (JIRA)
David Kimura created GEODE-3674:
---

 Summary: Fix testThinClientSecurityMultiUserTest
 Key: GEODE-3674
 URL: https://issues.apache.org/jira/browse/GEODE-3674
 Project: Geode
  Issue Type: Bug
  Components: native client
Reporter: David Kimura


Fix multi-user security test to provide reliable/meaningful results.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3645) Update API CacheFactory::create to return cache object

2017-09-18 Thread David Kimura (JIRA)
David Kimura created GEODE-3645:
---

 Summary: Update API CacheFactory::create to return cache object
 Key: GEODE-3645
 URL: https://issues.apache.org/jira/browse/GEODE-3645
 Project: Geode
  Issue Type: New Feature
  Components: native client
Reporter: David Kimura


As an application developer I want to control the stack vs heap allocation of 
my cache object.  If we change CacheFactory::create to return a cache object 
then the application user can pick an allocation scheme.  This also allows 
application developers to bypass smart pointer complexity until the developer 
deems them necessary.

Example:

{noformat}
auto cache = CacheFactory::createFactory().create();
auto cacheptr = std::make_shared(CacheFactory::createFactory().create());
{noformat}

Difficulty of implementation is due to Cache/CacheImpl circular dependency.  
Here are a few examples of various approaches to consider:

https://gist.github.com/pivotal-jbarrett/52ba9ec5de0b494368d1c5282ef188ef
https://gist.github.com/pivotal-jbarrett/c483f7f41b187f0ed8c80108aa6a

Here are the related email threads of interest:

http://markmail.org/message/in5e337npq5euslh
http://markmail.org/message/lp2rx2rtyblg72fv




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3625) Remove platform specific stacktrace implementation

2017-09-15 Thread David Kimura (JIRA)
David Kimura created GEODE-3625:
---

 Summary: Remove platform specific stacktrace implementation
 Key: GEODE-3625
 URL: https://issues.apache.org/jira/browse/GEODE-3625
 Project: Geode
  Issue Type: Improvement
  Components: native client
Reporter: David Kimura


Current stacktrace implementation is unnecessarily hard to maintain (4 
implementations - 1 per platform: mac, linux, windows, solaris) and incomplete 
(solaris isn't fully implemented).  We should move to a platform agnostic 
implementation leveraging boost::stacktrace library.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3624) Update exceptions to more closely match standard exception interface

2017-09-15 Thread David Kimura (JIRA)
David Kimura created GEODE-3624:
---

 Summary: Update exceptions to more closely match standard 
exception interface
 Key: GEODE-3624
 URL: https://issues.apache.org/jira/browse/GEODE-3624
 Project: Geode
  Issue Type: Improvement
  Components: native client
Reporter: David Kimura


Native client library should follow standard exception interface for any thrown 
exceptions.  This means one less custom interface that a customer or developer 
needs to understand.

{noformat}
namespace apache {
namespace geode {
namespace client {

class Exception : public std::exception {...};

class IllegalArgumentException : public Exception {...};

class TransactionException : public Exception {...};

class RollbackException : public TransactionException {...};

// NO - class IllegalArgumentException : public Exception, public
std::invalid_argument {...};

// NO - class IllegalArgumentException : public std::invalid_argument {...};

// NO - class IllegalArgumentException : public Exception, public
TransactionException {...};

}
}
}
{noformat}




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (GEODE-3565) Remove default Server/Locator with Pool

2017-09-11 Thread David Kimura (JIRA)

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

David Kimura commented on GEODE-3565:
-

If anybody decides to fix this, consider follow up on Java side on: 
https://jira-pivotal.atlassian.net/browse/GEM-384

> Remove default Server/Locator with Pool
> ---
>
> Key: GEODE-3565
> URL: https://issues.apache.org/jira/browse/GEODE-3565
> Project: Geode
>  Issue Type: Bug
>  Components: native client
>Reporter: David Kimura
>
> PoolFactory has hidden behavior where if user doesn't specify a server or 
> locator it will create a default pool connecting to a default endpoint.  GSS 
> doesn't think anybody is using this hidden behavior so we should probably 
> remove it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3565) Remove default Server/Locator with Pool

2017-09-06 Thread David Kimura (JIRA)
David Kimura created GEODE-3565:
---

 Summary: Remove default Server/Locator with Pool
 Key: GEODE-3565
 URL: https://issues.apache.org/jira/browse/GEODE-3565
 Project: Geode
  Issue Type: Bug
  Components: native client
Reporter: David Kimura


PoolFactory has hidden behavior where if user doesn't specify a server or 
locator it will create a default pool connecting to a default endpoint.  GSS 
doesn't think anybody is using this hidden behavior so we should probably 
remove it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3497) Fix failing test on Solaris SPARC

2017-08-21 Thread David Kimura (JIRA)
David Kimura created GEODE-3497:
---

 Summary: Fix failing test on Solaris SPARC
 Key: GEODE-3497
 URL: https://issues.apache.org/jira/browse/GEODE-3497
 Project: Geode
  Issue Type: Bug
  Components: native client
Reporter: David Kimura


ClientProxyMembershipIDFactory unittest fails on Solaris SPARC because of 
incorrect assumptions about big/little endianness.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3453) Fix native client function tests to use updated API

2017-08-16 Thread David Kimura (JIRA)
David Kimura created GEODE-3453:
---

 Summary: Fix native client function tests to use updated API
 Key: GEODE-3453
 URL: https://issues.apache.org/jira/browse/GEODE-3453
 Project: Geode
  Issue Type: Bug
  Components: native client
Reporter: David Kimura


Remove deprecated API call in order to build and test against latest server.

This change broke test code calling into deprecated function: 
https://issues.apache.org/jira/browse/GEODE-254

Following diff should be sufficient to fix this issue.
{noformat}
diff --git a/src/tests/javaobject/GetFunctionExeHA.java 
b/src/tests/javaobject/GetFunctionExeHA.java
index 62216c07..ece5f337 100644
--- a/src/tests/javaobject/GetFunctionExeHA.java
+++ b/src/tests/javaobject/GetFunctionExeHA.java
@@ -35,7 +35,7 @@ public class GetFunctionExeHA extends FunctionAdapter 
implements Declarable{
 RegionFunctionContext context = (RegionFunctionContext)fc;
 System.out.println("Data set :: " + context.getDataSet());
 Region region = PartitionRegionHelper.getLocalDataForContext(context);
-Set keys = region.keys();
+Set keys = region.keySet();
 Iterator itr = keys.iterator();
 ResultSender sender = context.getResultSender();
 Object k = null;
{noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (GEODE-3173) Upgrade to gtest 1.8

2017-07-06 Thread David Kimura (JIRA)
David Kimura created GEODE-3173:
---

 Summary: Upgrade to gtest 1.8
 Key: GEODE-3173
 URL: https://issues.apache.org/jira/browse/GEODE-3173
 Project: Geode
  Issue Type: Test
  Components: native client
Reporter: David Kimura


If we upgrade to gtest 1.8 then we can also get gmock since they are now 
bundled together.

https://github.com/google/googletest/tree/release-1.8.0



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)