[jira] [Commented] (GEODE-2436) Geode doesn't handle byte[] as key
[ https://issues.apache.org/jira/browse/GEODE-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15864689#comment-15864689 ] Hitesh Khamesra commented on GEODE-2436: This is just another improvement in redisAdapter to reduce the memory footprint. We also use ByteArrayWrapper for values; we should be able to use byte[] for that. > Geode doesn't handle byte[] as key > -- > > Key: GEODE-2436 > URL: https://issues.apache.org/jira/browse/GEODE-2436 > Project: Geode > Issue Type: Improvement > Components: regions >Reporter: Hitesh Khamesra > > Geode doesn't handle byte[] as key. "byte[]" doesn't implement > hashcode/equals method, it just returns native hashcode. Because of that > following code returns null for key k2; > {code} > Cache c = CacheFactory.getAnyInstance(); > > Region region = c.getRegion("primitiveKVStore"); >byte[] k1 = new byte[] {1,2}; > > region.put(k1, k1); > byte[] k2 = new byte[] {1,2}; > System.out.println(">> " + region.get(k2)); > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (GEODE-2436) Geode doesn't handle byte[] as key
[ https://issues.apache.org/jira/browse/GEODE-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15864089#comment-15864089 ] Bruce Schuchardt commented on GEODE-2436: - Why not use the existing ByteArrayWrapper class? > Geode doesn't handle byte[] as key > -- > > Key: GEODE-2436 > URL: https://issues.apache.org/jira/browse/GEODE-2436 > Project: Geode > Issue Type: Improvement > Components: regions >Reporter: Hitesh Khamesra > > Geode doesn't handle byte[] as key. "byte[]" doesn't implement > hashcode/equals method, it just returns native hashcode. Because of that > following code returns null for key k2; > {code} > Cache c = CacheFactory.getAnyInstance(); > > Region region = c.getRegion("primitiveKVStore"); >byte[] k1 = new byte[] {1,2}; > > region.put(k1, k1); > byte[] k2 = new byte[] {1,2}; > System.out.println(">> " + region.get(k2)); > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (GEODE-2436) Geode doesn't handle byte[] as key
[ https://issues.apache.org/jira/browse/GEODE-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15862149#comment-15862149 ] Jared Stewart commented on GEODE-2436: -- One option which may or may not have an acceptable performance overhead would be to store the byte[] as a Base64 encoded string. > Geode doesn't handle byte[] as key > -- > > Key: GEODE-2436 > URL: https://issues.apache.org/jira/browse/GEODE-2436 > Project: Geode > Issue Type: Improvement > Components: regions >Reporter: Hitesh Khamesra > > Geode doesn't handle byte[] as key. "byte[]" doesn't implement > hashcode/equals method, it just returns native hashcode. Because of that > following code returns null for key k2; > {code} > Cache c = CacheFactory.getAnyInstance(); > > Region region = c.getRegion("primitiveKVStore"); >byte[] k1 = new byte[] {1,2}; > > region.put(k1, k1); > byte[] k2 = new byte[] {1,2}; > System.out.println(">> " + region.get(k2)); > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (GEODE-2436) Geode doesn't handle byte[] as key
[ https://issues.apache.org/jira/browse/GEODE-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15862126#comment-15862126 ] Darrel Schneider commented on GEODE-2436: - Geode does not support any instance of a java array as a key. Java arrays have identity equals and hashCode which does not work as a Region key. We do document that a class can only be used as a Region key if it implements equals and hashCode. > Geode doesn't handle byte[] as key > -- > > Key: GEODE-2436 > URL: https://issues.apache.org/jira/browse/GEODE-2436 > Project: Geode > Issue Type: Improvement > Components: regions >Reporter: Hitesh Khamesra > > Geode doesn't handle byte[] as key. "byte[]" doesn't implement > hashcode/equals method, it just returns native hashcode. Because of that > following code returns null for key k2; > {code} > Cache c = CacheFactory.getAnyInstance(); > > Region region = c.getRegion("primitiveKVStore"); >byte[] k1 = new byte[] {1,2}; > > region.put(k1, k1); > byte[] k2 = new byte[] {1,2}; > System.out.println(">> " + region.get(k2)); > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (GEODE-2436) Geode doesn't handle byte[] as key
[ https://issues.apache.org/jira/browse/GEODE-2436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15855210#comment-15855210 ] Hitesh Khamesra commented on GEODE-2436: This feature can help in redisAdapter where we want to store byte[] as key. > Geode doesn't handle byte[] as key > -- > > Key: GEODE-2436 > URL: https://issues.apache.org/jira/browse/GEODE-2436 > Project: Geode > Issue Type: Improvement > Components: regions >Reporter: Hitesh Khamesra > > Geode doesn't handle byte[] as key. "byte[]" doesn't implement > hashcode/equals method, it just returns native hashcode. Because of that > following code returns null for key k2; > {code} > Cache c = CacheFactory.getAnyInstance(); > > Region region = c.getRegion("primitiveKVStore"); >byte[] k1 = new byte[] {1,2}; > > region.put(k1, k1); > byte[] k2 = new byte[] {1,2}; > System.out.println(">> " + region.get(k2)); > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)