You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Barrett Oglesby (JIRA)" <ji...@apache.org> on 2015/07/31 19:52:04 UTC
[jira] [Created] (GEODE-184) The gfsh 'locate entry' command fails
to find the entry on partitioned regions if the key is not a string
Barrett Oglesby created GEODE-184:
-------------------------------------
Summary: The gfsh 'locate entry' command fails to find the entry on partitioned regions if the key is not a string
Key: GEODE-184
URL: https://issues.apache.org/jira/browse/GEODE-184
Project: Geode
Issue Type: Bug
Reporter: Barrett Oglesby
Priority: Minor
The *DataCommandFunction locateEntry* method uses the input string _key_ instead of the converted _keyObject_ in the *get*, *getPrimaryMemberForKey* and *getKeyInfo* calls in the *PartitionedRegion* case.
The current code looks like:
{code:title=DataCommandFunction.java|borderStyle=solid}
Object keyObject = null;
try{
keyObject = getClassObject(key,keyClass);
....
if (region instanceof PartitionedRegion) {
Region localRegion = PartitionRegionHelper.getLocalData((PartitionedRegion)region);
value = localRegion.get(key);
if(value!=null){
DistributedMember primaryMember = PartitionRegionHelper.getPrimaryMemberForKey(region, key);
int bucketId = pr.getKeyInfo(key).getBucketId();
{code}
The fixed code should be:
{code:title=DataCommandFunction.java|borderStyle=solid}
value = localRegion.get(keyObject);
if(value!=null){
DistributedMember primaryMember = PartitionRegionHelper.getPrimaryMemberForKey(region, keyObject);
int bucketId = pr.getKeyInfo(keyObject).getBucketId();
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)